arkilis
6/3/2017 - 12:01 AM

swift_optional4.swift

swift_optional4.swift


if var tempPrice = getPrice(name: "item1") {
    let message = text + "\(tempPrice)"  // compile-time error: error: value of optional type 'String?' not unwrapped; did you mean to use '!' or '?'?
    print(message)
}