Created
March 6, 2018 12:56
-
-
Save Anatoli-Petrosyants/ebda6ddef5cf380c31535ad68b027e50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol StringType { | |
| var isEmpty: Bool { get } | |
| } | |
| extension String : StringType { } | |
| extension Optional where Wrapped: StringType { | |
| var isNullOrEmpty: Bool { | |
| return self?.isEmpty ?? true | |
| } | |
| } | |
| extension Optional where Wrapped: CollectionType { | |
| var isNullOrEmpty: Bool { | |
| return self?.isEmpty ?? true | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment