Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift guard-let Statement

func checkAge() {
	
  var age: Int? = 22

  guard let myAge = age else {
    print("Age is undefined")
    return
  }

  print("My age is (myAge)")
}

checkAge()
 
PREVIOUS NEXT
Tagged: #Swift #Statement
ADD COMMENT
Topic
Name
1+4 =