evnaz / enswiftsidemenu Goto Github PK
View Code? Open in Web Editor NEWA simple side menu for iOS written in Swift.
License: MIT License
A simple side menu for iOS written in Swift.
License: MIT License
hi,In MyMenuTableViewController, I use this
var menuArray = ["welcome", "multiMedia", "imageFilters", "ViewController4"]
....
destViewController = mainStoryboard.instantiateViewControllerWithIdentifier(menuArray[indexPath.row]) as UIViewController
...
cell!.textLabel.text = menuArray[indexPath.row]
instand of
switch (indexPath.row) {
case
case
...
default
}
....
cell!.textLabel.text = "ViewController #\(indexPath.row+1)"
it is more easy to use
Hello,
i have tried today to run my project on the new xcode 6.3 beta with swift 1.2, but i have seen that your project isn´t compatible with this swift version. My question is when you want to adapt your project to swift 1.2.
/Users/Me/Downloads/ENSwiftSideMenu-master/ObjCExample/ObjCExample/AppDelegate.m:30:85: No visible @interface for 'ENSideMenuNavigationController' declares the selector 'initWithMenuTableViewController:contentViewController:'
Is there a simple way to disable the menu on a particular view controller? Sorry if it sounds n00bish but I am 😊
first of all, great work!!!
I am looking for a way for the menu to pop a previously visited view controller at it's latest state, not to instantiate a new one... any tips?
Hi,
at first I want to thank you for your great work. It saved me a lot of time :) ..
I've got following setup:
I've got following issue: Whenever I am returning to the "source" view form the independent (3.) View Controller, the side menu items don't work anymore. The side bar still works well but whenever I click on a menu item it won't show up the corresponding View.
The return Segue (from the 3. View Controller to the "source" View Controller) is connected to the Navigation Controller.
What am I missing?
Thank you very much
Hello Evnaz!
Hope you are doing good.
I have integrated your controller in my project but I want to reduce the duration of animation while opening side menu. How can I do it in togglemenu where you have integrated UIDynamics Behaviour?
I am trying to click on a button which takes me to a separate view that should not be able to open the sidebar, and on the new view the only way to get back should be with a back button located on the view. I have this working, however when I try to access the sidebar I get the warning in the title.
Hi, clone this project and build with Xcode Version 6.0.1 (6A317), it occur the problems in ENSideMenu.swift as below
operand of "!" should have option type;type is "UIDynamictemBehavior" "UIGravityBehavior" "UIWindow"
The example shows a UITableViewController being created in cade and passed to the ENSideMenu. I've tried to design this in storyboard with a custom cell class.
The table loads fine on it's own (make it first view controller as test) but when the SideMenuNavigationController is first VC, the app crashes with: "unable to dequeue a cell with identifier Cell....."
Am I missing something trivial or is a code-generated table the only way to use this?
UIGravityBehavior dose not have member named gravityDirection
UIDynamictemBehavior dose not have member named elasticity
Excuse me, i'm not new to obj-c, but new to swift, so can't understand how to disable side menu bouncing? It's really annoying. Looks like you make menu to act like a real physical body, but when i try to play with it density, elasticity and so on, but nothing happens or it just throw menu out of screen bounds) Please help me!
Is there a way to check if the sidemenu is opened?
I was looking at the source and saw this
private var isMenuOpen : Bool = false
I was wondering whether you expose an API for other developers using the library to detect if the menu is opened in the app/
hi how i can close menu when in tap outside menu ?
I got an app that takes about 2-3 seconds to load the new screen when an item from the sidemenu is clicked and I am using a progressBar library to try and display the loading process.
Problem is I do not know which methods am I supposed to show and hide the progress bar. I tried doing it in the same method as presenting the viewcontroller but unfortunately, it only shows the progressbar at the end of the presentation of the viewcontroller instead of immediately.
Hi there!
Sidemenu positioning itself wrong when we disables bouncingEnabled:
sideMenu?.bouncingEnabled = false
Solution: fix problem in private func toggleMenu (shouldOpen: Bool) [ENSideMenu.swift]
this
destFrame = CGRectMake((shouldOpen) ? -2.0 : menuWidth, 0, menuWidth, sideMenuContainerView.frame.size.height)
for this
destFrame = CGRectMake((shouldOpen) ? -2.0 : -menuWidth-2, 0, menuWidth, sideMenuContainerView.frame.size.height)
As per subject, I got this error message on this line inside ENSideMenu.swift
public init(sourceView: UIView, menuPosition: ENSideMenuPosition) {
super.init()
self.sourceView = sourceView
self.menuPosition = menuPosition
self.setupMenuView()
Please advice. Thank you.
Hello guys,
I have attempted to add a menu icon instead of the text.
https://github.com/robomotic/ENSwiftSideMenu/tree/MenuIcon
If you go to ViewController2 you will see the menu bar in a ugly blue color but when you press the app is crashing!
The error is quite generic:
[SwiftSideMenu.MyNavigationController toggleMenu]: unrecognized selector sent to instance 0x7fad72828650
And I can't see why is doing that.
Any help ?!?!?!
I'm trying to implement a TableViewController with a custom cell like below.
class menuItem: UITableViewCell {
@IBOutlet var menuLabel: UILabel!
@IBOutlet var menuImage: UIImageView!
}
When I use this as a table view (connecting the outlets to the story board prototype cells with UILabel, UIImageView) it works well. But when I'm injecting it into the Navigation controller it fails to create a custom UITableView Cell.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> menuItem {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! menuItem
if cell == nil {
cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "cell") as! menuItem
}
return cell
}
// cell value is always nil. Even after Manually creating in cell == nil condition
Can any one help me with this ?
Is there an easy way to use this and have it push all the content over instead of having the menu go under the navigation bar and just over the content?
Is this only supports left gesture???...means when i open side menu from left side using gesture....why i am not able to close it with right to left gesture
self.sideMenuController()?.sideMenu?.delegate = self;
That's a pretty complex statement. How can these be optionals? They have to be required, could you maybe explain (and break apart this line) in English? Or a visual, thanks
When I try to use the sidemenu with the tabBarController, the transition only occurs when I press a button (in my case, the backButton I created in the navigationBar) after i press the respective row in the tableView.
After the transition, the sideMenu don't dismiss and I need to press the menuButton or use the gestureRecognizer to dismiss him.
Is this a hierarchy problem? I'm trying to figure out but I don't know where to look.
Im trying to use with my objc project but have a problem with calling
sideMenu = ENSideMenu(sourceView: self.view, menuTableViewController: MyMenuTableViewController(), menuPosition:.Left)
Any suggestion?
Very cool sidemenu.
Thank you very very much.
I'm trying to replicate your storyboard example, but I can't seem to get it to work. I don't understand how you are linking up the storyboards Navigation Controller with your "My Navigation Controller" class.
I initially had an application with one ViewController in my storyboard. I then add the UINavigationController to the storyboard and set the ViewController as the rootViewController. Then, I add a Menu button and map it to the toggleMenuButton IBAction where I call the toggleSideMenu() function.
I know I'm doing something wrong though because that custom NavigationController never gets instantiated and I'm not sure how to do that through the storyboard.
Any advice at all is greatly appreciated.
Will be available in Cocoapods? :-)
Hi,
This is a nice example for slider menu.
I need some change in animation behaviour. it should be like parentview will be slide when sliderview open instead of overlapping sliderview on parentview.
I need the same behaviour of slidermenu just like facebook app have .
Any help will be more appreciate.
Thanks.
Both when implemented in my project and the downloaded example, the side menu overlaps the navigation bar. I'm running Xcode 6.2 beta.
Hello,
Thank you for this great content. As this is my first project on Swift, I have a little problem that I can't fix when using ENSwiftSideMenu.
The content of the side menu appears on the page, but the links to other pages do not work. However I have noticed that if I set the page Menu Navigation Controller (with the class ENSideMenuNavigationController) as the "initial view controller", the links work.
Actually, I am looking to do this:
when a user has logged in, I use the instantiateViewControllerWithIdentifier method to move to the ENSideMenuNavigationController object, so that it can be used in the "Accueil" page. As I configured it, it does not work.
Please find below my storyboard:
Hope I have made myself clear enough.
Thx
Great work, I really enjoy the menu!
However I have a small problem if the menu is open and the orientation is changed from portrait to landscape. The menu position works fine, but the scrolling of the menu is not enabled if there are a lot of entries. To reproduce this just create a menu with 10 or more entries, so that not all are directly visible in landscape mode.
I tried to change the height of the sidemenu tableview, but couldn't quite get a working soltion since I am pretty new to mobile programming.
Hope someone has a suggestion to solve this problem.
Keep up the good work
I'm having unexpected results with the menu, though perhaps this has to do with me being new to coding than anything else. I expected to only have the menu appear in certain view controllers - those I made delegates of the menu. This would just be those view controllers actually listed in the menu, and not subsequent view controllers segued to. However, this does not seem to be the case as the menu is always accessible when swiping from the left edge of the screen.
Is there any way to turn off the menu in certain view controllers?
I'm still a bit unsure about how to do this with Swift,
and wondering if writing this would be a valid PR.
Any suggestions?
Is there a way to show the Menu on launching the app __ not having to wait for the first swipe.
I poked around but could not find that piece of code to change.
PS, Great piece of work here!, would be super helpful (and a great teaching tool) to have an "infographic" explaining how it all works (interconnects). How all the pieces talk to each other (I'm still a Swift beginner). There is lots of code, just trying to get my brain wrapped around it.
thanks, ed
Thank you for your answer to my question regarding sideMenuShouldOpenSideMenu() a few days ago, but I now seem to be having further issues.
ViewController1 has sideMenuShouldOpenSideMenu() set to true.
ViewController2 has sideMenuShouldOpenSideMenu() set to false.
It works fine until I unwind from ViewController2 to ViewController1. sideMenuShouldOpenSideMenu(), it seems, continues to be set to false, as the menu will no longer open in ViewController1. I am assuming that is because sideMenuShouldOpenSideMenu() is not being called upon return. Is there a way around this?
Edit: It seems that this is sporadic and only happens when I unwind a segue from within a UIAlert. I can't imagine what the issue could be.
Is this fonctionnality compatible to iOS 7 ?
If not, any idea to do it ?
Thank you very much !
I want to use Side Menu in my project. Is there any storyboard support?
First thanks for the great component.
Is their a possibility to navigate to next view with a code like this:
var smc : ENSideMenuNavigationController?
...
smc!.navigationController?.presentedViewController?.performSegueWithIdentifier("mySegueName", sender: self)
Hi,
This is awesome, it's easy to use, but what if I have multiple UIViewControllers? How can I create one SideMenu for all multiple controller without the need of invoking the menu on each view controller.
It would be great if the ENSwiftSideMenu came with a Storyboard too.
For example, if a user goes to a menu item, and the app determines that the user has not logged in, then it should redirect to the login tab.
The only way I know to do this is by using self.sideMenuController()?.setContentViewController, but that doesn't change the selected menu index. I'm wondering if there's some handy method around that i missed.
how to make this side menu cover the navigation bar on top?
I'm having trouble including a Back Button in the Navigation Bar. I've tried changing this to false:
self.navigationItem.hidesBackButton = false
But it didn't work. Any suggestions?
Im use this side menu but when i come back root view , its empty . i could not send data.
When the screen rotates the menu does not update it's position, that leads to it to be visible if hidden and in the wrong place. It also makes it disappear if you try to hide/show it.
I'm making a pull request to fix it.
Hi
How to make a menu slide from the right side ?
Hi All,
Thanks in advance.
Hi great work with your sample to sideMenu, i have a problem but i need move to next viewController but not find to func for to call next view for to work to current flow control
Pod not found
Hello.
Thanks for making this library. It has been very helpful and looks/functions great!
I was just wondering if there was a way to keep the same Navigation Bar to appear on all View Controllers that are selectable from the SideMenu?
Basically, on your example, is there a way to keep the Navigation Bar of the View Controller #1 that has the Toggle button on the left so that View Controllers #2, 3, & 4 have that same Nav Bar?
I tried to add a Navigation Bar to a View Controller that isn't the Root View Controller of the Menu Navigation Controller, but it just added another Navigation Bar below the existing one.
Thanks,
Deric
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.