Skip to content

Instantly share code, notes, and snippets.

@sketchytech
Created September 7, 2014 12:46
Show Gist options
  • Save sketchytech/a691de7f40ee3202ac86 to your computer and use it in GitHub Desktop.
Save sketchytech/a691de7f40ee3202ac86 to your computer and use it in GitHub Desktop.
Type methods and properties
class SomeClass {
class var description:String {
return "computed class property"
} // ok
class var property:String = "class property" // compiler warning: class variables not yet supported
class func typeMethod() -> String {
return "type method"
} // ok
}
SomeClass.description // ok
SomeClass.typeMethod() // ok
SomeClass.property // won't work because of class variables being unsupported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment