stefanoa / saslidemenu Goto Github PK
View Code? Open in Web Editor NEWLibrary to create iOS sliding menu compatible with storyboards
Library to create iOS sliding menu compatible with storyboards
I use left menu with static cells which is implemented following given steps in Wiki page.
When I suddenly perform a swipe gesture on any item of the menu or even on the empty cells of it, the app crashes with the following error message:
[SlideMenuViewController panItem:]: unrecognized selector sent to instance 0x9947540
Thank you
This is probably not a specific problem with the slider menu. I got the slider menu to work. However, a couple of my labels and one image view seems to "slide in place". The container view slides out and along with all its components. When I click the menu item to slide that view back, the labels and image view seem to be already where they are supposed to be after sliding. The rest of the components in the view slide. It has something to do with the auto layout in iOS6. I attempted to pin the leading space down but that causes a warning. Does anyone else have this issue and have a solution?
...
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x8aacfd0 h=--& v=--& H:[ActivityListCell:0x8a9b0c0(0)]>",
"<NSLayoutConstraint:0x8a9d330 UILabel:0x8a9ce10.leading == ActivityListCell:0x8a9b0c0.leading + 250>",
"<NSLayoutConstraint:0x8a9d2f0 ActivityListCell:0x8a9b0c0.trailing == UILabel:0x8a9ce10.trailing + 20>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x8a9d2f0 ActivityListCell:0x8a9b0c0.trailing == UILabel:0x8a9ce10.trailing + 20>
Content slide out and slide in when tapping the partially visible content. The correct beahviour should be to simply slide in to bring back the already selected content.
Hey,
Is there a way for open menu by default? I looked at your issues and i saw romanr posts about slide initial(issue48).
-(NSString*) initialSegueId;
-(Boolean) hideContentOnStartup;
I think you didn't implement methods which are below. Is there any way for open menu by default without implementation of below methods?
Hi Stefanoa,
Sometimes, I need different width of the right menu as oppose to the left menu, the width of the right menu will be wider than the one for the left menu in my case.
I knew that your current code use kMenuTableSize constant but I couldn't think the best approach for this.
What is the best way to achieve this requirement?
I appreciate such a good project as always.
Let me know if you need any help from me.
Thanks.
Hi master of sliding :)
What to do if there is a slider in view controller and it won't slide because the gesture is taken by slideMenu? I thought about adding some code to my custom UISlider to fire a notification, which will be caught by my SASliderVC. But I'm not sure what's the methot that will disable/enable swipe gesture recognizer on SliderMenu. Is there one?
Hi.
I haven't used storyboard before and have no intent on doing so. So my question is how can I implement this awesome solution programmatically?
Thanks
Hi;
I added
UIPanGestureRecognizer* panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:menuViewController action:@selector(panItem:)];
[panGesture setMaximumNumberOfTouches:2];
[panGesture setDelegate:menuViewController];
[self.view addGestureRecognizer:panGesture];
To the DarkViewController in order to slideOut from View, not only from Back button.
It is working good. But now, when I slideOut with Pan gesture, for the first time I tap in the menu, it is not firing the selection segue. But second time, it fires.
Hi stefanoa,
I am newbie and this is just a question not and issue. How can I wire CoreData defined in AppDelegate.h so I can link all view tables to CoreData through SASlideMenuNavigationController.
I am assuming that the CoreData definition is like the one in Master-Detail template.
Thanks.
Hi, great component!
I have just one issue/question - How could I add a UINavigationBar to the side menu? I would like to embed a SASlideMenuViewController into an UINavigationController (or SASlideMenuNavigationController), I would like to do this especially for the SAMenuViewController in the leftMenu segue name (from the dynamic example).
I have tried to do this in StoryBoard, but the app will crash then.
Any ideas how to do this?
Thx!
Tom
Hi boss,
Like gmail, home slide menu should be allowed to open from left side swipe apart from menu button. Reason being, if i hav pushed on few view on navigation contoller then my home button will be replaced by the new navigation button. In this case i wont be able to open slide menu and i have to come back onto parent view controller and open it.
Logically i should be able to open it from any view just with a swipe from left exactly like gmail app.
Thanks
I don't know if it's a bug or I missed something.
I'm not able to drag the View to the right to show the left slidemenu when I'm dragging on top of an UI-Element, like a table or buttons. This is working on apps like Facebook or Path.
This is happening on both variants, dynamic and static.
Here are two screenshots form the example project:
In My project, there is a starting navigation controller, which pushes some ViewController. In that VC there should not be a slide menu. That's good. Now there is a button which pushes the SASlideMenuRootViewController. Everything else is like in the tutorial.
Now after slide menu is attached, there are 2 navigation bars. One hase a back button to my first VC. The other one has the menu button.
The first nav-bar needs to be removed. I have tried to call
[self.navigationController setNavigationBarHidden:YES animated:YES];
in the class that inherits from SASlideMenuViewController, but it does not work.
I found an issue where the left menu is loaded on the right side.
Reproduce:
if you click and hold the right menu button and drag slightly to the right and let go, the left menu will appear on the right side.
Temp Solution:
I solved it temporarily by changing the CancelTouchesInView to YES in the SASlideMenuContentSegue, this will maybe cause some other issues so might not be the best solution.
Hey,
It would be really cool if you added support for cocoapods, would love to make use of it in my project.
Cheers
Hi;
If I select Dark first, and immediately Light cells, 2 controllers overlap and I cannot turn back to main menu.
Hi Again,
maybe I haven't seen it, is there a possibility that I can use your beautiful menu in the 'middle' of my project?
Explanation: I write an app with another view controller as initial view controller and then I want to segue to the SASlideMenuRootVC. That works quite good but then is it possible to get back with e.g. a delegate like I do with every other segue navigation? Best way would be if the back button is in the left corner of a navigation bar in the left menu but I have an open mind to that :)
Would be very nice if you answer
This does not work in Sample project either.
Once controller is pulled to the right, touching on menuButton does nothing. the only way to return to controller is to pull it from the right.
hi,
by tapping on the statusbar, the scroll to top no longer works, since I installed SASlideMenu, but SASlideMenu works great! In the view there is a table view.
The error has someone?
I would like to say thank you for the great work in advance.
My problem is below.
I am using the dynamic mode without any modifications.
First open the right menu with landscape mode and then make the phone back to portrait mode. you will see that the content view disappeared.
Any idea about this issue?
Hi there! Following your SASlideMenuDynamic project, is it possible to have the left menu acessible for any view in the wholy story board? For instance, is there a way to allow the slide touch to open the left menu in your "ColoredDetailViewController" ?
I'm not sure if this is just a configuration issue on my part, or an actual bug, but I noticed that the menu is visible as the app opens, and hides itself immediately.
I was wondering if there was a way to have it closed by default?
Cheers
Hi
Cool project. But I was wondering if its the right way to go using segues from the TableviewContoller to push to other controllers!?
As I understand, every time a segue is called a new instance of the target controller is created, thus this would mean that every time user uses this left-slide-menu, new instances (of target controlers) are created. This would lead to problems as I see it.
Please comment if Im wrong.
the viewWillAppear/viewDidAppear not called for the initial view when choosing to use (selectedIndexPath), which makes customizing the view elements in the first shown view controller not possible.
Reason, the performSegue (addSubView) is called during viewDidLoad, possible to change this to be performed somewhere when the view already appeared?
Any known good workaround?
I think this is a a major bug, the "shield" view is overlayed over the controller preventing any touches sent to it. Making it completely unusable.
I had to comment out code in these two methods inorder to make it work.
-(void) completeSlideIn:(UINavigationController*) controller{
[self.shield removeFromSuperview];
[controller.visibleViewController.view addSubview:self.shield];
self.shield.frame = controller.visibleViewController.view.bounds;
}
-(void) completeSlideToSide:(UINavigationController*) controller{
[self.shield removeFromSuperview];
[controller.view addSubview:self.shield];
self.shield.frame = controller.view.bounds;
}
It should be possible to have a right panel similar to Facebook, Path and others
When running application as an iPad and attempting to swipe to the right the top view will not anchor.
Hi there,
First off I have to say your program is really amazing. I added the SASlideMenu folder unto my project just like you advised but when I click the second tablecell I made i get this issue
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: key cannot be nil'
*** First throw call stack:
(0x3b29c2a3 0x3518b97f 0x3b1fe313 0xeaff3 0xe9db1 0x3449023d 0x34512ea1 0x36097a6f 0x3b2715df 0x3b271291 0x3b26ff01 0x3b1e2ebd 0x3b1e2d49 0x395b02eb 0x344222f9 0xdfb79 0x38a4eb20)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Do you have an Idea why this is? Please help, thanks @stefanoa
I'm having a problem getting my initial view controller to appear and I'm getting this error in my MenuController.m
method 'initialSegueId' in protocol not implemented
When I build and run the following error appears in the console.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MenuController initialSegueId]: unrecognized selector sent to instance 0xad5b470'
I'm really sure it's something small I'm overlooking. Thanks in advance for any help you can provide.
if([movingView center].x + translation.x>160)
[movingView setCenter:CGPointMake([movingView center].x + translation.x, [movingView center].y)];
With this code, I could stop moving view go to right too much.
the whole UI along with the Content goes up when the menuitems are more than 12 & we scroll the menutiem to select the last item.
Hi, thanks for sharing your work!
I put 2 UIImageView in the storyboard.. after pressing the menu, the images are distorted.
(I used the static menu way)
I also tried to add images programmatically:
I wish I could use the storyboard.
Thanks in advance, Luca
Hello Stefanoa,
First of all, I'd like to say I really like this menu. It's been working great for months and we really appreciate your work on it.
We've been using the DynamicSlideMenu. However, since last week it suddenly isn't working properly anymore on startup.
I've added 3 screenshots.
The 1st screenshot shows what it looks like on startup (You can see the ViewController has been pushed down a bit and the top bar of the Menu is shown).
The 2nd screenshot shows the menu when you open the menu for the first time (You can still see that the ViewController on the right side is still pushed down a little bit).
On the 3rd screenshot you can see the ViewController as I've pressed a menu-item. As you can see, the ViewController now shows as it should.
Do you have any idea how to solve this? We have no idea how this problem has suddenly gotten into the App. If you need any additional info, please let me know.
Hi,
when you try to tap on the Navigation item in a tableview the tableview doesn't scroll to the top, but the scrollsToTop property is set to YES.
Maybe that's a problem with the view hierarchy. But I don't know how to fix it.
Hello, I believe I followed all the instructions on the readme (using dynamic cells) and, when running the app, it opened what was supposed to be the left menu view, on fullscreen, with no menu in sight. Any insights? How do you suppose I could debug this?
Hi, stefanoa,
I found a missing routine you might be interested in.
In SASlideMenuViewController.m file,
My solution is below for the missing routine.
// Set the value of self.rootController.selectedIndexPath
self.rootController.selectedIndexPath = indexPath;
tableView:didSelectRowAtIndexPath: should look something like below.
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if ([self.slideMenuDataSource respondsToSelector:@selector(segueIdForIndexPath:)]) {
// Set the value of self.rootController.selectedIndexPath
self.rootController.selectedIndexPath = indexPath;
NSString* segueId = [self.slideMenuDataSource segueIdForIndexPath:indexPath];
[self performSegueWithIdentifier:segueId sender:self];
}
}
Let me know if I missed something.
Thanks much.
Its the best one I've seen yet but the pan gestures take a little too much effort in swiping to reveal and close. See the Facebook app. The swipes need to be shorter!
Oops, I hit on major issue/flaw. This menu implementation can only be used if your menu is not scrolling and less than screen height.
I don't know if this is possible to fix as it seems like a fundamental design issue. I really dont' want to abandon this library for other menu implementation.
How to reproduce:
Open Sample project.
In Storyboard select Static Menu Controller> TableView > add 15 more rows, making 18 rows in total.
Run
When you scroll the menu you will see that view controller on the right simply scrolls together with menu.
On opening the project for the first time I get this error message inside ShadesViewController.m
Hi,
It is not an issue but more a feature i would like to know if available: is there a way to configure your slide menu so that on start-up we only see the slide-menu view controller. In other words can we fully hide the slidemenunavigation controller on start-up?
Thanks!
I have almost implemented your control in my app and its working fine in simulator. I have just installed the app first time in the device and thats a big problem now. There are heavy jerks in animation.
Can you please test your app in the device. There should be seamless animation without any jerks just like other open source
This bug is easily reproducible.
Steps to reproduce:
Can you please fix this issue ? While using your open source in my clear color table view I am getting this issue.
Is there a way to disable the gesture recognizer when showing the content view? I would like that the button in the upper right corner were the only way to go back to the menu. I like the gesture in the menu view itself, but not in the other ones.
The reason is that I am using a map and navigating the map is quite discorcenting right now, because the view keeps moving to the side.
Thanks.
I did implement
-(Boolean) disablePanGestureForIndexPath:(NSIndexPath*) indexPath;{}
in my viewcontroller which I wan to disable the panGesture.However , it wont work...
Did I need to return any BOLLEN Value or something to disable the slide?
The middle controller fires a "ViewDidLoad" once per selection. Is it possible to call ViewDidLoad anytime a selection is made including selecting the same option from the list multiple times?
I have found this issue which, I think, is not the cause of my code.
When you set some indexPath for a view controller to disable pan gesture for slide menu, it works at first sight.
-(Boolean) disablePanGestureForIndexPath:(NSIndexPath *)indexPath{ if (indexPath.row == 0) { return YES; } return NO; }
But when you go to another view which has the gestures and then back again, it seems like disablePanGestureForIndexPath "forgot" about given indexes. So the gestures work for the view I have disabled.
Hi Stefano,
I like your SlideMenu a lot. Very nice that your project uses Storyboards.
If I open the dynamic example, go to the right menu and click first on the second entry then on the first the app crashes.
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.