title: When to use respondsToSelector in swift?
body: <p>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 <code>nil</code>.</p>
  
  <p>This appears only to apply if the class is written in Swift. (Is that a correction assumption)?</p>
  
  <p>Now, if you are referencing an Objective-C class and want to check to see if a method exists, you can use the <code>respondsToSelector</code> check with the selector <code>#selector</code>. </p>
  
  <p>Is this meant to only be used on Objective-C classes and Swift classes, protocols, protocol /class extensions that inherit from Objective-C classes?</p>
  
  <p>Let me know if I should expand on any part of my questions.</p>