How to open a Particular tab by default when VC loads, How to move to index Tab when child ViewController Opened in CAPSPageMenu?

109 Views Asked by At

I have implemented https://github.com/PageMenu/PageMenu library in Swift 4.2

My Screen look like below :

1.https://ibb.co/QdkFdMR

2.https://ibb.co/cksN3ww

When i click Edit button of Profile Details, i am navigating to a VC with name DoctorPersonalEdit by following code :

let personalDetail = self.storyboard?.instantiateViewController(withIdentifier: "DoctorPersonalEdit") as! DoctorPersonalEdit
self.parentNavigationController?.pushViewController(personalDetail, animated: true)

till here everything works properly after that when i click Save button i want to go to previous page i.e 1st screenshot how can i go back to previous page. Also , when Screen loads first time i have to highlights third tab Business Page. Could some one help me i tried searching library but couldn't find any solution.

2

There are 2 best solutions below

0
PauloMendes On

Have you tried dismissing the VC ? On your "saveBtn" IBAction do:

self.presentingViewController?.dismiss(animated: true, completion:nil)

How did you implement the tab? Do you switch between them with a Switch Case? If that's the case, you just have to change the default value.

0
Rahuld On

Use this line of code

_ = navigationController?.popViewController(animated: true)