background excution lifecycle

background push or background refresh can wake app in the background. according douctument About the background execution sequence, if app is not runing, system launch app an move it directy to background. however if user tap app icon when system launch app and calling didFinishLaunchingWithOptions method, then what is execution order of app lifecycle

Answered by DTS Engineer in 768422022

There are unavoidable race conditions in this space. And you’ll see similar things when your app is moved to the background, where there’s a race between it being suspended and the events that might resume it in the background.

My recommendation is that you try to avoid relying on the exact order of events, but instead structure your code so that your app converges on the right state regardless of what order things happens.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

There are unavoidable race conditions in this space. And you’ll see similar things when your app is moved to the background, where there’s a race between it being suspended and the events that might resume it in the background.

My recommendation is that you try to avoid relying on the exact order of events, but instead structure your code so that your app converges on the right state regardless of what order things happens.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

try to avoid relying on the exact order of events

@eskimo This could go with the topic of relying on undefined behavior that I proposed here.

background excution lifecycle
 
 
Q