how to navigate perfectly between controllers?

Hi, I have a tabbar controller, this tabbar consist five controllers, one of them (profile) have a rightBarButtonItem with title "edit", this "edit" navigate me (segue with kind 'show (eg. Push)') to controller that I edit my profile in it and in this there are rightBarButtonItem with title "done" I clicked when I complete editing my profile, but issue is when I clicked it I notice the profile controller become have a leftBarButtonItem with title "<edit", that is doesn't exist before I navigate to edit controller. I want to complete editing and click done and this "done" navigate me to profile controller as last controller in stack of controllers , I mean without leftBarButtonItem with title "back".


1- profile image https://firebasestorage.googleapis.com/v0/b/reservation-828bb.appspot.com/o/MySin%2FSimulator%20Screen%20Shot%20-%20iPhone%207%20Plus%20-%202019-02-10%20at%2010.36.53.png?alt=media&token=452ed423-8fe0-42f7-b611-6b08d247927e


2- edit complete(change password) and click done https://firebasestorage.googleapis.com/v0/b/reservation-828bb.appspot.com/o/MySin%2FSimulator%20Screen%20Shot%20-%20iPhone%207%20Plus%20-%202019-02-10%20at%2011.30.09.png?alt=media&token=caf439cd-483f-4c01-bedb-d8461755acc2


3- when done and back to main profile controller https://firebasestorage.googleapis.com/v0/b/reservation-828bb.appspot.com/o/MySin%2FSimulator%20Screen%20Shot%20-%20iPhone%207%20Plus%20-%202019-02-10%20at%2011.34.43.png?alt=media&token=55cfb732-0723-408b-bbd8-7ff64cd22271


in last url image you will find me write "I dont like this", but I mean "I don't want this".


thanx.

Accepted Reply

thanx for you, I found solution by put next code in back button:

self.navigationController?.popToRootViewController(animated: true)



I am so sorry about delay in reply and communicate with you about these proplem.

actually, my company want an app for it and I must delivered it in this days, for that, I am very stressful and very busy.

I am sory again.

Replies

You may want to go thru the Bars section in the iOS HIGs.

You had a similar post 1 week ago.


Could you look at it and answer. And tell if they are related.

that question is about when I navigate between tabBar items, I should cancel requests, that proplem didn't solve yet, but I am busy in other important proplems now.

can you help me in this issue? please

If I remember well, you should hide / show the back button in the calling ViewController (the one you come from to edit profile) ; then unhide it when you return.


I understand you are busy, but guess what: those who try to help you ma be busy also and have other important problems to solve … 😉

thanx for you, I found solution by put next code in back button:

self.navigationController?.popToRootViewController(animated: true)



I am so sorry about delay in reply and communicate with you about these proplem.

actually, my company want an app for it and I must delivered it in this days, for that, I am very stressful and very busy.

I am sory again.