Last active
September 14, 2015 04:42
-
-
Save Cananito/54d47a36f142afed63f8 to your computer and use it in GitHub Desktop.
You can mutate constant properties in init. Swift 1.0 Beta 3.
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
class SomeClass { | |
let someArray: Array<String> | |
init() { | |
self.someArray = [] | |
self.someArray.append("Fine") // No error | |
} | |
func someFunction() { | |
self.someArray.append("Not Fine") // Error | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment