I am developing an app that's near release. I changed the minimum deployment from iOS 16.X to 17.0 in order to be able to use the TipKit Framework.
Making that change generated a ton of compiler warnings:
.onChange(of:perform:)' was deprecated in iOS 17.0: Use onChange with a two or zero parameter action closure instead.
After I fixed dozens of the warnings without issue, each subsequent attempt to fix a warning generated a compiler error:
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.
I decided to focus on just one file that had 13 different .onChange invocations. Nine were successfully converted to the new call, four were still deprecated. I tried to trace any possible source of type-check error for some of the simplest .onChange cases but nothing other than commenting out the .onChange in its entirety "fixed" the error.
I tried commenting out one of the fixed/converted .onChange calls first and then fixing one of the problematic ones and that worked, no type-check error. The bottom line seems to be that I can only have nine of the new .onChange calls in that file, the other four have to be in the deprecated format or commented out.
I tried upping the minimum deployment from 17.0 to 17.5 and that didn't work. I tried using a clean build folder and that also didn't work.
Right now, I'm running Xcode 15.4 on Sonoma 14.7.2. I'm trying to avoid updating to the latest Xcode to avoid adding confounding variables and/or other possible issues. I am aware that for submission and release I will have to do so, I want to do it "on my terms" when everything is working properly.
Any help would be appreciated.
Topic:
UI Frameworks
SubTopic:
SwiftUI