I noticed two differences in my share extension's behaviour compared to my main app:
- The
layer.presentation()
values can be massively out of date, which means that continuing animations from their current position is not possible. This is both true for manually checking thelayer.presentation()
values, as well as for letting UIKit doing the replacement-continuation viaUIView.animate(..., options: [.beginFromCurrentState], ...)
. - UI updates seem to be ignored if the share extension performs heavy calculation. Interestingly, it doesn't seem to matter whether I do this calculation in the main thread or in a background thread, and call the main thread for UI updates via
DispatchQueue.main.sync { ... }
. I see my console in Xcode filling with progress updates fromprint(progress)
statements, but the UI just doesn't move. Once the heavy processing is done, it instantly updates again.
I assume that 1 and 2 are related. If I cannot get the UI to draw while the computation is done, I probably also can't get up-to-date presentation layer values.
Are there any explanations for this behaviour, and any advice on how I could circumvent the problem? Again, this is specific to my share extension and doesn't happen in my main app.