ios - Sending data between ViewController with JASidePanels -
i trying implement jasidepanels centerviewcontroller slides , reveals leftviewcontroler contains tableview. once user selects row in tableview, i'd centerview regain it's position sliding , have method (within centerviewcontroller) called parameter leftviewcontroller update centerview. can please this?
thank you.
there 2 parts solving problem:
- first showing center panel when user select row:
[self.viewcontroller showcenterpanelanimated:yes]; // add method tableview row
- passing message center panel new instruction, can done creating delegate or notification. keep simple use notification:
in left panel class:
// add tableview row method nsnotification *msg = [nsnotification notificationwithname:@"leftpanelmsg" object:@"hello"]; [[nsnotificationcenter defaultcenter] postnotification:msg];
in center panel class: add observer in viewdidload , method when message passed back:
- (void)viewdidload { [super viewdidload]; // method listen meesssage specfic name , calls selector when hit [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(msgresponder:) name:@"leftpanelmsg" object:nil]; } -(void)msgresponder:(nsnotification *)notification { nslog(@"name:%@ object:%@", notification.name, notification.object); }
Comments
Post a Comment