-
-
Save ahmed-abdurrahman/3ee41d5f7e57eabebad387c05d1dd5bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var currentViewController: UIViewController? | |
lazy var firstChildTabVC: UIViewController? = { | |
let firstChildTabVC = self.storyboard?.instantiateViewController(withIdentifier: "FirstViewControllerId") | |
return firstChildTabVC | |
}() | |
lazy var secondChildTabVC : UIViewController? = { | |
let secondChildTabVC = self.storyboard?.instantiateViewController(withIdentifier: "SecondViewControllerId") | |
return secondChildTabVC | |
}() | |
func viewControllerForSelectedSegmentIndex(_ index: Int) -> UIViewController? { | |
var vc: UIViewController? | |
switch index { | |
case TabIndex.firstChildTab.rawValue : | |
vc = firstChildTabVC | |
case TabIndex.secondChildTab.rawValue : | |
vc = secondChildTabVC | |
default: | |
return nil | |
} | |
return vc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment