Comments (12)
I have the same problem @fsad, you managed to solve?
from enswiftsidemenu.
@JDoes unfortunately not :( ... I managed to create a sidemenu with following tutorial: http://www.raywenderlich.com/78568/create-slide-out-navigation-panel-swift
At the bottom of the page there are the project source files to start right away.
Regards
from enswiftsidemenu.
Hi, thanks for this great work but I also have this problem...
from enswiftsidemenu.
Hi @fsad , sorry for long response.
What kind of segue do you use to return to the first VC? It probably creates a new instance of navigation controller. I would suggest don't use segue and make it programmatically.
from enswiftsidemenu.
Hi Evnaz,
I personally use a modal segue as the return segue
from enswiftsidemenu.
Hi guys,
same problem here.
@evnaz could you provide an example of doing it programmatically or maybe do a sample project to show the right way to do it?
I am using as the others segues and unwind segues and the menu disappears.
from enswiftsidemenu.
Hi @robomotic ,
Unfortunately i cant reproduce the issue, can you please post basic project with view controller's logic causing the problem.
from enswiftsidemenu.
Hi @evnaz ,
will do give me a couple of hours, I am cloning yours on mine and adding the example.
Cheers.
from enswiftsidemenu.
Here we go the demo project is here:
https://github.com/robomotic/ENSwiftSideMenu
You can see how the Menu disappears after the segue transition from ViewController to ViewController3.
I also added an unwind segue with the Back button (I couldn't do with the left swipe because that of course should trigger the menu).
Also it will be nice to have a navigation control in this case.
Let me know what you think.
Cheers!
from enswiftsidemenu.
I checked your example and noted that ViewController3 is a modal view controller, it is outside of the navigation view controller's stack, as you see in the RightSegue.swift it inserts as a subview of current window:
window?.insertSubview(secondVCView, aboveSubview: firstVCView)
The side menu can't handle gestures over the inserted view. So, side menu only works if you use a push(show) segue. To prevent back action on swipe you can disable back swipe gesture by:
override func viewWillAppear(animated: Bool) {
navigationController?.interactivePopGestureRecognizer.enabled = false
}
At the moment i don't see any way how to manage modal view controllers by side menu.
from enswiftsidemenu.
So I made a commit in the RightSeque.swift to use the push instead of mode:
- let window = UIApplication.sharedApplication().keyWindow
- window?.insertSubview(secondVCView, aboveSubview: firstVCView)
+ //let window = UIApplication.sharedApplication().keyWindow
+ //window?.insertSubview(secondVCView, aboveSubview: firstVCView)
+
+ let navigat = UINavigationController()
+ navigat.pushViewController(self.destinationViewController as! UIViewController, animated: true)
But I am still unable to see the Menu,is it to do with the UINavigationController that doesn't get initialised with the one of the Menu?
from enswiftsidemenu.
Hi @robomotic ,
You don't need to use custom segue to push a view controller, just use show(push) segue.
And, yes, you create a new instance of navigation controller and then just present the destination controller as a modal view, in that case just created nav controller is not used.
Also remove this function or modify the return value in the ViewController3:
func sideMenuShouldOpenSideMenu() -> Bool {
println("sideMenuShouldOpenSideMenu")
return false
}
from enswiftsidemenu.
Related Issues (20)
- Tableview frame
- When I go back my previous screen data of text field disappears
- Issue when adding subviews
- Cocoapods needs update HOT 1
- crash on outside call
- When swipe disabled, pan not working.
- How to decrease the width of side menu and how to change the appearance of main view controller ?
- Logout screen HOT 5
- How to change navigation bar color for specific view controller?
- Can not add side menu from storyboard.
- How to adapt ENSwiftSideMenu to iPad HOT 1
- menu swipes from left when logout
- how can we change menu items?
- // TODO: add blur for ios 7
- Covering TabBar? HOT 1
- How to disable menu open pan gestures for other views except one view HOT 3
- Download Swift 4 Version
- Navigate to back pop view controller ??
- side menu not open
- How to reload sidemenu view
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enswiftsidemenu.