SWRevealViewController icon indicating copy to clipboard operation
SWRevealViewController copied to clipboard

i cant come back from rear to front

Open alkincakiralar1996 opened this issue 7 years ago • 15 comments

screen shot 2017-10-16 at 5 46 51 pm

Hello i need some little help.

for example right not im on the one number page or three doesnt matter and i open the reveal view menu then i clicked some cell and i want to open second controller

i want to open with navigation controller for example if i am here home page

when the second page opened the navigation bar back button must be home and when i click the back button then must be return to home page

it has been 3 mounts in swift this is my first project if you help me i'd be very happy

alkincakiralar1996 avatar Oct 16 '17 15:10 alkincakiralar1996

There are a lot of samples here. One of them I wrote:

SWHomePushSwift.zip

If you want to come back to Home view controller, you have to push your controller from Home Navigation Controller, right? See LeftMenuTableViewController.swift.

iDevelopper avatar Oct 17 '17 12:10 iDevelopper

but i have tab bar controller how can i connect between tab bar controller and navigation controller

alkincakiralar1996 avatar Oct 17 '17 14:10 alkincakiralar1996

also thanks for your help i'm waiting from yesterday that someone read anything

alkincakiralar1996 avatar Oct 17 '17 14:10 alkincakiralar1996

i just want to know i have one view controller that name is privacyviewcontroller its not connected with tab bar controller all tab bar controller pages have navigation controller for example right now i'm on home view controller ( home view controller in tab bar controller ) if i open the menu and click privacy cell i want to open privacy view controller with navigation bar and navigation bar must be have back button finally back button must be go to home view controller

alkincakiralar1996 avatar Oct 17 '17 15:10 alkincakiralar1996

        revealViewController().revealToggle(animated: true)
        let privacyPage = self.mainStoryBoard.instantiateViewController(withIdentifier: "PrivacyPolicyViewController")
        let homePage = self.mainStoryBoard.instantiateViewController(withIdentifier: "HomeViewController")
        homePage.navigationController?.pushViewController(privacyPage, animated: true) 

i tried this

alkincakiralar1996 avatar Oct 17 '17 15:10 alkincakiralar1996

You can have a look here:

https://github.com/iDevelopper/PBRevealViewController/issues/30#issuecomment-318896654

iDevelopper avatar Oct 17 '17 21:10 iDevelopper

Here is a sample for your privacy view controller:

SWTabNavSwift.zip

iDevelopper avatar Oct 20 '17 12:10 iDevelopper

Above code? SWTabNavSwift? If yes, can you upload it with what you tried to do in it?

iDevelopper avatar Nov 09 '17 11:11 iDevelopper

And what did you try?

iDevelopper avatar Nov 09 '17 11:11 iDevelopper

If you want a back button you have to push with a navigation controller, for example from front view controller's navigation controller. revealViewController.pushFrontViewController only show the new front view controller and close the menu. Can you upload here a sample?

iDevelopper avatar Nov 09 '17 11:11 iDevelopper

Yes, I will this week-end, no time now

iDevelopper avatar Nov 10 '17 16:11 iDevelopper

If you want a back button you must have a navigation controller, and his navigation bar must be visible, not hidden. Also I fixed the constraints for your collection and table view in code as you create them programmatically.

FileBrowser.one.zip

iDevelopper avatar Nov 11 '17 11:11 iDevelopper

Thank u so much Patrick... u made my day.........i am struggled so much for that issue.......... now solved.........thank u once again...........

loginforvijay avatar Nov 11 '17 15:11 loginforvijay

Ok, hope it help!

iDevelopper avatar Nov 11 '17 16:11 iDevelopper

@alkincakiralar1996 can you please me with the same problem that you faced ? as i'm facing this issue too :/
On selecting home from menu list, my tab bar disappears from home screen which was there before selecting and i'm using navigation controller as well. I have the same hierarchy as yours.

if you have any solution to this then plsssss do share with me :)

The code I'm using in didSelectRowAtIndexPath is: if indexPath.row == 1 { let destinationVc = self.storyboard?.instantiateViewController(withIdentifier: "Home") let newFrontVc = UINavigationController.init(rootViewController:destinationVc!) revealViewController.pushFrontViewController(newFrontVc, animated: true) }

Bilal10Akram avatar Apr 19 '18 21:04 Bilal10Akram