Giter Club home page Giter Club logo

Comments (6)

stefanoa avatar stefanoa commented on July 17, 2024

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.

rish7 avatar rish7 commented on July 17, 2024

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.

stefanoa avatar stefanoa commented on July 17, 2024

If you send me a sample project I will have a look at it.

Stefano

from saslidemenu.

rish7 avatar rish7 commented on July 17, 2024

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.

stefanoa avatar stefanoa commented on July 17, 2024

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.

rish7 avatar rish7 commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.