Recently, our team bumped into a crash that we cannot resolve. We looked for help everywhere. I asked people here on forums, team asked about 10 fellow developers and the question on SO was created. Nobody knows the reason for the crash, nobody can find a workaround. So, as the last resort, I called for Apple Technical Support (aka code-level support). I assumed that people there understand how things work under the hood. Considering that this service is limited (2 TSI per year, otherwise paid), I expected the quality to be high. In fact, it didn't help us to resolve the problem, and I was disappointed how irrelevant the provided support could be. TLDR: The dev didn't even open the test project!
I described the memory crash with WidgetKit-based complication. I spend my time capturing video, finding watch logs on my iPhone and creating a sample project. I attached console output, stack traces and a couple of screenshots. I even provided a .watchface file, so they can reproduce the configuration. This together took about 6-8 hours of work. I explained what happens in detail: steps to reproduce, what I've tried. I asked the support to recommend me way to present only the specified complications.
Then I submitted the issue and started to wait. It took them 1 week to responsd. I pointed my sight on the email with excitement, expecting to finally get the resolution. But what I found there was disappointing. The software engineer, Rico, quoted only a couple of sentences from my list. His letter contained only 4 lines of text (not including greetings and cheers).
- In the first line he recommended to use preprocessor macro to enable only necessary complications, which is nonsense. Of course we need to change complications dynamically, when the user selects them.
- I two next lines he recommends to use if statement in WidgetBundle to dynamically unlock the complications. I already knew that it isn't possible. Because, quote: "if statements in a WidgetBundleBuilder can only be used with #available clauses"
@available(*, unavailable, message: "if statements in a WidgetBundleBuilder can only be used with #available clauses")
public static func buildOptional<W>(_ widget: W?) where W : Widget
- The last line cancelled everything before, Rico said that this can't be done at runtime. Probably, he added that after reading the documentation, but forgot to edit his previous statements.
I didn't give up completely. I decided to skip the design discussions and get the info that Rico could probably have, due to his access to the software. Why the extension using so much memory? I also asked him, if he was able to build the project and reproduce the bug.
Another week passed. I'm sending a follow-up message. That worked, after another 3 days I got the response:
- Finally some useful information! Timeline and views are being archived to disk (all simultaneously), that's why the memory usage is so high. Basically, a widget design issue. But anyway, we have what we have.
- Then next line, he has written this: "Complications are deprecated". What? But wait, he thinks that we use ClockKit, and recommends migrating to WidgetKit. So Rico completely forgot that we discussed WidgetBundle and SwiftUI before 🤡
- He honestly tells me that he didn't open the project. Why? Because "Complications are unlikely to be supported", he says. So he "forgot" WidgetKit on intention, this gave him an excuse to ignore the sample project. My time was invested for nothing!
I believe there's no need in further conversation with Rico. I will provide the detailed feedback to the Apple. And I'm posting it publicly to make sure that Rico gets the attention he deserves.
If you want to know more technical details about the issue, you can check the following links: