ios - UISplitViewController presentsWithGesture = YES not working -
ios - UISplitViewController presentsWithGesture = YES not working -
in appdelegate
in application:didfinishlaunchingwithoptions:
instantiate uisplitviewcontroller
next code:
popmenuviewcontroller *menuvc = [[popmenuviewcontroller alloc] initwithstyle:uitableviewstyleplain]; uinavigationcontroller *menunavcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:menuvc]; popmenudetailviewcontroller *detailvc = [[popmenudetailviewcontroller alloc] initwithnibname:@"popmenudetailviewcontroller" bundle:nil]; uinavigationcontroller *detailnavcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:detailvc]; menuvc.detailviewcontroller = detailvc; splitviewcontroller = [[uisplitviewcontroller alloc] init]; splitviewcontroller.viewcontrollers = @[menunavcontroller, detailnavcontroller]; splitviewcontroller.presentswithgesture = yes; splitviewcontroller.delegate = self; self.window.rootviewcontroller = splitviewcontroller;
but, in portrait mode, when slide on screen (from left right) left view controller doesn't appear (but presentswithgesture
set yes
).
i run project on simulator , physical device ios 7.
any ideas?
on ios 7, must implement delegate method uisplitviewcontroller
in order gesture work:
-(void)splitviewcontroller:(uisplitviewcontroller*)splitcontroller willhideviewcontroller:(uiviewcontroller*)viewcontroller withbarbuttonitem:(uibarbuttonitem*)barbuttonitem forpopovercontroller:(uipopovercontroller*)popovercontroller
edit: don't need within method, needs implemented.
ios objective-c ipad uisplitviewcontroller
Comments
Post a Comment