Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift If-statement

var someValue:Int?
var someAnotherValue:Int! = 0
        
if someValue != nil {
	print("It has some value (someValue!)")
} else {
	print("doesn't contain value")
}
        
if someAnotherValue != nil {
	print("It has some value (someAnotherValue!)")
} else {
	print("doesn't contain value")
}
Source by www.hackingwithswift.com #
 
PREVIOUS NEXT
Tagged: #Swift
ADD COMMENT
Topic
Name
8+3 =