Last active
August 29, 2015 14:02
-
-
Save KingOfBrian/776887f4876269402351 to your computer and use it in GitHub Desktop.
Swift Class
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
import Foundation | |
class Foo { | |
func bar() { | |
println("Swift Hello, World!") | |
} | |
@objc | |
func baz() { | |
println("baz") | |
} | |
} | |
let f = Foo.init() | |
f.bar(); // This was inlined in release, direct function call in debug | |
f.baz(); // This calls 'objc_msgSend' | |
let a:AnyObject = f | |
a.baz() // Calls 'objc_msgSend' | |
//a.bar() -- compile error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment