Fix all build warnings (iOS 26 concurrency + deprecations)#61
Merged
Conversation
The Where app tints per-region and ships no global accent color, but (unlike RegionViewer and Foreman) never cleared ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME, so actool warned that 'AccentColor' wasn't present in any asset catalog. Co-authored-by: Cursor <cursoragent@cursor.com>
The stamp-paper Canvas renderer runs nonisolated, so reading the main-actor `style.tint` inside it warned. Read the Sendable Color into a local before the closure and capture that instead. Co-authored-by: Cursor <cursoragent@cursor.com>
LifecycleStep.condition is a @mainactor (hence Sendable) closure, so capturing a local `var flag` and flipping it afterward tripped Swift 6's "mutated after capture by sendable closure". Read the flag through a small MutableFlag reference instead. Co-authored-by: Cursor <cursoragent@cursor.com>
`weakOriginal` is never reassigned, so the WeakMutability warning wants a `let`. Swift 6.2 allows `weak let`, so use it. Co-authored-by: Cursor <cursoragent@cursor.com>
CLGeocoder and reverseGeocodeLocation are deprecated in iOS 26. Switch to MKReverseGeocodingRequest. MapKit no longer exposes structured CLPlacemark fields, so PlaceComponents now derives its compact "City, Country" label from MKAddressRepresentations (cityName / regionName). The geocode runs on the main actor because MapKit vends its non-Sendable MKMapItems there; only the resulting String crosses back. Behavior note: a city-less coordinate that previously fell back to "State, Country" now degrades to the country name. Co-authored-by: Cursor <cursoragent@cursor.com>
…ation key UIApplication.LaunchOptionsKey.location is deprecated in iOS 26. Derive the LifecycleReason from the launch-time UIApplication.State instead: a .background launch means iOS woke the process headless, which for Where only happens to service a queued CoreLocation event. The CLLocationManager installed in initializePrerequisites still delivers the buffered event. WhereLaunch.lifecycleReason now maps UIApplication.State -> LifecycleReason (covered by pure tests); the AppDelegate test asserts it wired the reason from the live launch state. Also refresh the LifecycleKit README example. Co-authored-by: Cursor <cursoragent@cursor.com>
lifecycleReason mapped every headless (.background) launch to .background(.location), which over-claims: iOS only wakes Where for a significant-change/visit event, and that requires Always authorization. Guard the location attribution on CLAuthorizationStatus.authorizedAlways and fall back to .background(.other) otherwise, so a future non-location background cause isn't mislabeled. The cause is informational (both stay on the background step path), so behavior is unchanged today. Tests now cover the authorized/unauthorized background split, and the AppDelegate smoke test asserts the deterministic foreground mapping. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A clean build of both CI schemes (
Stuff-iOS-Tests,Foreman-macOS-Tests) surfaced 10 warnings in our own code, all on iOS. This drives the whole repo to zero compiler/asset warnings, split into focused, bisectable commits.One commit per concern:
AccentColor— clearsASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME(Where tints per-region, ships no global accent color), matching the other app targets, silencing an asset-catalog warning.Sendablestyle.tintinto a local before the nonisolatedCanvasrenderer closure.@MainActor(Sendable)conditionclosure tripped "mutated after capture"; read the flag through a reference.weak let— the weak binding is never reassigned (#WeakMutability).CLGeocoder/reverseGeocodeLocationare deprecated in iOS 26; migrate toMKReverseGeocodingRequest.PlaceComponentsnow derives its "City, Country" label fromMKAddressRepresentations(cityName/regionName), and the geocode runs on the main actor (MapKit vends non-SendableMKMapItems there).UIApplication.LaunchOptionsKey.locationis deprecated in iOS 26; derive theLifecycleReasonfrom the launch-timeUIApplication.Stateinstead. TheCLLocationManagerinstalled ininitializePrerequisitesstill delivers the buffered event..background(.location)only when the app isauthorizedAlways(the prerequisite for the significant-change/visit wake Where registers for), and to.background(.other)otherwise, so a future non-location background cause isn't mislabeled. The cause is informational (both stay on the background step path), so behavior is unchanged today.Behavior notes
CLPlacemark's standalone administrative-area field (only preformatted strings +cityName/cityWithContext/regionNameremain), so a city-less coordinate that previously fell back to "State, Country" now degrades to the country name. This is an SDK-level limitation, confined to remote coordinates.Test plan
xcodebuild clean build-for-testingforStuff-iOS-Tests— 0 code/asset warningsxcodebuild clean build-for-testingforForeman-macOS-Tests— 0 code warnings (only the pre-existing, benignappintentsmetadataprocessor"no AppIntents.framework" notes remain)./swiftformat --lintcleanWhereAppTests(incl. the authorized/unauthorized background split),PlaceComponentsTests,WhereResetTests,LifecycleStepConfigurationTestsStuff-iOS-Tests+Foreman-macOS-Tests) green