Skip to content

Instantly share code, notes, and snippets.

@beartung
Created February 25, 2014 03:14
Show Gist options
  • Save beartung/9201948 to your computer and use it in GitHub Desktop.
Save beartung/9201948 to your computer and use it in GitHub Desktop.
DBPageViewController * pc = [self getPageController:a.toPageId];
pc.refer = pid;
[self addChildViewController:pc];
[self.view addSubview:pc.view];
CGFloat width = self.view.frame.size.width;
CGFloat height = self.view.frame.size.height;
pc.view.frame = CGRectMake(width, 0, width, height);
DBPageViewController * pfc = [self getPageController:a.fromPageId];
__weak id weakSelf = self;
[self transitionFromViewController:pfc
toViewController:pc duration:0.4
options:UIViewAnimationOptionTransitionNone
animations:^{
pfc.view.frame = CGRectMake(0 - width, 0, width, height);
pc.view.frame = CGRectMake(0, 0, width, height);
}
completion:^(BOOL finished){
pfc.view.frame = CGRectMake(0, 0, width, height);
[pc didMoveToParentViewController:weakSelf];
[self print];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment