iphone - How to call An Animation Function from another class in ios? -
i have code slide animation written in first class
-(void)send { right=[[viewprofilerightpanel alloc]initwithnibname:@"viewprofilerightpanel" bundle:nil]; right.view.frame=cgrectmake(0, 0, 260, 548); [self.view showorigamitransitionwith:right.view numberoffolds:[@"1" intvalue] duration:[@"0.58" floatvalue] direction:currdirectionrightpanel completion:^(bool finished) { nslog(@"4"); }]; }
this code called when press button in first class , open right panel. animation close right panel is,
-(void)close { [self.view hideorigamitransitionwith:right.view numberoffolds:[@"1" intvalue] duration:[@"0.58" floatvalue] direction:currdirectionrightpanel completion:^(bool finished) { }]; }
now want perform close animation on press of button in second class instead of pressing button first class.
question: how can access function of first class second class?
i suggest define protocol (delegate) in firstclass has function (void)close , include protocol property in second class , access function second class via property.
Comments
Post a Comment