Skip to content

Instantly share code, notes, and snippets.

@josephlord
Forked from neonichu/class-vars.swift
Last active August 29, 2015 14:13
Show Gist options
  • Save josephlord/7c2324e18c2ac36a8c88 to your computer and use it in GitHub Desktop.
Save josephlord/7c2324e18c2ac36a8c88 to your computer and use it in GitHub Desktop.
private var privateGlobalFoo = 42
class Foo {
class var foo: Int {
get { return privateGlobalFoo }
set(newVal) { privateGlobalFoo = newVal }
}
}
println(Foo.foo)
Foo.foo = 114
println(Foo.foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment