Repository navigation
ios: fix the launch crash on iOS 15 from the iOS 26 toolbar spacer - #8055
Open
UTMapp-bot wants to merge 1 commit into
Open
UTMapp-bot wants to merge 1 commit into
UTMapp-bot wants to merge 1 commit into
Conversation
UTMapp-bot
added a commit
to UTMapp-bot/UTM
that referenced
this pull request
Nov 4, 2026
This was referenced Nov 12, 2026
UTM crashed on launch on iOS 15 (EXC_BAD_ACCESS in VMListModifier.body,
in View.toolbar, looking up a protocol witness table for
buildLimitedAvailability): the toolbar builder held
`if #available(iOS 26, *) { ToolbarSpacer(...) }`, whose iOS 26-only type,
erased inside the builder, does not exist on iOS 15. A conditional in a
ToolbarContentBuilder also needs iOS 16 (its buildIf), so Xcode 26 does
not build this for iOS 15 at all.
The availability check now picks between two toolbars at the view level,
where conditionals work on every supported version, and the toolbar items
are properties shared by both, so the order and the iOS 26 spacer are as
before.
Tested: UTM launches to its welcome view on iOS 15.5 and 16.4 simulators
(15.5 crashed on launch before the fix), and the iOS 27.1 iPhone toolbar
looks as before.
Assisted-by: Claude:claude-opus-5-5
osy
force-pushed
the
fix/ios15-toolbar-spacer
branch
from
November 12, 2026 06:33
f992d73 to
467726a
Compare
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.
UTM 5.0.6 through 5.0.8 crash on launch on iOS 15. The crash comes from 8521d24, which put
if #available(iOS 26, *) { ToolbarSpacer(...) }inside the VM list's toolbar builder. iOS 15 doesn't have the iOS 26-only type that gets erased inside the builder, and a conditional inside a ToolbarContentBuilder needs iOS 16.The fix moves the availability check out of the toolbar builder and into the view, where conditionals work on every supported OS version. The fix follows the pattern already used in
VMToolbarModifierandVMSettingsView. The toolbar items are now properties shared by both versions of the toolbar, so the items, their order and the iOS 26 spacer are unchanged.Testing
Tested by an AI agent on simulators: iOS 15.5 and 16.4 iPad in a macOS 15 VM (Xcode 26.6), and iOS 27.1 iPhone Duo on a macOS 27 host.
Before (upstream/main, iOS 15.5 iPad simulator): UTM quits right after launch. Crash report:
After: UTM opens to its welcome view on iOS 15.5 and iOS 16.4. On 16.4 the full toolbar shows (create, donate, settings, Edit).
Left: iOS 15.5 iPad. Right: iOS 16.4 iPad.
iOS 27.1 (iPhone Duo): the toolbar, including the spacer between create and donate, is identical before and after.
Left: before. Right: after.
The macOS build compiles. The UTM Remote and visionOS variants were checked by reading the code; they could not be built here.