title: subview UIButton click event not working from ViewController swift 4
body: <p>My Custom <code>EmptyUIView</code>. I want to call <code>UIView</code> uiBtnExplore from <code>UIViewController</code>.</p>
  
  <pre><code>class EmptyView: UIView {
      @IBOutlet weak var uiBtnExplore: UIButton!
  
      class func createEmptyView() -&gt; EmptyView {
          let myEmptyNib = UINib(nibName: "EmptyView", bundle: nil)
          return myEmptyNib.instantiate(withOwner: nil, options: nil)[0] as! EmptyView
      }
  }
  </code></pre>
  
  <p><strong>My UIViewController:</strong> </p>
  
  <pre><code>import UIKit
  import XLPagerTabStrip
  
  class PlaylistViewController: UIViewController, IndicatorInfoProvider {
      var itemInfo: IndicatorInfo = "PLAYLISTS"
      var emptyView:EmptyView!
  
      func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -&gt; IndicatorInfo {
          return itemInfo
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          emptyView = EmptyView.createEmptyView()
          self.emptyView.center = CGPoint(x: view.frame.size.width  / 2,
                                          y: view.frame.size.height / 2)
          self.view.addSubview(emptyView)
          self.view.bringSubviewToFront(testButton)
          view.isUserInteractionEnabled = false
  
          self.emptyView.uiBtnExplore.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)
      }
  
      @objc func buttonAction(sender: UIButton!) {
          print("Button Clicked")
      }
  }
  </code></pre>