My question is more of a general question rather than a specific problem. It appears that for a class that is written in Swift, you can use the optional workflow to verify if the method does exist(?). If it doesn't, you can assume it returned nil
.
This appears only to apply if the class is written in Swift. (Is that a correction assumption)?
Now, if you are referencing an Objective-C class and want to check to see if a method exists, you can use the respondsToSelector
check with the selector #selector
.
Is this meant to only be used on Objective-C classes and Swift classes, protocols, protocol /class extensions that inherit from Objective-C classes?
Let me know if I should expand on any part of my questions.