Mad Burea Mad Burea - 2 months ago 38
Objective-C Question

How to reload content of SlideNavigationController

Actually i have created slide navigation by using this Slide Navigationcontroller

Now everything is working fine i have adjusted slide to left menu. but when i want to change it's content then at a time it does not work.

i have used this code in appdelegates for setting left menu and attached slidenavigation controller using storyboard as a root view controller of as a navigation controller

mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
employeeSlideNavigation *leftMenu = (employeeSlideNavigation*)[mainStoryboard
instantiateViewControllerWithIdentifier: @"employeeSlideNavigation"];
[SlideNavigationController sharedInstance].leftMenu = leftMenu;
[SlideNavigationController sharedInstance].menuRevealAnimationDuration = .18;

Please suggest me how to reload left menu content. actually this code is in

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions



You can use this

Add observer with method inside the slideController class

#define NOTIFICATION_UPDATESLIDE @"UpdateSlideTable"

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDetails:) name:NOTIFICATION_UPDATESLIDE object:nil];

           //content which you need to update

and post the notification from where you want to update the content of slide menu. like this

[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_UPDATESLIDE object:self];

Hope this helps you.