title: Is it possible to call a block completion handler from another function in iOS?
body: <p>I have a custom UIView with a UITapGestureRecognizer attached to it. The gesture recognizer calls a method called hide() to remove the view from the superview as such:</p>
  
  <pre><code>func hide(sender:UITapGestureRecognizer){
      if let customView = sender.view as? UICustomView{
          customView.removeFromSuperview()
      }
  }
  </code></pre>
  
  <p>The UICustomView also has a show() method that adds it as a subview, as such:</p>
  
  <pre><code>func show(){
      // Get the top view controller
      let rootViewController: UIViewController = UIApplication.sharedApplication().windows[0].rootViewController!!
      // Add self to it as a subview
      rootViewController.view.addSubview(self)
  }   
  </code></pre>
  
  <p>Which means that I can create a UICustomView and display it as such:</p>
  
  <pre><code>let testView = UICustomView(frame:frame) 
  testView.show() // The view appears on the screen as it should and disappears when tapped
  </code></pre>
  
  <p>Now, I want to turn my show() method into a method with a completion block that is called when the hide() function is triggered. Something like:</p>
  
  <pre><code>testView.show(){ success in
      println(success) // The view has been hidden
  }
  </code></pre>
  
  <p>But to do so I would have to call the completion handler of the show() method from my hide() method. 
  Is this possible or am I overlooking something?</p>