I was wondering if people would be open to adding an unwrap method to the
Optional type, I already have a method like this which shortens code for
me.
So this:
let myReallyLongOptionalName: String? = "Hey"
if let string = myReallyLongOptionalName {
doSomethingWith(string)
}
Could become"
let myReallyLongOptionalName: String? = "Hey"
myReallyLongOptionalName.unwrap {
doSomethingWith($0)
}
The block would only be fired if myReallyLongOptionalName has a value.
*___________________________________*
*James⎥Head of Trolls*
*[email protected] <[email protected]>⎥supmenow.com <http://supmenow.com>*
*Sup*
*Runway East *
*10 Finsbury Square*
*London*
* EC2A 1AF *
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution