OptionalProtocol
It is impossible to add a constraint of optional in generics. But, OptionalProtocol will enable that.
Example
func unwrap<T: OptionalProtocol>(object: T) -> T.Wrapped
(object: T) must be Optional
Requirements
Installation
OptionalProtocol is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "OptionalProtocol"
Author
muukii, m@muukii.me
License
OptionalProtocol is available under the MIT license. See the LICENSE file for more info.