Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bharath2020/aeeb087aa250958e3da5f8435d295d36 to your computer and use it in GitHub Desktop.
Save bharath2020/aeeb087aa250958e3da5f8435d295d36 to your computer and use it in GitHub Desktop.
Custom ImplicitOptionalDescription
extension Optional : CustomStringConvertible {
public var description: String {
switch (self) {
case .none:
return "nil"
case let .some(value):
return "\(value)"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment