ios - Custom transition between UIViewControllers -


i've changed app being tabview driven collectionview driven, there many sections of app feasible tabview. when start app presented several items in collectionview , selecting of these items take relevant section of app.

in xcode, collection view lives in own storyboard , each section of app has own storyboard.

in collectionview's didselectitematindexpath, launch relevant starboard follows;

uistoryboard *storyboard = [uistoryboard storyboardwithname:@"relevant_storyboard" bundle:nil]; uiviewcontroller* vc = [storyboard instantiateinitialviewcontroller]; [self presentviewcontroller:vc animated:yes completion:nil]; 

now, none of built-in transition animations suit launching collectionview, i'd custom effect, such zoom in. however, i'm struggling find decent examples work me create kind of custom transition. i've tried [uiview transitionfromview], don't think suits transitioning between uiviewcontrollers. i've tried transitionfromviewcontroller:toviewcontroller: don't think have view hierarchy set correctly. i've tried using catransition without success.

i've thought doing custom segue but, collectionview in it's own storyboard , have separate storyboards each section of app, can't see how can this. @ least not without having sections of app inside 1 storyboard, make storyboard huge , difficult manage.

so, can give me code examples or pointers on how can solve this?

in app used similar effect zoom in thumbnail in collection view cell child view controller took entire screen. conceivably same thing navigation controller push well.

in code, had scoreview property on cell subclass wanted zoom full screen. in case, may want use uiimageview screenshot of new view. alternatively, present new view controller screenshot of old view controller , animate there.

//instantiate view controller animated in...  //if cell not inside collection view's frame, dissolve animation might more graceful. bool dissolveanimation = !cgrectcontainsrect(cgrectmake(0, 0, self.collectionview.frame.size.width, self.collectionview.frame.size.height), cellrect);  //get frame of cell in self.view coordinates, frame of thumbnail view cgrect cellrect = [self.collectionview layoutattributesforitematindexpath:indexpath].frame; cellrect = cgrectoffset(cellrect, 0.0, -self.collectionview.contentoffset.y); vsscorecell *scorecell = (vsscorecell *)[self.collectionview cellforitematindexpath:indexpath]; cgrect scorerect = dissolveanimation ? cgrectmake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height) : cgrectmake(cellrect.origin.x + scorecell.scoreview.frame.origin.x, cellrect.origin.y + scorecell.scoreview.frame.origin.y, scorecell.scoreview.frame.size.width, scorecell.scoreview.frame.size.height); vsscoreview *scoreview = [[vsscoreview alloc] initwithframe:scorerect];  //initialize view animated (in case scoreview)...  if (dissolveanimation)     scoreview.alpha = 0.0;  [self.view addsubview:scoreview];  [uiview animatewithduration:0.3 delay:0 options:uiviewanimationoptionbeginfromcurrentstate animations:^{     if (dissolveanimation)         scoreview.alpha = 1.0;     else         scoreview.frame = cgrectmake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height); } completion:^(bool finished) {     if (finished)     {         //add scoredisplaycontroller child view controller or present without animation         [scoreview removefromsuperview];                 } }]; 

of course, new ios might make easier (my lips sealed), hope helpful situation!


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -