跪拜 Guibai
← All articles
iOS

Xcode 27.2 Upgrade: What a 10-Year-Old iOS App Had to Change When Apple Said 'Do It'

By 观林Dev ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

For teams maintaining long-lived iOS apps, Apple's annual SDK mandate isn't a compile-time chore—it's a runtime contract rewrite that breaks silent assumptions, and closed-source binary SDKs can fail in ways you can't grep for. The specific workarounds here—like self-drawing nav bars and tab bar buttons—show what it takes to regain pixel-level control under Liquid Glass.

Summary

Apple's requirement to submit with newer Xcode forced a long-lived iOS project, started in 2015 with ObjC/Swift mixed code and dozens of third-party SDKs, to jump from an old toolchain straight to Xcode 27.2 and bump the deployment target from iOS 13 to 15. The upgrade touched 43 files and added about 1,100 lines of code, but almost none of the work was fixing compiler complaints. The pain showed up after linking: iOS 26/27's Liquid Glass design and new semantics silently took over UI rendering and API behavior, breaking a decade of assumptions.

The migration report, ordered by damage level, covers the mandatory UIScene lifecycle (with crashes on launch if not adapted), UIWindows not attached to a scene refusing to render, a fully reworked tab bar that invalidated a custom CYLTabBarController plus-button, nav bar button tint colors rendering as white on iOS 26, and transition animations capturing first layout frames. It also details a particularly nasty case where a closed-source verification-code SDK was reading the deprecated `statusBarOrientation`, which now returns 0 and underflows into treating portrait as landscape, flinging the captcha popup to the top-right corner. The author's final line sums it up: the enemy of an old project isn't compile errors, it's broken behavioral contracts with the system.

Takeaways
— The forced migration touched 43 files and added about 1,100 lines, with most effort going to runtime behavior changes, not compile errors.
— UIScene becomes mandatory in the new SDK; not adapting crashes the app on launch, and the Info.plist needs `UIApplicationSceneManifest` or iOS 18 physical devices won't start.
— URL callbacks must move from `application:openURL:options:` to the scene delegate's `scene:openURLContexts:`, and cold starts need the URL contexts from `connectionOptions.URLContexts`.
— Self-created UIWindows using `initWithFrame:` stop rendering in scene-based apps; they must use `initWithWindowScene:` or be re-attached on `UISceneDidActivateNotification`.
— The new Liquid Glass tab bar breaks custom tab bar positioning; the fix for a floating center button is to use a blank item with nothing renderable and position the real button geometrically by subdividing the tab bar width.
— `UIBarButtonItem` tint colors and title text attributes partially fail on iOS 26's nav bar, forcing the project to hide the system bar and self-draw the top bar on iOS 26 while keeping the classic bar on iOS 18.
— Deprecated APIs like `UIApplication.statusBarOrientation` now return 0 in scene-based apps; closed-source SDKs that read it can misbehave (e.g., a captcha popup moving to the top-right), and `strings` scanning of the SDK binary is needed to find the usage.
— Transition animations capture the first layout frame; the fix is to pre-set view frames to their final values before the view enters the hierarchy and disable animations during transitions.
— Workarounds for system-specific bugs should be gated by platform checks so they don't spread to unaffected iOS versions.
Conclusions

The dominant cost is behavioral contract changes, not compile errors; code that worked for a decade assumes rendering and API semantics that iOS 26/27 silently replace.

Closed-source SDKs are the biggest risk in a forced migration because their logic is opaque; binary scanning with `strings` and disassembly is the only way to catch their reads of deprecated APIs.

The project's repeated shift to self-drawn UI—the nav bar, the tab bar button, the swipe-to-delete—points to a simple truth about Liquid Glass: if you need pixel-perfect control, you have to cut the system out of rendering entirely.

Tying workarounds to platform checks, rather than applying one patch everywhere, keeps a legacy project from accumulating damage on systems that never had the bug.

Concepts & terms
UIScene
Apple's app lifecycle model introduced in iOS 13 that manages multiple scenes (windows) per app; in recent SDKs it becomes mandatory, so apps must adopt scene delegates and scene manifests to run on current iOS.
Liquid Glass
Apple's design language for iOS 26/27, characterized by translucent, glass-like materials and new system UI rendering; it changes how tab bars, nav bars, and other chrome behave and breaks previous custom renderings.
UIApplicationSceneManifest
An Info.plist key that declares an app's scene configuration, including scene delegate classes and session roles; without it, an app using scenes may not launch on physical devices.
Monkey test
A UI testing technique that sends random touch events and gestures to an app to surface crashes or behavioral regressions; the author recommends running it before migration to separate runtime issues from compile errors.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗