I am using the XLPagerTabStrip library for the tab bar in my app and also I have created a base view controller for some unique views to be used on multiple screens So as swift doesn't allow multiple inheritances I cannot inherit baseviewcontroller in the view controller where ButtonBarPagerTabStripViewController is used because both controllers inherited UIViewController
What I want is want view added to the base view to be displayed on the main tab bar screen. baseviewcontroller has multiple views imported in it and I am managing these views on each view separately, the button is just for example.
This is main tab bar view controller:
class mainSearchViewController: ButtonBarPagerTabStripViewController { }
And this is my base view controller :
class baseTalentViewController: UIViewController {
var testButton = UIButton()
override func viewDidLoad() {
super.viewDidLoad()
setupUIForButton()
}
func setupUIForButton() {
self.view.addSubview(self.testButton)
testButton.translatesAutoresizingMaskIntoConstraints = false
testButton.trailingAnchor.constraint(equalTo: self.view!.safeAreaLayoutGuide.trailingAnchor, constant: -5).isActive = true
testButton.centerYAnchor.constraint(equalTo: self.view!.safeAreaLayoutGuide.centerYAnchor).isActive = true
self.view.bringSubviewToFront(self.testButton)
}
}
I want this test button to appear on mainSearchViewController
I tried using protocol but I am not able to achieve what I want, so help me resolve this.