TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2016 |
SPMSupports SPM | ✓ |
It is impossible to add a constraint of optional in generics. But, OptionalProtocol will enable that.
func unwrap<T: OptionalProtocol>(object: T) -> T.Wrapped
(object: T) must be Optional
OptionalProtocol is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "OptionalProtocol"
muukii, [email protected]
OptionalProtocol is available under the MIT license. See the LICENSE file for more info.