Syed e Hussaini Syed e Hussaini - 8 days ago 4
iOS Question

NavigationController Push Distort Background Image

I have two

ViewControllers
both have have a Background Image with Height equal to the parent view of view controller.
When i
push/pop
between these
ViewController
the animation distort the background image animation when
pushing/poping
animation start.
I do not want to disable the
push/pop
animation but i also do not want this abrupt distortion of image animation as well.
My
NavigationBar
has a translucent property enabled as well as a transparent background image on
NavigationBar
.
I have set the background image on each view controller by
AutoLayouts
with Top, Leading, Trailing, Bottom with constant zero.

Answer

As per your question, I can understand that you have two view controller with background images by one you push to another one ,and when you navigate that view controller background image get distorted . Firstly in ios 10 you should use show instead of push methods then you should use dispatch while you navigating like that -

dispatch_async(dispatch_get_main_queue(), ^{
    [self.navigationController pushViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"thirdScreen"] animated:YES];
});

PS :- I dont think this would be cause by translucent property .