IPhone : Check if variable is string or not in swift

on Monday, March 30, 2015

I want to get this : if texfield isnt empty, and it isnt string, show ... and if it is show this...


I found a way how to check if it isnt empty, but I can't think of how to check if it string or not.



if input != nil {

var resultOutput = input! * 7

result.text = "Your cat's age is \(resultOutput)"

} else {

result.text = "Please enter your cats age"

}

0 comments:

Post a Comment