Comments (6)
Hi Naga,
your SASlideMenuViewController needs to implement:
-(void) tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath;
The implementation needs to load a segue from the desired storyboard.
from saslidemenu.
I tried but, It is how showing left menu in that screen.
Can you please give me the code sample.
Thank you,
Naga Harish.
from saslidemenu.
If you send me a sample project I will have a look at it.
Stefano
from saslidemenu.
Please find the sample here. In slidemenu if you click on any row will show you the second screen where we did not find(try to click on that area) any menu left icon.
Download link for source code http://1drv.ms/1osiNyb
Thank you,
Naga Harish.
from saslidemenu.
Hi Naga,
the problem with your code is that in order to present a content ViewController you have to use the segue. It is not enough to add a controller on top of the navigation controller. I have changed a little your code and now it seems that is loading the controller from the other storyboard.
//
// ExampleiPadViewController.m
// SASlideMenuiPad
//
// Created by Stefano Antonelli on 3/13/13.
// Copyright (c) 2013 Stefano Antonelli. All rights reserved.
//
#import "ExampleiPadViewController.h"
#import "SASlideMenuRootViewController.h"
@interface ExampleiPadViewController ()
@property (nonatomic) CGFloat selectedHue;
@property (nonatomic) CGFloat selectedBrightness;
@end
@implementation ExampleiPadViewController
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return YES;
}
-(id) initWithCoder:(NSCoder *)aDecoder{
if (self = [super initWithCoder:aDecoder]) {
self.selectedHue = 0.0;
self.selectedBrightness = 1.0;
}
return self;
}
#pragma mark -
#pragma mark SASlideMenuDataSource
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([segue.identifier isEqualToString:@"testScreen"]) {
UINavigationController* destinationController = (UINavigationController*) segue.destinationViewController;
UIStoryboard *secondStoryBoard = [UIStoryboard storyboardWithName:@"TestScreen" bundle:nil];
UIViewController *theScreen = [secondStoryBoard instantiateInitialViewController];
destinationController.viewControllers = [NSArray arrayWithObjects:theScreen, nil];
}
}
-(void) configureMenuButton:(UIButton *)menuButton{
menuButton.frame = CGRectMake(0, 0, 40, 29);
[menuButton setImage:[UIImage imageNamed:@"menuicon"] forState:UIControlStateNormal];
}
-(NSIndexPath*) selectedIndexPath{
return [NSIndexPath indexPathForRow:0 inSection:0];
}
/*
Maps menu rows to segueId.
*/
-(NSString*) segueIdForIndexPath:(NSIndexPath *)indexPath{
switch (indexPath.row) {
case 0:
return @"colored";
break;
default:
return @"testScreen";
break;
}
}
#pragma mark -
#pragma mark UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [NSString stringWithFormat:@"Row %d",indexPath.row];
return cell;
}
-(CGFloat) leftMenuVisibleWidth{
return 280;
}
#pragma mark -
#pragma mark SASlideMenuDelegate
-(void) slideMenuWillSlideIn:(UINavigationController *)selectedContent{
NSLog(@"slideMenuWillSlideIn");
}
-(void) slideMenuDidSlideIn:(UINavigationController *)selectedContent{
NSLog(@"slideMenuDidSlideIn");
}
-(void) slideMenuWillSlideToSide:(UINavigationController *)selectedContent{
NSLog(@"slideMenuWillSlideToSide");
}
-(void) slideMenuDidSlideToSide:(UINavigationController *)selectedContent{
NSLog(@"slideMenuDidSlideToSide");
}
-(void) slideMenuWillSlideOut:(UINavigationController *)selectedContent{
NSLog(@"slideMenuWillSlideOut");
}
-(void) slideMenuDidSlideOut:(UINavigationController *)selectedContent{
NSLog(@"slideMenuDidSlideOut");
}
-(void) slideMenuWillSlideToLeft:(UINavigationController *)selectedContent{
NSLog(@"slideMenuWillSlideToLeft");
}
-(void) slideMenuDidSlideToLeft:(UINavigationController *)selectedContent{
NSLog(@"slideMenuDidSlideToLeft");
}
@end
from saslidemenu.
Hi Stefano,
Thank you very much. I wrote little code to show left menu for two storyboard viewcontroller. But the way you told is working fine with out any single line of code.
Thank you,
Naga Harish.
from saslidemenu.
Related Issues (20)
- calling a method when a menuitem is tapped? HOT 3
- make status bar overlap leftMenu HOT 6
- provide initial segue which does not have a menu cell in the tableview HOT 2
- Enable/Disable menuitem HOT 6
- Swipe close menu HOT 2
- Whats the best way to add a Header to the (left)menu HOT 4
- How to control interface orientation? HOT 6
- How to use SASideMenu with Tabbar Controller HOT 4
- How I can detect when the user click the menu icon?
- Gesture on Close Slide (Disable)
- Update from version 1.2.1 to 2.0.3 -> tableView:cellForRowAtIndexPath: not call HOT 2
- How I can manage status bar like GMail? HOT 3
- Slide Menu Tremor HOT 5
- Close Menu Programmatically
- The left Menu shifts down when in call? HOT 2
- Parallax effect? HOT 1
- Not working in iOS 10
- Show left menu as default screen
- Support for Swift Package Manager
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 saslidemenu.