Reputation: 1929
How I can get all methods names from swift class? I try used class_copyMethodList, but it is not working for swift... I need get all methods names including all extension of my class.
Global task: I need get all methods names from my class, filtered it by prefix, and call it one by one.
Upvotes: 1
Views: 484
Reputation: 93191
class_copyMethodList
is a function from the ObjectiveC runtime. As expected, it only works on Objective C classes. Make your class inherit from NSObject
:
class MyClass: NSObject {
// ....
}
Upvotes: 3