Created
March 29, 2020 22:18
-
-
Save dimohamdy/a9cb9daf859c6475711669c5049172df to your computer and use it in GitHub Desktop.
This file contains 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
import Foundation | |
extension Optional where Wrapped: Collection { | |
public var isNilOrEmpty: Bool { | |
switch self { | |
case .none: | |
return true | |
case .some(let collection): | |
return collection.isEmpty | |
} | |
} | |
} |
Author
dimohamdy
commented
Mar 29, 2020
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment