How can I call presentViewController in UIView class?
<p>There is a custom tab in in my project that is on every screen of the app, so i made custom <code>UIView</code> class and <code>xib</code> file and added buttons in them. Now i want my buttons for navigations on different screens having different <code>story board</code> ids. But i can't call <code>presentViewController</code> from <code>UIView</code> class. Previously i custom function in <code>extension</code> class to navigate between screens but <code>UIView</code> class also can't call that function.</p>

<pre><code>import UIKit

@IBDesignable class tab: UIView {

var view: UIView!

@IBAction func btn1(sender: UIButton) {
    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let vc = storyboard.instantiateViewControllerWithIdentifier("6")
    self.presentViewController(vc, animated: true, completion: nil)
}
override init(frame: CGRect) {
    super.init(frame: frame)
    xibSetup()
}

required init?(coder aDecoder: NSCoder) { 
    super.init(coder: aDecoder) 
    xibSetup()
}

func xibSetup() {
    view = loadViewFromNib() 
    view.frame = bounds 
    view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] 
    addSubview(view)
} 
func loadViewFromNib() -&gt; UIView {
    let bundle = NSBundle(forClass: self.dynamicType)
    let nib = UINib(nibName: "tab", bundle: bundle) 
    let view = nib.instantiateWithOwner(self, options: nil)[0] as! UIView
    return view
} 
}
</code></pre>