ios - How flip page after time interval? -
i use template page-based application
(rootviewcontroller
, dataviewcontroller
, modelcontroller
) in xcode. want flip page after time interval. how can it?
code flip next page
- (uiviewcontroller *)pageviewcontroller:(uipageviewcontroller *)pageviewcontroller viewcontrollerafterviewcontroller:(uiviewcontroller *)viewcontroller { nsuinteger index = [self indexofviewcontroller:(dataviewcontroller *)viewcontroller]; if (index == nsnotfound) { return nil; } index++; if (index == [self.pagedata count]) { return nil; } return [self viewcontrolleratindex:index storyboard:viewcontroller.storyboard]; }
i hope you
homeviewcontroller *homevc = [[homeviewcontroller alloc] init]; uinavigationcontroller *nav = [[uinavigationcontroller alloc] initwithrootviewcontroller:homevc]; [uiview transitionfromview:self.view toview:nav.view duration:0.5 options:uiviewanimationoptiontransitionflipfromleft completion:^(bool finished) { //action implement }];
[or]
homeviewcontroller *homevc = [[homeviewcontroller alloc] init]; uinavigationcontroller *nav = [[uinavigationcontroller alloc] initwithrootviewcontroller:homevc]; nav.modaltransitionstyle = uimodaltransitionstylefliphorizontal; nav.modalpresentationstyle = uimodalpresentationformsheet; [[self navigationcontroller] presentviewcontroller:nav animated:yes completion:^{ //action implement }];
Comments
Post a Comment