Created
February 18, 2015 00:06
-
-
Save josephlord/2bbfcf4a964804181dad to your computer and use it in GitHub Desktop.
Swift 1.2 beta required code changes and bugs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Will be fixed | |
let sub:SubClass = s as? SubClass ?? SubClass(2) | |
// Use this for Beta 1 | |
let sub:SubClass = (s as? SubClass) ?? SubClass(2) | |
// Setup | |
let dict:[String:Int]? = ["a":1, "b":2] | |
// Swift 1.1 - Removed | |
let x:Int? = dict.map { $0["a"] }? | |
// Swift 1.2 | |
let x:Int? = dict.map { $0["a"] } ?? nil | |
"fooübar".uppercaseString // Crashes - Fixed in next beta | |
let s:String = NSString() // requires "as String" cast in Swift 1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment