I got trouble with that when I convert from String to Int in swift 2
func sendNoticeTo(aptNumber aptNumber: Int) {
}
func findApt (aptNumber : String ) -> String? {
let aptNumbers = ["101","202","303","404"]
for tempAptNumber in aptNumbers {
if ( tempAptNumber == aptNumber) {
return aptNumber
}
}
if let culprit = findApt("101")?.toInt() {
sendNoticeTo(aptNumber: culprit)
}
Swift say that function isn't available and I searched that problem but those didn't help.