Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Foo {
static func getNumber() -> Int {
return 88
}
class func getAnotherNumber() -> Int {
return 99
}
}
class Bar : Foo {
override static func getAnotherNumber() -> Int {
return super.getAnotherNumber() + 1;
}
}
Foo.getNumber() //88
Foo.getAnotherNumber() //99
Bar.getAnotherNumber() //100
@unboxedsolutions

This comment has been minimized.

Copy link
Owner Author

unboxedsolutions commented Dec 27, 2015

For C# developers, an example of Swift static and class funcs and how a class func can be overridden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.