Modal transition shows view behind while transitioning

118 Views Asked by At

I have a UITableView controller with a plus button in the navigation bar. When + is pressed, a modal transition is triggered and a UIView is now presented. Problem is while the modal transtion is happening, I can see the tableView behind until the whole transition is done. This is a pretty jarring animation and does not look good at all. I have set the alpha value for the background color of both views at 0.7. Maybe this is causing the issue? Any ideas?

1

There are 1 best solutions below

2
pteofil On

When you present you modal view, you have a completion block:

func presentViewController(_ viewControllerToPresent: UIViewController,
                 animated flag: Bool,
               completion completion: (() -> Void)?)

Set you view transparency to 1.0 initially and set it to 0.7 in the completion block after the animation has ended.