I have a UIViewController
which I am using to display a video ad. As soon as the user clicks on close ad button, I dismiss the view controller, but there's a flicker soon after it gets dismissed and the parent view appears.
Here's what I'm doing in code:
@interface myController:UIViewController
@end
static myController* vc = [[myController alloc] init];
@implementation myViewController
-(void) showController
{
[currentViewController presentViewController : self animated : NO completion : nil];
}
-(void) hideController
{
[self dismissViewControllerAnimated : NO completion : nil];
}
-(void) startPlaying
{
dispatch_async(dispatch_get_main_queue(), ^{
[vc showController];
//call the method which will play the video.
});
}
-(void) viewClosed
{
dispatch_async(dispatch_get_main_queue(), ^{
[vc hideController];
});
}
@end
It's not possible to get the screenshot as it happens quickly.
I have tried making the presented view transparent as I think that after dismissal, the flicker is due to the delay after closing the video ad and then trying to dismiss the presenting view controller. It works, but after dismissal it seems like the parent view is trying to go into portrait mode instead of landscape mode. Here's a screenshot of it: