I'm developing a Share Extension for iOS 8 with custom UI, but it appears without animation, how can I do this? It's a regular UIViewController.
Also, it appears on fullscreen on iPad and I want it to be a modal view controller, that appears in the center of the screen and doesn't fit it, how can I do this?
Regards.
How did you present the view controller? I did the mapping by setting a segue - "show", see the attached screenshot. Try to use modal. If you use push, you should dismiss it with the pop method of the navigation controller.
To present a ViewController in a NavigationController you can wrap ViewController into a NavigationController as it is in the example below. Then present NavigationController which contains ViewController. Check out the below video courses to learn more about Mobile App Development for iOS platform with Swift.
Here is the cleanest solution I found so far to animate my custom view controller in and out!
Animate IN:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.view.transform = CGAffineTransformMakeTranslation(0, self.view.frame.size.height);
[UIView animateWithDuration:0.25 animations:^
{
self.view.transform = CGAffineTransformIdentity;
}];
}
Dismiss:
- (void)dismiss
{
[UIView animateWithDuration:0.20 animations:^
{
self.view.transform = CGAffineTransformMakeTranslation(0, self.view.frame.size.height);
}
completion:^(BOOL finished)
{
[self.extensionContext completeRequestReturningItems:nil completionHandler:nil];
}];
}
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