I have implemented UIPageviewContoller to support multiple viewcontoller view at half bottom of my screen. now my question is how to support Facebook style panning effect to on of this subview on my pageview controller.
I want to achieve Facebook message style effect which they have applied in camera, in that with pan of finger we can make view as full screen. and when we pan down the same view it will adjust within original from of view.. Ihave attached some of screen for better understanding.
and it should support integrative pop gesture to.
I could able to get similar effect but for that i have added view to main window so view can pan to full screen but by this approach i am not able to achieve interactive pop iOS default gesture and this approach is not good with my current pageviewcontoller implementation.
and if view is added in window than if user pressed back button than window element will not move it will remain in window so windows approach is not good.
is there any other way to get similar effect? Does UIViewControllerInteractiveTransitioning may help for this ??
Thanks in advance. I know i will get better approach from you guys which will more stable for this than adding subview to window.
Have you tried adding swipe gesture to your subview A?
UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipeScreen:)];
swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
[yourSubViewA addGestureRecognizer:swipeUp];
and it's handling -
- (void)didSwipeScreen:(UISwipeGestureRecognizer *)gesture {
switch (gesture.direction) {
case UISwipeGestureRecognizerDirectionUp: {
[UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveLinear animations:^{
[yourSubViewA setFrame:desiredFullScreenFrame];
} completion:^(BOOL finished) {
}];
}
break;
default:
break;
}
}
To bring back to default position you can add another swipe gesture with UISwipeGestureRecognizerDirectionDown or maybe just a tap gesture. And for side menu MFSideMenu is nice one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With