Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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
2+4 =