Currently I am using [self presentModalViewController :newVC animated:YES]
.I want to present newViewcontroller from left/right/top/bottom with a push effect. I tried to use CATransition but it displays a black screen in between the transition.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
When present:
When dismiss:
There are only four UIModalTransitionStyles:
For example:
I had the same problem. Say you want to present a view controller 2 from view controller 1. In the first view controller use
In the second view controller, in viewWillAppear: method add the code
It will work fine. If black screen comes again, if you are using navigation controller, replace
with
After X >= 4 hours of work, this works without "tearing" or other background artifacts:
Then in
AppDelegate.swift
:This assumes an app is using the default storyboard with an initial VC as a
UINavigationController
Update for swift 3/4
And the transitioniningDelegate implementation for the VC being pushed/dismissed:
You can set a
transitioningDelegate
on the view controller that you want to present. You must conform toUIViewControllerTransitioningDelegate
andUIViewControllerAnimatedTransitioning
protocols. And by implementinganimateTransition(transitionContext: UIViewControllerContextTransitioning)
you can animate either view controllers subviews.Function that performs transition
Then the TransitionManager looks like: