Paste
Pasted as Swift by Pradip ( 7 years ago )
class MenuVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "FourthID") as! CHatVC
self.navigationController?.pushViewController(vc, animated: true)
}
@IBAction func GoToMessagePage(_ sender: Any) { //its a button to go to message page
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "ThirdID") as! MessageVC
self.navigationController?.pushViewController(vc, animated: true)
}
}
class MessageVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func GoToChatPAge(_ sender: Any) {//its a button to go to chat page
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "FourthID") as! CHatVC
self.navigationController?.pushViewController(vc, animated: true)
}
}
class CHatVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}
in appdelegate add the following code
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "TabBarID") as! UITabBarController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = vc
vc.selectedIndex = 0
self.window?.makeKeyAndVisible()
Revise this Paste