Search code examples
iosswiftperformanceios-app-extension

iOS Action Extension slow loading time


So, basically I'm trying to decrease loading times for an Action Extension I'm writing for IOS.

According to: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html#//apple_ref/doc/uid/TP40014214-CH5-SW7

I should aim to get the loading time below 1 second (if it takes too long it might be shut down by the system prematurely)

Right now it loads in around 4 seconds on an iPad (a bit faster in the simulator) - so far iOS haven't shut down my extension, but this will be destructive for the user experience.

As far as I'm aware I don't have access to a AppDelegate.swift file when working with extensions, thus I'm having a hard time figuring out what is causing the slow loading times.

Does anyone have any idea where to look or maybe some experience with this?

Thanks!


Solution

  • The reason for the slow loading times was that I launched the app extension in debug mode. Running the app without the debugger it was significantly faster.

    Did not consider this at all, but now it works like a charm :)