ios - Custom ViewController Transitions: Get ToViewController's Subview's Frame -
here's illustration of question:
i have starimageviews in viewcontrollers & b displays same image have different frames each other in viewcontroller.
when starimageview in viewcontroller tapped, app pushes new view controller navigation controller stack , @ same time, animates final frame in viewcontroller b.
this behaviour transition in iphone photos app.
how i'm doing now
i initialise temp uiimageview in animator object initial starimageview's frame , image in viewcontroller a, , animate final frame hard-coding rect cgrectmake(0, 60+44, containerview.bounds.size.width, containerview.bounds.size.width)
(frame of starimageview in viewcontroller b), , removing temp uiimageview superview in animation completion block.
how wish instead
the project created in storyboard autolayout enabled. wish frame of starimageview in viewcontroller b during transition rather hard-coding above. due viewcontorller lifecycle, unable reference subviews in viewcontroller b in animator object haven't been initialised yet.
are there other solutions or best practices such situations? in advance!
[toviewcontroller.view layoutifneeded];
Comments
Post a Comment