title: Swift Selector in UIImageWriteToSavedPhotosAlbum not recognized, why?
body: <p>iOS API Function <code>UIImageWriteToSavedPhotosAlbum</code> takes a selector as one argment:</p>
  
  <pre><code>func UIImageWriteToSavedPhotosAlbum(_ image: UIImage, 
                                _ completionTarget: Any?, 
                                _ completionSelector: Selector?, 
                                _ contextInfo: UnsafeMutableRawPointer?)
  </code></pre>
  
  <p><a href="https://developer.apple.com/documentation/uikit/1619125-uiimagewritetosavedphotosalbum" rel="nofollow noreferrer">https://developer.apple.com/documentation/uikit/1619125-uiimagewritetosavedphotosalbum</a></p>
  
  <p>However, in swift, when I call this function, the selector never gets recognized:</p>
  
  <pre><code>class Base {
     func save_image(img:UIImage) {
          UIImageWriteToSavedPhotosAlbum(img, self, Selector("image:didFinishSavingWithError:contextInfo:"), nil)
          // I also tried this:
          // UIImageWriteToSavedPhotosAlbum(img, self, #selector(image(_:didFinishSavingWithError:contextInfo:))
      }
  
     @objc func image(_ image: UIImage, didFinishSavingWithError error: Error?, contextInfo: UnsafeRawPointer) {
          print("Photo Saved Successfully")
      }
  }
  
  class Child:Base {
  }
  
  // This is how I call the save_image function:
  let child = Child()
  child.save_image()
  </code></pre>
  
  <p>As you can see, I tried constructing the selector from the signature, and from a string, but neither works. I always get this error in runtime:</p>
  
  <pre><code>'XXX.Child' does not implement methodSignatureForSelector: -- trouble ahead
  Unrecognized selector ......
  </code></pre>
  
  <p>What is happening here? I am wondering if this is because swift doesn't see the method from the Child class, as the method is inherited from Base class? </p>
  
  <p>How can I pass the selector successfully?</p>
  
  <p>Relevant question I have read:</p>
  
  <p><a href="https://stackoverflow.com/questions/24007650/selector-in-swift">@selector() in Swift?</a></p>