Created
December 21, 2015 16:04
-
-
Save milancermak/6c5d22cbbff4d6025895 to your computer and use it in GitHub Desktop.
A way how to introspect methods in Swift at runtime
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
var methodCount: UInt32 = 0 | |
let methods = class_copyMethodList(anInstance.dynamicType, &methodCount) // replace anInstace | |
for i in 0..<Int(methodCount) { | |
NSLog("method: \(NSStringFromSelector(method_getName(methods[i])))") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment