Change View in Multitasking Switcher not working on iPhone6

90 Views Asked by At

I have to change the snapshots and multitasking view of only some views that contains confidential data. For that I use the following code, which is called when NSNotification.Name.UIApplicationWillResignActive is triggered. My problem is that on iPhone 6(11.1.1) it does not work when it goes to the multitasking switcher (app switcher). (I have tried on iPhone 6s 11.1.1 and it worked perfectly), also in more advanced devices. In iPhone 5 it works 9 of 10 times. But in iPhone 6 it never works. (When I bring the App to foreground again it shows the LaunchScreenViewController for just a few and then it disappears). I have checked that the code inside completion closure is called before change the state to inactive, but it does not present the LaunchView.

I do not want to call the app delegate or Window from a viewController, I also have tried to get the viewController loaded in a static var and just present it, and it didn’t work neither. Moreover, I tried to add a subview to the navigation controller but it does not work neither in the iPhone 6. (I have tried with 2 iPhones 6). When the application goes to the background it works fine, also If I am in the app switcher (the launch View is not shown, but if I reopen another application and then I go again to the App switcher, now the application shows the Launch View.

let overlayVC = LaunchScreenViewController(showsSpinner: false)
        self.navigationController?.present(overlayVC, animated: false,completion: { [weak self] in
            self?.setObserverApplicationIsActive()
        })  

Have you dealt with this problem? I also tried to add a blur effect but it didn't work.

Edit: If you run a video on youtube and change to the multitask switcher, the video continues playing. So I do not know why on iPhone 6 it does not present a new viewController.

0

There are 0 best solutions below