0

Background

When the app is backgrounded I want to have a lock screen that forces the user to log in again. I have implemented this in the OnResignActivation method in AppDelegate.

Functionally this works fine, however, when backgrounded the lock screen tries to slide in but doesn't have time to complete. When the app opens again this animation completes.

Question

How can I get the animation to complete or not use the animation at all so that when ever the app is opened again the lock screen is there and not half way across?

Colin Bacon
  • 15,436
  • 7
  • 52
  • 72

1 Answers1

1

Solution

The solution was in fact in implement the lock screen logic in DidEnterBackground instead of OnResignActivation in AppDelegate.

As the code was running to soon in the life cycle I was getting half an animation behaviour. Putting it in DidEnterBackground resolves this.

These SO answers helped me arrive at this solution.

https://stackoverflow.com/a/12416131/1593273

https://stackoverflow.com/a/25985478/1593273

Community
  • 1
  • 1
Colin Bacon
  • 15,436
  • 7
  • 52
  • 72