Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when using segue back navigation item #10

Closed
thihaaung6245 opened this issue Feb 18, 2015 · 6 comments
Closed

Problem when using segue back navigation item #10

thihaaung6245 opened this issue Feb 18, 2015 · 6 comments

Comments

@thihaaung6245
Copy link

Let me say clear for the issue.
1.I was using "Main View Controller" for displaying data with images using Table View
2.In order to display the data with detail,i created "Detail View Controller" and make Navigation Embedded to "Main View Controller" to create segue for "Detail View Controller".
3.I disabled the your slide out at "Detail View Controller" because i don't want to.I only want to display Slide out at "Main View Controller"
So these are my program status

[issue]After I clicked "Back" key or swiped left gesture to come back to "Main View Controller" from "Detail View Controller",my slide out using left gesture is stopped working at "Main View Controller".Only the slide gesture is stopped working.But,when i click navigation bar item that you created to appear slide out view controller,it appear.

Please Help!!!I am using it in my automobile project

@thihaaung6245
Copy link
Author

One thing i forget to say..
I disable the slide out using self.removeNavigationBarItem() at Detail View Controller.When i coming back to Main View Controller by swiping back page or clicking "Back Button",the slide out stop working until i touch navigation menu button at the "Main View Controller".

Another one is,if i touch navigation menu button,the slide out appear and cover the "Main View Controller" with "Left View Controller".But,when i touch the "Main View Controller" at that state to the upper right corner of view,the "Main View Controller" should be show and it don't.Only the "Slide Out Menu is appear and will hide if i tapped one of the table cell.Please Help!!!

Please Help!!!
If you need my project sample,i will sent to you.

@dekatotoro
Copy link
Owner

Hi,

RemoveNavigationBarItem func turn off the gesture.
You will be able to extend the SlideMenuController for your project.
Please override isTagetViewController func, and implement conditions.

example

class HogeSlideMenuController : SlideMenuController {

    override func isTagetViewController() -> Bool {
        if let nvc = self.mainViewController? as? UINavigationController {
            if let vc = nvc.topViewController {
                if vc is HogeViewController ||
                    vc is FugaViewController {
                        return true
                }
            }
        }
        return false
    }
}

Please do not forget to class change at the time of generation.

 let slideMenuController = HogeSlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController, rightMenuViewController: rightViewController)

@thihaaung6245
Copy link
Author

Ummm...Sir,I really appreciated your reply.But,i dont understand what you want to say and what you want me to do.If you don't mind,can you show some example.Or,if you don't have time,may i sent my project to your mail?

@dekatotoro
Copy link
Owner

I'm sorry, I do not take the time to respond individually.

Try to create a class that inherits from SlideMenuController.
isTagetViewController You can try to override.
In go well if implement the decision of viewController you want to enable the slideout gesture.

best regards

@thihaaung6245
Copy link
Author

I got it now.To those who are facing the same problem like me,add some code to Main View Controller

// Add This to Appear Slide Out again at Main View Controller
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.setNavigationBarItem()
}

This will solve when tapping "< Back" Button or Swipe Back from Detail To Main after you disable Slide at Detail View Controller

@dekatotoro
Copy link
Owner

It was nice to be resolved.

However, each time to display and hide the SubViewController, if you do not want to do removeNavigationBarItem and setNavigationBarItem, Try doing in a way that I wrote above.

best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants