I've recently started learning swift 2 (having not used swift 1) and am trying to get my head around optionals and unwrapping. I've been trying to do a simple example that converts an optional String to an int. The example I have is below
var numbers: [String] = ["1","2","3","4"];
func findNumber (num:String, numbers:[String]) -> String?{
    for tempNum in numbers {
        if(tempNum == num){
            return tempNum;
        }
    }
    return nil;
}
if let s = findNumber("5", numbers: numbers), num = Int(s){
    print("found")
}else{
    print("not found")
}
if let num = Int(findNumber("5", numbers: numbers)?){
    print("found")
}else{
    print("not found")
}
After looking at How do you convert optional text input to Int in Swift 2, Xcode 7 beta using if let - toInt does not work I managed to get the first if statement working, but this seems like a bit of an extra step - create a variable to hold the optional result and then pass this in to the findNumber function. Why is it not possible to do something more concise like in the second example? Surely in both examples the value passed to the Int() function is nil? If I use ! to unwrap the return, and as long as it's a valid number I get the correct response, but I get an exception when using an invalid input such as "5".
Could this be written anymore concisely or is this just the behaviour of the language?
thanks