title: Can I know if a function is a method? If so, can I know its object?
body: <p>In Swift, a method is a special type of function, one attached to an object.</p>
  
  <p>If I am given an arbitrary function, I want to know if it is a method. If it is, I want to know the object it is attached to.</p>
  
  <p>Something like this:</p>
  
  <pre><code>func ownerOfFunction(_ f: () -&gt; Void) -&gt; Any? {
    return isMethod(f) ? getObject(f) : nil
  }
  </code></pre>
  
  <p>Does anything like <code>isMethod()</code> or <code>getObject()</code> exist?</p>