Created
May 1, 2015 01:08
-
-
Save kongtomorrow/7fc0cabfb7d23e479633 to your computer and use it in GitHub Desktop.
surprising id-like behavior of AnyObject
This file contains hidden or 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 Hrm { | |
@objc func objcFunc() { | |
} | |
dynamic func dynamicFunc() { | |
} | |
func normalFunc() { | |
} | |
} | |
let obj : AnyObject = NSString() | |
obj.objcFunc() | |
obj.dynamicFunc() | |
//obj.normalFunc() // this one does not compile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment