title: _cmd in Swift for selector use
body: <p>I'm trying to write the following ObjC code in Swift 3:</p>
  
  <pre><code>- (void)scrollViewScroll:(UIScrollView*)scrollView {
      // some code
      if ([_userDelegate respondsToSelector:_cmd]) {
          [_userDelegate scrollViewDidEndDecelerating:scrollView];
      }
  }
  </code></pre>
  
  <p>But do not know what to replace _cmd with. I'm trying function, but it doesn't work:</p>
  
  <pre><code>func scrollViewDidScroll(_ scrollView: UIScrollView) {
      // some code
      if (userDelegate?.responds(to: #function))! {
          userDelegate?.scrollViewDidScroll!(scrollView)
      }
  }
  </code></pre>
  
  <p>using <code>#selector(scrollViewDidScroll(_:))</code> works, but is there a way to keep it generic?</p>
  
  <p><strong>Edit:</strong> Possible duplicate answer is about getting function name which isn't what I'm asking above</p>