Skip to content

Instantly share code, notes, and snippets.

@diogo10
Created October 7, 2020 13:13
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 diogo10/37e085e87764180d65b5fcdc00fa1d6f to your computer and use it in GitHub Desktop.
Save diogo10/37e085e87764180d65b5fcdc00fa1d6f to your computer and use it in GitHub Desktop.
Swiftly some ideias
///In order to avoid "if != nil", do:
var shouldBeAbleToSave: Bool {
let value1 = "something"
let value2 = "another value"
let value3 = nil
return ![value1, value2, value3].contains { $0 == nil }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment