Skip to content

Instantly share code, notes, and snippets.

@kongtomorrow
Created May 1, 2015 01:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kongtomorrow/7fc0cabfb7d23e479633 to your computer and use it in GitHub Desktop.
Save kongtomorrow/7fc0cabfb7d23e479633 to your computer and use it in GitHub Desktop.
surprising id-like behavior of AnyObject
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