We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
class TutorialClass { var firstVariable : Int init(firstVariable : Int) { self.firstVariable = firstVariable } }
When copying a class, the copy is a reference to the original it was copied from.
var classTest = TutorialClass(firstVariable: 0) var secondClassTest = classTest println(classTest.firstVariable) // 0 println(secondClassTest.firstVariable) // 0 secondClassTest.firstVariable = 1 println(classTest.firstVariable) // 1 println(secondClassTest.firstVariable) // 1
firstVariable
classTest
secondClassTest
Home