Construct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.

Posts under UIKit tag

200 Posts

Post

Replies

Boosts

Views

Activity

Public API for the iPhone Duo inner-display glow in tent mode
Feature request: Public API for the iPhone Duo inner-display glow in tent mode I’d like a public API for the colored glow that the StandBy alarm casts onto the table in tent mode. It’s a subtle detail that would work well in other apps. The outer display could keep showing the app while the inner glow picks up a color from album artwork or shifts as a timer counts down. The private UIKitCore methods +[_UISceneCompanion _alarmGlowContent] and +[_UISceneCompanion _highlightCompanionWithColor:] point to the effect I mean. SpringBoard also defines SBCompanionScenePresentationModeInnerDisplayStandbyAlarmGlow. In SwiftUI, I could imagine using it like this: .sceneAccessory { InnerDisplayGlowAccessory(color: glowColor) }An optional intensity parameter would be nice, too. That would let apps keep the glow faint during playback or brighten it briefly when something changes, within brightness limits set by iOS.
0
0
30
3h
Mac Catalyst: disabled SwiftUI toolbar buttons turn into pills and don’t update their state
Hi everyone, we’ve been fighting with disabled toolbar buttons in our Mac Catalyst app and wanted to check whether others are seeing the same thing, or whether we’re missing something. Our toolbar lives in a SwiftUI NavigationStack, so Catalyst bridges it into the window’s NSToolbar. Enabled buttons look and work great: native buttons with a round 36 × 36 pt glass. But as soon as a button uses .disabled(_:), things fall apart: It turns into a wider pill. A button that is disabled when it appears becomes an image item instead of a button (NSToolbarImageView with a UIImage), and its glass grows to 47 × 36 pt. Its state doesn’t update. Toggling .disabled(_:) doesn’t reach the existing toolbar item. It only changes if we give the ToolbarItem a new id, which then brings back the pill. Disabling the NSToolbarItem ourselves doesn’t stick. UIKit revalidates the toolbar whenever any item changes, and copies the bar button’s enabled state back over ours. Drawing our own image to fix the shape crashed AppKit (“Unable to install constraint on view”) as soon as the item switched back to enabled. For now we keep the SwiftUI button enabled on the Mac and disable the native NSToolbarItem ourselves. We find the toolbar via NSToolbar.willAddItemNotification and use KVO to put the state back whenever UIKit overrides it. It works, but it feels like it shouldn’t be necessary. Here’s a minimal example: struct ContentView: View { @State private var canUndo = false var body: some View { NavigationStack { Button("Toggle") { canUndo.toggle() } .toolbar { ToolbarItem(placement: .topBarLeading) { Button("Undo", systemImage: "arrow.uturn.backward") {} .labelStyle(.iconOnly) .disabled(!canUndo) } } } } }Seen on macOS 27.2 and 26.7.1, Xcode 27.2. Filed as FB25597608. Is there a supported way to get a disabled toolbar button that stays a normal native button? Any hints are very welcome. Thanks!
0
0
38
17h
Can an iOS Custom Keyboard Legally Launch Its Containing App for a User-Initiated Speech Recording?
I’m developing an iOS application with a custom keyboard extension and a companion app. Our intended user experience: The user is typing in an app such as WhatsApp using our custom keyboard. They tap the Speech button. Our companion app opens automatically. The companion app establishes a microphone session. iOS returns the user to the original host app. The user continues dictating through the keyboard. What we have already implemented: A Swift-based custom keyboard and companion app. App Groups and Darwin notifications for communication between the two targets. Microphone recording through the companion app. Apple Speech Recognition with on-device recognition. A warm background audio session. Subsequent recordings and text insertion work on a physical iPhone once the warm session is established. Our current blocker: The keyboard extension cannot successfully open its companion app when the warm session is inactive. We previously tried NSExtensionContext.open(), but it did not work. We want to avoid private APIs, responder-chain workarounds, and anything that could violate App Store Review Guidelines. My questions: Does Apple provide any officially supported public API that allows a custom keyboard extension to launch its containing app in response to an explicit user tap? Can App Intents or ForegroundContinuableIntent legitimately achieve this from a keyboard extension? Does App Review Guideline 4.4.1 prohibit this particular user-initiated handoff? If direct launching is prohibited, what Apple-supported architecture or interaction pattern would you recommend for this use case? Is there a supported way for the companion app to return the user to the original host app after establishing the microphone session? We are looking for guidance based on actual iOS platform restrictions and supported APIs, preferably from developers who have shipped custom keyboard applications. Thank you.
1
0
38
19h
No lifecycle notification when entering App Switcher while app remains inactive after Face ID
We use LAContext.evaluatePolicy(.deviceOwnerAuthentication) for a local app lock. On an iPhone 16 Pro running iOS 26.6.2, after authentication succeeds, UIApplication.shared.applicationState can remain .inactive for approximately 2–8 seconds although the app UI is visible. If the user enters the App Switcher during this interval, the app receives no additional willResignActive or didEnterBackground notification. Returning to the app produces only didBecomeActive. This means the app cannot distinguish between: remaining in the app while the Face ID UI finishes dismissing; and entering the App Switcher and returning during the same inactive interval. Reproduction: Run a minimal UIKit app on a physical Face ID device. Call evaluatePolicy(.deviceOwnerAuthentication). Immediately after successful authentication, enter the App Switcher before didBecomeActive. Wait three seconds and return. Is there a supported public API or lifecycle pattern that lets an app lock immediately in this situation without keeping its content covered until didBecomeActive?
1
0
37
20h
State Restoration no longer works in a Mac Catalyst based app when run on macOS 27.x
As reported in FB25363417: A UIKit based app running on macOS 27.2 (or macOS 27.0.1) via Mac Catalyst no longer has functioning state restoration. Upon app restart, there is no NSUserActivity being provided to the scene in the UISceneDelegate method scene(_:willConnectTo:options:). This can be tested with Apple’s own sample app “Restoring your app’s state”. Just update the sample project with support for a Mac Catalyst build. Using Xcode 27.2 on a Mac with macOS 27.0 or 27.2, build and run the Mac Catalyst version of the app. The main screen appears with a list of products. Select any product so you see details of the product. Quit the app. Run the app again. Note that you are not returned to the previously selected product detail screen. Instead, you just see the main list of products. If you run the same app and perform the same steps on a Mac running macOS 26.x, then when the app is restarted, you correctly get returned to the previously selected product detail screen. The problem is being caused by no NSUserActivity being passed into the scene delegate on app startup. While running the app on a Mac with macOS 27.x, put a breakpoint on the initial guard statement in scene(_:willConnectTo:options:) and you will see there is no activity on app restart. This is impacting paid customers of my existing app since upgrading to macOS 27. They no longer get returned to the app’s previous state when restarting the app. It is expected that state restoration should work on macOS 27 just as well as it does under macOS 26 in an app built with Mac Catalyst.
1
0
158
1d
iPhone Duo vertical bar: system back button ignores custom back indicator image (UINavigationBarAppearance.setBackIndicatorImage)
On iPhone Duo (iOS 27.1), when UIKit moves a navigation controller's system back button into the vertical bar, the button always shows the system chevron. Every public API for customizing the back indicator image is ignored there, although the same configuration is honored in the horizontal (top) navigation bar. APIs tested (each one alone, on the second view controller of a UINavigationController stack, with no leftBarButtonItem): A. Nothing set (default). B. UINavigationBar.standardAppearance set to a UINavigationBarAppearance on which setBackIndicatorImage(_:transitionMaskImage:) was called. C. Same appearance assigned to all four UINavigationBar properties: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. D. Same appearance assigned to all four UINavigationItem properties of the pushed view controller: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. E. Legacy UINavigationBar.backIndicatorImage and UINavigationBar.backIndicatorTransitionMaskImage, with no appearance objects set. F. UINavigationBar.appearance() proxy: all four appearance properties, set before the navigation controller is created. G. UINavigationItem.backBarButtonItem of the previous view controller set to UIBarButtonItem(image:style:target:action:). H. Control: UINavigationItem.leftBarButtonItem set to UIBarButtonItem(image:style:target:action:) with the same image (axisBehavior left at .automatic). The marker image is UIImage(systemName: "arrow.uturn.backward"), so it cannot be mistaken for the system chevron. Results: Top navigation bar (iPhone 17 Pro iOS 27.0, and iPhone Duo open with portrait UI): B, C, D, E and F show the custom image. G shows the chevron followed by the image. Vertical bar (iPhone Duo closed; iPhone Duo open with landscape UI; also inside a UITabBarController with the tab bar hidden or visible): A through G all show the system chevron. Only H shows the custom image. At viewDidAppear, the app confirms that the configuration is in place: navigationBar.standardAppearance.backIndicatorImage is the marker image (B, C), navigationItem.standardAppearance is non-nil (D), and traitCollection.verticalBarEdge is .trailing. This contradicts the guidance given by an Apple Technology Evangelist in https://developer.apple.com/forums/thread/847875: "If you are only replacing the icon on the back button, you could use set the backIndicatorImage and maintain default system behavior. This would be the recommended approach." As things stand, the only way to show a custom back icon in the vertical bar is to replace the system back button with a leading item. That loses the system behavior that comes with it: UINavigationController.interactivePopGestureRecognizer, interactiveContentPopGestureRecognizer and the back-history menu.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
3
547
1d
UITableView row reordering no longer works under macOS 27 with Mac Catalyst
Under macOS 27 using Mac Catalyst for a UIKit-based app, If you present a view controller with a table view as a form sheet or page sheet, row reordering fails to function. You can drag a row as expected but the blue movement bar never appears and if you drop the row it simply returns to its original location. The exact same view controller presented as a popover works just fine. The exact same view controller not presented as a modal (such as the app's root controller) works just fine. This is a serious bug affecting existing applications and being reported by paying customers. This has been reported as FB25038883 which includes a simple sample app demonstrating the issue.
4
1
568
1d
iPhone Duo Unfolded Safe Areas
Hi, my app is currently built on Xcode 27.1 I am working on upgrading to Xcode 27.2 We have a regression issue whereby, the top safeArea is 82 despite the vertical bar being opted in and active. This only happens on unfolded landscape. Our right safeArea is 0 for the window and is 84 for the view safeArea. Both window and view safeAreas have the top safe area of 82 though. We would like to know what could be the cause behind the top safeArea being activated. Note: this is not an issue for iOS 27.1
2
0
198
2d
SwiftUI Architecture Guide
Application Types Applications are divided into Document-based and Library-based. A document-based application stores user data in individual, standalone files. Users manually name and organize those files in a local system or synced cloud storage such as iCloud. The software typically opens multiple windows for different projects. This framing is for standalone, complex files that need to be shared, exported, or handled independently. A library-based application manages data in one unified, central repository, locally or through remote cloud databases. Spotify, Netflix, and Notion are the examples shown. The file system is hidden; updates are saved automatically in real time; and a single window supports browsing, search, and access to the synchronized data collection from any device. Model Types Four model types: Data, Domain, Application, and Presentation. Apple Platforms In Apple MVC (AppKit / UIKit), the model branches to Data, Domain, and Presentation. In SwiftUI, Model branches to Data and Domain. Project Structure SwiftUI App Folders Swift Package Folders App Modularization Not every module in a large application needs to be extracted into a separate framework or Swift Package. Logical modularization can also be achieved through a well-organized folder structure within the main project. Introduce separate packages or frameworks only when there is a clear benefit, such as independent reuse, distribution, build isolation or ownership. Avoid unnecessary project and dependency management overhead. State Management & Data Flow Source of truth is “a key concept in SwiftUI”: a single place to store a piece of data, with everywhere else reading the same piece of data. Environment is SwiftUI’s native dependency-injection mechanism. It allows shared dependencies, domain models, and services to be injected at the appropriate view-hierarchy level and accessed where needed without explicit parameter passing or unnecessary coupling. It is described as a tool for managing dependencies and sharing state across the view hierarchy. Domain Model Ownership Domain Models should be owned by the highest relevant SwiftUI view in the hierarchy that defines their context and lifecycle. NavigationStack owns the Domain Models for its navigation context and makes them available to descendant views through @Environment. When a NavigationStack is embedded in a TabView or NavigationSplitView, ownership moves up to the TabView or NavigationSplitView so the models can be shared across tabs or split views. The stated result is clear ownership scope, sharing where needed, and isolation between independent navigation contexts. Previews & UI Testing Environment injection makes SwiftUI Previews and UI Tests easier to configure by allowing real Domain Models to be replaced with mock or dummy instances. Views can be tested independently with controlled data and predictable states, without requiring real services, network requests, or application setup. Domain and Data Model Examples For a library-based app with remote data. Additional Domain Model Examples E-commerce Catalog, ShoppingCart, OrderHistory, Wishlist Banking MyAccounts, MyCards, MyTransactions, MyInvestments Social Network Feed, Conversations, Notifications, Friends Healthcare MyAppointments, MedicalHistory, Prescriptions, MyHealth Education Courses, MyCourses, Assignments, MyGrades, LearningProgress Real Estate PropertyCatalog, MyProperties, Favorites, Appointments Hotel Booking Destinations, Search, MyBookings, TravelHistory Food Delivery RestaurantCatalog, ShoppingCart, MyOrders, DeliveryTracking Project Management Projects, MyTasks, TeamMembers, Notifications Insurance MyPolicies, MyClaims, Coverage, Documents Smart Home MyHomes, Devices, Automations, EnergyUsage Fitness MyPlans, MyProgress, MyGoals, WorkoutHistory Other Search, Dashboard, Favorites, Notifications, Settings, ActivityHistory, Recommendations, Subscription, DocumentLibrary ViewModel? - MVVM In SwiftUI, the View encapsulates the UI content (body), its state (properties), and its actions or tasks (functions). This is possible because SwiftUI is designed around a declarative, state-driven UI model. In Android and .NET platforms, a separate ViewModel is typically required to hold and manage the View's state. Projects that intoduce ViewModels in SwiftUI add unnecessary architectural complexity, boilerplate, and code duplication; synchronization issues; unclear state ownership; additional lifecycle management; more abstractions; harder debugging; and increased maintenance, without meaningful benefits over SwiftUI's native state management. In UIKit, introducing a separate ViewModel layer is often unnecessary, as UIViewController already serves as the presentation model, handling presentation logic and coordinating the view. Non-UI responsibilities can be delegated to dedicated ModelControllers or Managers, avoiding unnecessary layers and abstractions. Domain Models vs. ViewModels Domain Models are view-independent, while ViewModels are view-dependent. A ViewModel is tightly coupled to the structure, state, and lifecycle of a specific View. Whenever the View code changes, its ViewModel often requires corresponding coding changes, and vice versa, creating additional maintenance and synchronization overhead. Domain Models, on the other hand, represent application context and business functionality independently of the UI. This separation preserves UI independence and allows the same Domain Models to be shared across different screens and platforms, such as iPhone, iPhone Duo, iPad, and macOS, without duplicating or adapting business logic for each View. This makes Domain Models a more scalable and maintainable approach for modern SwiftUI applications, particularly those targeting multiple screen sizes and platforms.
1
0
260
2d
A bug in iOS 27.3 beta 2 where the UIHingeInteraction value is received even though it is not an iPhone Duo device.
The device currently showing the symptom is iPhone SE3, iOS 27.3 Beta 2 version installed. (Same symptom exists in Beta 1 as well.) On screen A When switching to another ViewController (screen B) with pushViewController of UINavigationController Declare UIHingeInteraction on screen A and self.view.addInteraction(hInteraction) I added it like the code above. Hinge value comes in. In the sample code below update.hinge value is not nil The update.hinge!.angle value is also displayed as 0. let hInteraction:UIHingeInteraction = UIHingeInteraction { interaction, update in if update.hinge != nil { let hingeAngle:CGFloat = update.hinge!.angle..... }} In apps installed on other iPhone 17 devices (with iOS 27.2 installed), the value does not appear there. A quick fix is ​​needed. I have also submitted a report via Apple Feedback; please ensure this is addressed in the upcoming Beta 3 release. *** Plus *** The horizontalSizeClass and verticalSizeClass properties are returning "Regular" values, similar to how they behave on the iPhone Duo's internal display. Please fix the above issue as well.
0
0
105
2d
Camera preview rotated 90 degrees on initial presentation on iPadOS 27.2.1, corrected after returning from Control Center
Dear Apple Support Team, We are investigating a camera preview orientation issue on an iPad and would appreciate guidance on the relevant UIKit and AVFoundation behavior. Our app uses Flutter and the third-party Regula Document Reader SDK for passport MRZ scanning. We understand that third-party SDK internals are outside Apple’s support scope. Our question concerns the relationship between the active interface orientation, presentation lifecycle, and camera preview connection orientation. Environment Device: iPad (A16), hardware identifier iPad15,7 iPadOS: 27.2.1, as reported by the device and diagnostic export App distribution: TestFlight App version in the diagnostic log: 2.0.14, build 7 Flutter plugin: flutter_document_reader_api 9.8.1718 Runtime Regula SDK API version: 9.8.6944 Runtime Regula SDK Core version: 9.8.20492 Steps to reproduce Hold the affected iPad in landscape orientation and open the app. Open the passport scanner. The scanner interface appears in landscape, but the camera image appears rotated by 90 degrees. Open Control Center, then dismiss it and return to the app. The preview can then appear in the correct orientation. Close and reopen the scanner; the issue may recur. Physically rotating the device does not consistently resolve the issue. Expected: The preview should match the current interface orientation from initial presentation. Actual: The preview initially has an orientation mismatch and may recover only after leaving and returning to the app. Diagnostic observations We collected initial-entry and app-resume observations within the same scanner session: Before scanner presentation, the active UIWindowScene.interfaceOrientation is landscapeRight. The SDK’s presenting view controller belongs to the active application window. The scanner controller has landscape dimensions of approximately 1180 × 820. The third-party SDK’s supported interface orientation is configured for landscape right. However, the initial preview connection reports videoOrientation = portrait and videoRotationAngle = 90. Updating supported interface orientations and requesting layout updates did not resolve the initial mismatch in this test. A subsequent app-resume observation reports videoOrientation = landscapeRight and videoRotationAngle = 0. This change is recorded before our app’s delayed layout refresh. We recognize that interface orientation and capture rotation are different concepts, and that connection metadata alone does not establish the displayed pixel orientation. We are providing these observations alongside the visible symptom rather than treating a particular angle as universally correct. Scope and investigation status Our separate QR scanner and receipt camera work normally on the same device. The passport scanner also works normally on many other iPads. We have not established that this affects all devices running this iPadOS version. An app-side orientation enum comparison issue was corrected before collecting the build 7 log, but the preview mismatch remained. We have not isolated the cause to iPadOS, our presentation code, or the SDK’s capture initialization. We do not yet have a focused standalone Xcode reproduction project. We are also preparing an inquiry to the SDK vendor. Questions Are there known circumstances in which a camera preview initially uses portrait orientation despite being presented in a landscape UIWindowScene? What is the recommended lifecycle point for determining the initial interface orientation and configuring the preview connection, particularly while presentation or rotation transitions are in progress? Which supported APIs should be used to keep preview rotation synchronized with interface changes on this iPadOS version? Could the recovery after dismissing Control Center indicate an initialization or lifecycle ordering issue? What additional observations would help distinguish these possibilities? What should we include in a minimal native reproduction or system diagnostic collection to make this issue actionable? We can provide a symptom video and an application diagnostic export. These were collected in separate tests on the same affected device and are not time-synchronized. The application export is not an Apple sysdiagnose. Thank you for any guidance on how to investigate this further. With Best Regards, GTF_Japan_Service
0
0
27
2d
iOS 27b3 SDK: iOS App on Mac crashes on UISearchBar focus
Our app crashes when compiled with the iOS 27 beta 3 SDK and run as an iOS app on Mac, on both macOS 26 and macOS 27, as soon as a UISearchBar receives focus. The crash is due to this exception: *** Assertion failure in BOOL _screenBasedFocusUnsupported(void)(), UIScreen.m:3.725 Accessing the focus system through UIScreen is no longer supported. ( 0 CoreFoundation 0x000000018bea31c0 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018b91e91c objc_exception_throw + 88 2 Foundation 0x000000018e092644 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0 3 UIKitCore 0x00000001c5dae8ec _screenBasedFocusUnsupported + 272 4 UIKitCore 0x00000001c5dae960 -[UIScreen _preferredFocusedWindow] + 24 5 UIKitCore 0x00000001c4ea3a60 -[UIScreen _mainSceneReferenceBounds] + 200 6 UIKitCore 0x00000001c4ea3914 -[UIScreen _mainSceneBoundsForInterfaceOrientation:] + 40 7 UIKitCore 0x00000001c5708134 +[UINavigationBar defaultSizeForOrientation:] + 76 8 UIKitCore 0x00000001c6222c88 -[_UISearchPresentationController _layoutPresentationWithSize:transitionCoordinator:] + 704 9 UIKitCore 0x00000001c622296c -[_UISearchPresentationController containerViewWillLayoutSubviews] + 84 10 UIKitCore 0x00000001c549304c block_destroy_helper.13 + 25112 11 UIKitCore 0x00000001c549344c block_destroy_helper.13 + 26136 12 UIKitCore 0x00000001c4ea26a8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1648 13 QuartzCore 0x0000000196103dbc _ZN2CA5Layer15perform_update_EPS0_P7CALayerjNS_17LayerUpdateReasonEPNS_11TransactionE + 460 14 QuartzCore 0x000000019610390c _ZN2CA5Layer17update_if_needed_EPNS_11TransactionENS_17LayerUpdateReasonE + 692 15 QuartzCore 0x0000000196035d2c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 608 16 QuartzCore 0x0000000195e69520 _ZN2CA11Transaction6commitEv + 652 17 AppKit 0x0000000190fe116c __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.7 + 44 18 CoreFoundation 0x000000018be34ad0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 19 CoreFoundation 0x000000018be34a10 __CFRunLoopDoBlocks + 396 20 CoreFoundation 0x000000018be33e54 __CFRunLoopRun + 2356 21 CoreFoundation 0x000000018bf06234 _CFRunLoopRunSpecificWithOptions + 532 22 HIToolbox 0x0000000198c1f560 RunCurrentEventLoopInMode + 320 23 HIToolbox 0x0000000198c228bc ReceiveNextEventCommon + 488 24 HIToolbox 0x0000000198dac14c _BlockUntilNextEventMatchingListInMode + 48 25 AppKit 0x00000001909163d0 _DPSBlockUntilNextEventMatchingListInMode + 228 26 AppKit 0x000000019026a084 _DPSNextEvent + 576 27 AppKit 0x0000000190dff96c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 28 AppKit 0x0000000190dff678 -[NSApplication(NSEventRouting) nextEventMatchingMask:untilDate:inMode:dequeue:] + 72 29 AppKit 0x000000019025d13c -[NSApplication run] + 368 30 AppKit 0x00000001902357b0 NSApplicationMain + 880 31 AppKit 0x000000019047c958 +[NSWindow _savedFrameFromString:] + 0 32 UIKitMacHelper 0x00000001aa2651bc UINSApplicationMain + 972 33 UIKitCore 0x00000001c4e1aed4 UIApplicationMain + 144 34 UIKitCore 0x00000001c548bda0 block_destroy_helper.31 + 8880 35 DigitalConcertHall.debug.dylib 0x0000000106e41bd8 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 128 36 DigitalConcertHall.debug.dylib 0x0000000106e41b4c $s18DigitalConcertHall11AppDelegateC5$mainyyFZ + 32 37 DigitalConcertHall.debug.dylib 0x0000000106e4afc0 __debug_main_executable_dylib_entry_point + 28 38 dyld 0x000000018b9ac4e4 start + 6992 ) I could not test with the iOS 27 beta 4 SDK due to this blocking issue: https://developer.apple.com/forums/thread/839012 However, when I tried to set up a simple sample project, I could not reproduce the issue. Does anybody know what might be causing this? I filed feedback FB24201508
8
2
2.1k
3d
How to disable a custom detent in a UISheetPresentationController
If you are creating a UISheetPresentationController with custom detents and you have a need to disable one of the detents, then you can do so by returning a special value from the detent's resolver. This is addressed in the Objective-C documentation for customDetentWithIdentifier:resolver:. You return the special value UISheetPresentationControllerDetentInactive. For example: UISheetPresentationControllerDetent *customDetent = [UISheetPresentationControllerDetent customDetentWithIdentifier:@"customId" resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> _Nonnull context) { if (some condition) { return UISheetPresentationControllerDetentInactive; } else { return context.maximumDetentValue / 3.0; } }];However, if you wish to do this in Swift, there is no corresponding API for UISheetPresentationControllerDetentInactive. It turns out that you can just use .greatestFiniteMagnitude instead. For example: let customDetent = UISheetPresentationController.Detent.custom(identifier: .init("customId")) { context in if some condition { return .greatestFiniteMagnitude //UISheetPresentationControllerDetentInactive } else { return context.maximumDetentValue / 3.0 } }It might be tempting to add the following: extension UISheetPresentationController.Detent { static let Inactive = CGFloat.greatestFiniteMagnitude }but this could cause a conflict if Apple adds a similar API in the future. This oversight in the Swift API has been reported as FB25567661.
1
0
122
1w
App launched in the background by liveactivitiesd when a Live Activity reaches its scheduled end
What we're doing During time-limited sales, our app shows a countdown Live Activity on the Lock Screen. It's started locally when the user opens the app (no push, no pushType, no push tokens), and its end is scheduled for the sale's start/end time: let activity = try Activity<SaleAttributes>.request(attributes: attributes, contentState: .init()) await activity.end(using: .init(), dismissalPolicy: .after(saleEndDate))The sale time is the same for every user, so the Live Activity ends at the same second on every device. What we expected At saleEndDate, the system removes the Live Activity from the Lock Screen, and nothing else happens. What actually happens If the app isn't running at that moment (the user left it earlier and didn't swipe it away), the system removes the Live Activity and then launches our app in the background: 01:18:59.995 SpringBoard [BundleID: com.example.app] finished, removing from the list... 01:19:00.019 liveactivitiesd Sending request to open "com.example.app" 01:19:00.023 SpringBoard Received trusted open application request … from <… com.apple.liveactivitiesd …> 01:19:00.069 SpringBoard Bootstrapping app<com.example.app> with intent backgroundThe app receives a normal application(_:didFinishLaunchingWithOptions:) with applicationState == .background and empty launchOptions. No other app delegate callback follows. Our app can't tell this apart from any other launch, so it runs its full startup: it builds the home screen and calls our backend APIs. Because this happens on a large number of devices in the same second, our backend gets a sharp burst of traffic exactly at sale start and sale end, from users who never opened the app. What we've checked App still running in the background at the end time: no new launch. App swiped away by the user before the end time: no launch. Live Activity removed by the user before the end time: no launch at the end time. Steps to reproduce Open the app; it starts a Live Activity with its end scheduled 15 minutes ahead. Leave the app with the Home gesture (don't swipe it away) and lock the device. Wait until the system terminates the app process. At the scheduled end time, the Live Activity is removed and the app is launched in the background (log above). Environment iPhone 15, iOS 26.6 (23G71) UIKit app, UIApplicationDelegate lifecycle (no scenes) NSSupportsLiveActivities = YES; UIBackgroundModes = [processing, remote-notification] Questions Why does the system launch the app when a Live Activity reaches its scheduled end? Is this intended? Can we avoid it? Is there a supported way to end a Live Activity at a scheduled time without the system launching the app? If not, how should we handle it? Is there a way to know at launch that it was caused by the Live Activity ending, or what's the recommended way to avoid running the full startup (UI and network calls) for this launch?
0
0
85
1w
Launch screen not refreshed after app update: is clearing Library/SplashBoard supported?
We're adding an option to our Unity SDK that gives a game a native launch screen: a launch storyboard (set through UILaunchStoryboardName) showing a full-screen image from an asset catalog. What we see On a clean install, the new launch screen shows as expected. When the same device installs an update over the existing app (tested through TestFlight), the previous launch screen keeps showing. Launching the app several times does not change it. Deleting the app, restarting the device and reinstalling shows the new launch screen straight away. We checked the build itself: the compiled storyboard, the image in Assets.car and the Info.plist keys are all correct, so this looks like the system's launch screen snapshot cache. We assume App Store updates behave the same way. What we're considering On the first launch after an update, the app would delete the cached launch screen snapshots in its own container (Library/SplashBoard), so the system regenerates them and the new launch screen shows on the next launch. This only uses public file APIs inside the app's own sandbox. But Library/SplashBoard is not documented anywhere, so we'd rather ask before shipping it. Questions Is deleting Library/SplashBoard from the app's own container a supported or acceptable practice, or could it cause problems (with the system, or in a future iOS version)? Is there a supported way to make iOS refresh a cached launch screen after an app update? If not, is the expected behaviour simply that the system refreshes the snapshot at some point? Is it documented when that happens (for example after a reboot, or after a certain time)? If clearing the folder isn't recommended, we won't ship it. Updating players would just keep the old launch screen until iOS refreshes it. Thanks!
1
0
297
1w
FileManager.default.contentsOfDirectory fails with SMB
Hi, I am trying to list the contents of a directory selected by the user using the following code: let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.folder]) documentPicker.delegate = self self.present(documentPicker, animated: true) func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {         guard let folderUrl = urls.first else {return} let startAccessing&#9;= folderUrl.startAccessingSecurityScopedResource()         guard startAccessing else { print("ERROR")             return         }         defer {             if startAccessing {                 folderUrl.stopAccessingSecurityScopedResource()             }         }         var error : NSError? = nil         NSFileCoordinator().coordinate(readingItemAt: folderUrl, error: &error) { (url) in             let startAccessing = url.startAccessingSecurityScopedResource()             guard startAccessing else {                 print("ERROR 2")                 return             }             defer {                 if startAccessing { folderUrl.stopAccessingSecurityScopedResource()                 }             }                          do {                 let files = try FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: [.nameKey])                 print(files)             } catch let filesError {                 print(filesError)             }         }     } This works for iCloud and for local files. It also, curiously, works on empty folders on the SMB server (though, obviously, it returns an empty array). However, for SMB folders with contents I get the following cryptic error message. Error Domain=NSCocoaErrorDomain Code=256 "The file “downloads” couldn’t be opened." UserInfo={NSURL=file:///private/var/mobile/Library/LiveFiles/com.apple.filesystems.smbclientd/Gabgugfiles/downloads, NSFilePath=/private/var/mobile/Library/LiveFiles/com.apple.filesystems.smbclientd/Gabgugfiles/downloads, NSUnderlyingError=0x28010b0c0 {Error Domain=NSPOSIXErrorDomain Code=10006 "Unknown error: 10006"}} In addition, modifying the code slightly so the user picks an image instead works just fine too. I can load the image from the supplied URL. I have read the documentation here - https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories and watched the WWDC 2019 presentation, What's New in File Management and Quicklook, where this was introduced but this hasn't turned up any answers. My app is set up with Supports Document Browser. Is there something I'm doing wrong? The way this is described what I'm trying to do, get a list of files and act on each of them, is exactly what this is intended for yet it's not working.
12
0
3.5k
1w
HiraginoSans-W4/W5 availability diverges between iOS 16.5.1 and iOS 18.0.1: UIFont(name:) returns nil, XIB labels fall back to Helvetica
Background Our app previously bundled ヒラギノ角ゴシック W4.ttc and W5.ttc via UIAppFonts. App Store review flagged them under ITMS-91198 as Apple-provided fonts. We removed the bundled .ttc files and need to verify the runtime font-resolution behavior before shipping. Case C below shows the original state (with .ttc present) for comparison. Environment Same app, same code, same XIB, physical devices only. Tested OS: iOS 16.5.1 (two builds: with and without bundled .ttc) and iOS 18.0.1 (without bundled .ttc). Xcode 16.x. How to read the logs Each log has three sections: SYSTEM HIRAGINO SANS — UIFont.fontNames(forFamilyName: "Hiragino Sans"), i.e. what the OS itself provides. RAW UIFont(name:) — UIFont(name: "HiraginoSans-W4", size: 16) etc. This is the code path our App.Font wrapper uses. XIB LABEL RESOLVED — four UILabels whose XIB fontDescription specifies HiraginoSans-W3/W4/W5/W6 respectively. resolved= is label.font.fontName at runtime. Case A — iOS 18.0.1, physical device, bundled .ttc removed ===== ENV ===== systemVersion : 18.0.1 target : Physical Device ===== SYSTEM HIRAGINO SANS ===== HiraginoSans-W3 HiraginoSans-W4 HiraginoSans-W5 HiraginoSans-W6 HiraginoSans-W7 HiraginoSans-W8 ===== RAW UIFont(name:) ===== HiraginoSans-W3 OK family=Hiragino Sans HiraginoSans-W4 OK family=Hiragino Sans HiraginoSans-W5 OK family=Hiragino Sans HiraginoSans-W6 OK family=Hiragino Sans ===== XIB LABEL RESOLVED ===== W3Lab xib=HiraginoSans-W3 resolved=HiraginoSans-W3 family=Hiragino Sans W4Lab xib=HiraginoSans-W4 resolved=HiraginoSans-W4 family=Hiragino Sans W5Lab xib=HiraginoSans-W5 resolved=HiraginoSans-W5 family=Hiragino Sans W6Lab xib=HiraginoSans-W6 resolved=HiraginoSans-W6 family=Hiragino Sans ===== END =====Case B — iOS 16.5.1, physical device, bundled .ttc removed ===== ENV ===== systemVersion : 16.5.1 target : Physical Device ===== SYSTEM HIRAGINO SANS ===== HiraginoSans-W3 HiraginoSans-W6 HiraginoSans-W7 ===== RAW UIFont(name:) ===== HiraginoSans-W3 OK family=Hiragino Sans HiraginoSans-W4 nil HiraginoSans-W5 nil HiraginoSans-W6 OK family=Hiragino Sans ===== XIB LABEL RESOLVED ===== W3Lab xib=HiraginoSans-W3 resolved=HiraginoSans-W3 family=Hiragino Sans W4Lab xib=HiraginoSans-W4 resolved=Helvetica family=Helvetica W5Lab xib=HiraginoSans-W5 resolved=Helvetica family=Helvetica W6Lab xib=HiraginoSans-W6 resolved=HiraginoSans-W6 family=Hiragino Sans ===== END =====Case C — iOS 16.5.1, physical device, bundled .ttc present (original state) ===== ENV ===== systemVersion : 16.5.1 target : Physical Device ===== SYSTEM HIRAGINO SANS ===== HiraginoSans-W3 HiraginoSans-W4 HiraginoSans-W5 HiraginoSans-W6 HiraginoSans-W7 ===== RAW UIFont(name:) ===== HiraginoSans-W3 OK family=Hiragino Sans HiraginoSans-W4 OK family=Hiragino Sans HiraginoSans-W5 OK family=Hiragino Sans HiraginoSans-W6 OK family=Hiragino Sans ===== XIB LABEL RESOLVED ===== W3Lab xib=HiraginoSans-W3 resolved=HiraginoSans-W3 family=Hiragino Sans W4Lab xib=HiraginoSans-W4 resolved=HiraginoSans-W4 family=Hiragino Sans W5Lab xib=HiraginoSans-W5 resolved=HiraginoSans-W5 family=Hiragino Sans W6Lab xib=HiraginoSans-W6 resolved=HiraginoSans-W6 family=Hiragino Sans ===== END =====Observations Comparing B and C (same OS, only .ttc presence differs): removing the bundled .ttc removes HiraginoSans-W4/W5 from the system font list, makes UIFont(name:) return nil for them, and makes XIB labels naming them fall back to Helvetica — not SF, not the nearest weight in the same family. Comparing B and A (same .ttc state, only OS differs): iOS 18.0.1 ships HiraginoSans-W3–W8 in the system, so removing the bundled .ttc has no effect there. Question 1 — System font inventory by OS version Is there an official, versioned list of system-provided fonts (PostScript names) per iOS release? We need to determine which Hiragino Sans weights are available on a given OS at runtime, without hard-coding assumptions. Our observations show that iOS 16.5.1 does not provide HiraginoSans-W4/W5 in the system font set, while iOS 18.0.1 provides W3–W8. If no per-version official list exists, is UIFont.familyNames / UIFont.fontNames(forFamilyName:) the recommended runtime enumeration method? Or is there a documented recommendation to avoid relying on specific PostScript names across OS versions? Question 2 — XIB fontDescription fallback rule When a UILabel's XIB fontDescription specifies a font PostScript name that is not available at runtime (e.g. HiraginoSans-W4 on iOS 16.5.1 after removing the bundled .ttc), we observe UIKit falls back to Helvetica — not SF, not the nearest available weight in the same family. Is this fallback rule documented? Is it stable across iOS versions, or should we treat the fallback target as unspecified? If the fallback target cannot be relied upon, what is the recommended approach for XIB-based layouts that must not render with an unexpected font? Must every such label be re-assigned in code after awakeFromNib / viewDidLoad? Or is there a supported way to declare a fallback chain in Interface Builder?
0
0
71
1w
Persistent scroll stutter on iPhone 17 Pro Max, 18 Pro Max and 18 Pro (iOS 27.2), also on Apple Store demo units
Affected devices (all show the same problem): 1x iPhone 17 Pro Max 2x iPhone 18 Pro Max 1x iPhone 18 Pro Many demo iPhones at several Apple Stores Current iOS version: 27.2 Issue: Vertical scrolling inside apps frequently stutters and drops frames. It happens in many, many apps, including Apple's own App Store and Apple Store apps. During a normal flick-and-decelerate scroll, the content repeatedly freezes for one or more frames and then jumps forward. Because this reproduces on four of my own devices and on many Apple Store demo units, I believe it is a widespread, system-level issue, not a defect of a single device or my settings. Impact: I have been living with this for more than six months. I use my iPhone heavily every day, and the constant stutter has made using it genuinely distressing. Everything else about iPhone feels excellent, which makes this problem even harder to accept. Steps to reproduce: Open the App Store app (or almost any app with a scrolling list). Scroll with a normal flick and let it decelerate. Observe repeated hitches during the scroll. Measurements: I filmed the screen with a second iPhone at 4K 120 fps and measured content movement frame by frame: iPhone 18 Pro Max, third-party video feed: about 4 hitches per second of scrolling, about 4% of frames dropped, mostly single-frame drops. iPhone 18 Pro Max, third-party social app list: about 11 hitches per second, about 12% of frames dropped, at a regular rhythm every 6-8 frames. About a third of the stalls last 2-3 frames, and the content does not catch up afterwards. iPhone 17 Pro Max, third-party comment list: about 5 hitches per second, about 8% of frames dropped, including several full freezes of 50-75 ms. Expected: Smooth 120 Hz scrolling, as ProMotion is designed to deliver. Is Apple aware of this issue? I am happy to provide videos, frame-by-frame data, or sysdiagnose logs.
3
1
354
1w
IOS 27 getting false response from isInterfaceOrientationLocked when autorotate is on
I have an app almost ready to submit for distribution. It is a game with a fixed background view and a token that moves around on the fixed background. The token is moved by tilting the iPhone/iPad which is translated to movement based on CMMotionManager as roll and pitch readings. This simulates a flat level playing field with gravity pulling the token when the device is tipped. The app works well only when the user has set the device to have Autorotate locked. The following code lets me sample the status of Autorate: guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return } print("Orientation locked: ", windowScene.effectiveGeometry.isInterfaceOrientationLocked) The problem is that I always get a reading of false regardless of whether Autorotate is locked or not. Can anyone help me understand. Is this the wrong approach for getting this information? If so, how is this achieved? Thanks for your attention to this, Mike Ricker
0
0
145
2w
Public API for the iPhone Duo inner-display glow in tent mode
Feature request: Public API for the iPhone Duo inner-display glow in tent mode I’d like a public API for the colored glow that the StandBy alarm casts onto the table in tent mode. It’s a subtle detail that would work well in other apps. The outer display could keep showing the app while the inner glow picks up a color from album artwork or shifts as a timer counts down. The private UIKitCore methods +[_UISceneCompanion _alarmGlowContent] and +[_UISceneCompanion _highlightCompanionWithColor:] point to the effect I mean. SpringBoard also defines SBCompanionScenePresentationModeInnerDisplayStandbyAlarmGlow. In SwiftUI, I could imagine using it like this: .sceneAccessory { InnerDisplayGlowAccessory(color: glowColor) }An optional intensity parameter would be nice, too. That would let apps keep the glow faint during playback or brighten it briefly when something changes, within brightness limits set by iOS.
Replies
0
Boosts
0
Views
30
Activity
3h
Mac Catalyst: disabled SwiftUI toolbar buttons turn into pills and don’t update their state
Hi everyone, we’ve been fighting with disabled toolbar buttons in our Mac Catalyst app and wanted to check whether others are seeing the same thing, or whether we’re missing something. Our toolbar lives in a SwiftUI NavigationStack, so Catalyst bridges it into the window’s NSToolbar. Enabled buttons look and work great: native buttons with a round 36 × 36 pt glass. But as soon as a button uses .disabled(_:), things fall apart: It turns into a wider pill. A button that is disabled when it appears becomes an image item instead of a button (NSToolbarImageView with a UIImage), and its glass grows to 47 × 36 pt. Its state doesn’t update. Toggling .disabled(_:) doesn’t reach the existing toolbar item. It only changes if we give the ToolbarItem a new id, which then brings back the pill. Disabling the NSToolbarItem ourselves doesn’t stick. UIKit revalidates the toolbar whenever any item changes, and copies the bar button’s enabled state back over ours. Drawing our own image to fix the shape crashed AppKit (“Unable to install constraint on view”) as soon as the item switched back to enabled. For now we keep the SwiftUI button enabled on the Mac and disable the native NSToolbarItem ourselves. We find the toolbar via NSToolbar.willAddItemNotification and use KVO to put the state back whenever UIKit overrides it. It works, but it feels like it shouldn’t be necessary. Here’s a minimal example: struct ContentView: View { @State private var canUndo = false var body: some View { NavigationStack { Button("Toggle") { canUndo.toggle() } .toolbar { ToolbarItem(placement: .topBarLeading) { Button("Undo", systemImage: "arrow.uturn.backward") {} .labelStyle(.iconOnly) .disabled(!canUndo) } } } } }Seen on macOS 27.2 and 26.7.1, Xcode 27.2. Filed as FB25597608. Is there a supported way to get a disabled toolbar button that stays a normal native button? Any hints are very welcome. Thanks!
Replies
0
Boosts
0
Views
38
Activity
17h
Can an iOS Custom Keyboard Legally Launch Its Containing App for a User-Initiated Speech Recording?
I’m developing an iOS application with a custom keyboard extension and a companion app. Our intended user experience: The user is typing in an app such as WhatsApp using our custom keyboard. They tap the Speech button. Our companion app opens automatically. The companion app establishes a microphone session. iOS returns the user to the original host app. The user continues dictating through the keyboard. What we have already implemented: A Swift-based custom keyboard and companion app. App Groups and Darwin notifications for communication between the two targets. Microphone recording through the companion app. Apple Speech Recognition with on-device recognition. A warm background audio session. Subsequent recordings and text insertion work on a physical iPhone once the warm session is established. Our current blocker: The keyboard extension cannot successfully open its companion app when the warm session is inactive. We previously tried NSExtensionContext.open(), but it did not work. We want to avoid private APIs, responder-chain workarounds, and anything that could violate App Store Review Guidelines. My questions: Does Apple provide any officially supported public API that allows a custom keyboard extension to launch its containing app in response to an explicit user tap? Can App Intents or ForegroundContinuableIntent legitimately achieve this from a keyboard extension? Does App Review Guideline 4.4.1 prohibit this particular user-initiated handoff? If direct launching is prohibited, what Apple-supported architecture or interaction pattern would you recommend for this use case? Is there a supported way for the companion app to return the user to the original host app after establishing the microphone session? We are looking for guidance based on actual iOS platform restrictions and supported APIs, preferably from developers who have shipped custom keyboard applications. Thank you.
Replies
1
Boosts
0
Views
38
Activity
19h
No lifecycle notification when entering App Switcher while app remains inactive after Face ID
We use LAContext.evaluatePolicy(.deviceOwnerAuthentication) for a local app lock. On an iPhone 16 Pro running iOS 26.6.2, after authentication succeeds, UIApplication.shared.applicationState can remain .inactive for approximately 2–8 seconds although the app UI is visible. If the user enters the App Switcher during this interval, the app receives no additional willResignActive or didEnterBackground notification. Returning to the app produces only didBecomeActive. This means the app cannot distinguish between: remaining in the app while the Face ID UI finishes dismissing; and entering the App Switcher and returning during the same inactive interval. Reproduction: Run a minimal UIKit app on a physical Face ID device. Call evaluatePolicy(.deviceOwnerAuthentication). Immediately after successful authentication, enter the App Switcher before didBecomeActive. Wait three seconds and return. Is there a supported public API or lifecycle pattern that lets an app lock immediately in this situation without keeping its content covered until didBecomeActive?
Replies
1
Boosts
0
Views
37
Activity
20h
State Restoration no longer works in a Mac Catalyst based app when run on macOS 27.x
As reported in FB25363417: A UIKit based app running on macOS 27.2 (or macOS 27.0.1) via Mac Catalyst no longer has functioning state restoration. Upon app restart, there is no NSUserActivity being provided to the scene in the UISceneDelegate method scene(_:willConnectTo:options:). This can be tested with Apple’s own sample app “Restoring your app’s state”. Just update the sample project with support for a Mac Catalyst build. Using Xcode 27.2 on a Mac with macOS 27.0 or 27.2, build and run the Mac Catalyst version of the app. The main screen appears with a list of products. Select any product so you see details of the product. Quit the app. Run the app again. Note that you are not returned to the previously selected product detail screen. Instead, you just see the main list of products. If you run the same app and perform the same steps on a Mac running macOS 26.x, then when the app is restarted, you correctly get returned to the previously selected product detail screen. The problem is being caused by no NSUserActivity being passed into the scene delegate on app startup. While running the app on a Mac with macOS 27.x, put a breakpoint on the initial guard statement in scene(_:willConnectTo:options:) and you will see there is no activity on app restart. This is impacting paid customers of my existing app since upgrading to macOS 27. They no longer get returned to the app’s previous state when restarting the app. It is expected that state restoration should work on macOS 27 just as well as it does under macOS 26 in an app built with Mac Catalyst.
Replies
1
Boosts
0
Views
158
Activity
1d
iPhone Duo vertical bar: system back button ignores custom back indicator image (UINavigationBarAppearance.setBackIndicatorImage)
On iPhone Duo (iOS 27.1), when UIKit moves a navigation controller's system back button into the vertical bar, the button always shows the system chevron. Every public API for customizing the back indicator image is ignored there, although the same configuration is honored in the horizontal (top) navigation bar. APIs tested (each one alone, on the second view controller of a UINavigationController stack, with no leftBarButtonItem): A. Nothing set (default). B. UINavigationBar.standardAppearance set to a UINavigationBarAppearance on which setBackIndicatorImage(_:transitionMaskImage:) was called. C. Same appearance assigned to all four UINavigationBar properties: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. D. Same appearance assigned to all four UINavigationItem properties of the pushed view controller: standardAppearance, compactAppearance, scrollEdgeAppearance, compactScrollEdgeAppearance. E. Legacy UINavigationBar.backIndicatorImage and UINavigationBar.backIndicatorTransitionMaskImage, with no appearance objects set. F. UINavigationBar.appearance() proxy: all four appearance properties, set before the navigation controller is created. G. UINavigationItem.backBarButtonItem of the previous view controller set to UIBarButtonItem(image:style:target:action:). H. Control: UINavigationItem.leftBarButtonItem set to UIBarButtonItem(image:style:target:action:) with the same image (axisBehavior left at .automatic). The marker image is UIImage(systemName: "arrow.uturn.backward"), so it cannot be mistaken for the system chevron. Results: Top navigation bar (iPhone 17 Pro iOS 27.0, and iPhone Duo open with portrait UI): B, C, D, E and F show the custom image. G shows the chevron followed by the image. Vertical bar (iPhone Duo closed; iPhone Duo open with landscape UI; also inside a UITabBarController with the tab bar hidden or visible): A through G all show the system chevron. Only H shows the custom image. At viewDidAppear, the app confirms that the configuration is in place: navigationBar.standardAppearance.backIndicatorImage is the marker image (B, C), navigationItem.standardAppearance is non-nil (D), and traitCollection.verticalBarEdge is .trailing. This contradicts the guidance given by an Apple Technology Evangelist in https://developer.apple.com/forums/thread/847875: "If you are only replacing the icon on the back button, you could use set the backIndicatorImage and maintain default system behavior. This would be the recommended approach." As things stand, the only way to show a custom back icon in the vertical bar is to replace the system back button with a leading item. That loses the system behavior that comes with it: UINavigationController.interactivePopGestureRecognizer, interactiveContentPopGestureRecognizer and the back-history menu.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
2
Boosts
3
Views
547
Activity
1d
UITableView row reordering no longer works under macOS 27 with Mac Catalyst
Under macOS 27 using Mac Catalyst for a UIKit-based app, If you present a view controller with a table view as a form sheet or page sheet, row reordering fails to function. You can drag a row as expected but the blue movement bar never appears and if you drop the row it simply returns to its original location. The exact same view controller presented as a popover works just fine. The exact same view controller not presented as a modal (such as the app's root controller) works just fine. This is a serious bug affecting existing applications and being reported by paying customers. This has been reported as FB25038883 which includes a simple sample app demonstrating the issue.
Replies
4
Boosts
1
Views
568
Activity
1d
iPhone Duo Unfolded Safe Areas
Hi, my app is currently built on Xcode 27.1 I am working on upgrading to Xcode 27.2 We have a regression issue whereby, the top safeArea is 82 despite the vertical bar being opted in and active. This only happens on unfolded landscape. Our right safeArea is 0 for the window and is 84 for the view safeArea. Both window and view safeAreas have the top safe area of 82 though. We would like to know what could be the cause behind the top safeArea being activated. Note: this is not an issue for iOS 27.1
Replies
2
Boosts
0
Views
198
Activity
2d
SwiftUI Architecture Guide
Application Types Applications are divided into Document-based and Library-based. A document-based application stores user data in individual, standalone files. Users manually name and organize those files in a local system or synced cloud storage such as iCloud. The software typically opens multiple windows for different projects. This framing is for standalone, complex files that need to be shared, exported, or handled independently. A library-based application manages data in one unified, central repository, locally or through remote cloud databases. Spotify, Netflix, and Notion are the examples shown. The file system is hidden; updates are saved automatically in real time; and a single window supports browsing, search, and access to the synchronized data collection from any device. Model Types Four model types: Data, Domain, Application, and Presentation. Apple Platforms In Apple MVC (AppKit / UIKit), the model branches to Data, Domain, and Presentation. In SwiftUI, Model branches to Data and Domain. Project Structure SwiftUI App Folders Swift Package Folders App Modularization Not every module in a large application needs to be extracted into a separate framework or Swift Package. Logical modularization can also be achieved through a well-organized folder structure within the main project. Introduce separate packages or frameworks only when there is a clear benefit, such as independent reuse, distribution, build isolation or ownership. Avoid unnecessary project and dependency management overhead. State Management & Data Flow Source of truth is “a key concept in SwiftUI”: a single place to store a piece of data, with everywhere else reading the same piece of data. Environment is SwiftUI’s native dependency-injection mechanism. It allows shared dependencies, domain models, and services to be injected at the appropriate view-hierarchy level and accessed where needed without explicit parameter passing or unnecessary coupling. It is described as a tool for managing dependencies and sharing state across the view hierarchy. Domain Model Ownership Domain Models should be owned by the highest relevant SwiftUI view in the hierarchy that defines their context and lifecycle. NavigationStack owns the Domain Models for its navigation context and makes them available to descendant views through @Environment. When a NavigationStack is embedded in a TabView or NavigationSplitView, ownership moves up to the TabView or NavigationSplitView so the models can be shared across tabs or split views. The stated result is clear ownership scope, sharing where needed, and isolation between independent navigation contexts. Previews & UI Testing Environment injection makes SwiftUI Previews and UI Tests easier to configure by allowing real Domain Models to be replaced with mock or dummy instances. Views can be tested independently with controlled data and predictable states, without requiring real services, network requests, or application setup. Domain and Data Model Examples For a library-based app with remote data. Additional Domain Model Examples E-commerce Catalog, ShoppingCart, OrderHistory, Wishlist Banking MyAccounts, MyCards, MyTransactions, MyInvestments Social Network Feed, Conversations, Notifications, Friends Healthcare MyAppointments, MedicalHistory, Prescriptions, MyHealth Education Courses, MyCourses, Assignments, MyGrades, LearningProgress Real Estate PropertyCatalog, MyProperties, Favorites, Appointments Hotel Booking Destinations, Search, MyBookings, TravelHistory Food Delivery RestaurantCatalog, ShoppingCart, MyOrders, DeliveryTracking Project Management Projects, MyTasks, TeamMembers, Notifications Insurance MyPolicies, MyClaims, Coverage, Documents Smart Home MyHomes, Devices, Automations, EnergyUsage Fitness MyPlans, MyProgress, MyGoals, WorkoutHistory Other Search, Dashboard, Favorites, Notifications, Settings, ActivityHistory, Recommendations, Subscription, DocumentLibrary ViewModel? - MVVM In SwiftUI, the View encapsulates the UI content (body), its state (properties), and its actions or tasks (functions). This is possible because SwiftUI is designed around a declarative, state-driven UI model. In Android and .NET platforms, a separate ViewModel is typically required to hold and manage the View's state. Projects that intoduce ViewModels in SwiftUI add unnecessary architectural complexity, boilerplate, and code duplication; synchronization issues; unclear state ownership; additional lifecycle management; more abstractions; harder debugging; and increased maintenance, without meaningful benefits over SwiftUI's native state management. In UIKit, introducing a separate ViewModel layer is often unnecessary, as UIViewController already serves as the presentation model, handling presentation logic and coordinating the view. Non-UI responsibilities can be delegated to dedicated ModelControllers or Managers, avoiding unnecessary layers and abstractions. Domain Models vs. ViewModels Domain Models are view-independent, while ViewModels are view-dependent. A ViewModel is tightly coupled to the structure, state, and lifecycle of a specific View. Whenever the View code changes, its ViewModel often requires corresponding coding changes, and vice versa, creating additional maintenance and synchronization overhead. Domain Models, on the other hand, represent application context and business functionality independently of the UI. This separation preserves UI independence and allows the same Domain Models to be shared across different screens and platforms, such as iPhone, iPhone Duo, iPad, and macOS, without duplicating or adapting business logic for each View. This makes Domain Models a more scalable and maintainable approach for modern SwiftUI applications, particularly those targeting multiple screen sizes and platforms.
Replies
1
Boosts
0
Views
260
Activity
2d
A bug in iOS 27.3 beta 2 where the UIHingeInteraction value is received even though it is not an iPhone Duo device.
The device currently showing the symptom is iPhone SE3, iOS 27.3 Beta 2 version installed. (Same symptom exists in Beta 1 as well.) On screen A When switching to another ViewController (screen B) with pushViewController of UINavigationController Declare UIHingeInteraction on screen A and self.view.addInteraction(hInteraction) I added it like the code above. Hinge value comes in. In the sample code below update.hinge value is not nil The update.hinge!.angle value is also displayed as 0. let hInteraction:UIHingeInteraction = UIHingeInteraction { interaction, update in if update.hinge != nil { let hingeAngle:CGFloat = update.hinge!.angle..... }} In apps installed on other iPhone 17 devices (with iOS 27.2 installed), the value does not appear there. A quick fix is ​​needed. I have also submitted a report via Apple Feedback; please ensure this is addressed in the upcoming Beta 3 release. *** Plus *** The horizontalSizeClass and verticalSizeClass properties are returning "Regular" values, similar to how they behave on the iPhone Duo's internal display. Please fix the above issue as well.
Replies
0
Boosts
0
Views
105
Activity
2d
Camera preview rotated 90 degrees on initial presentation on iPadOS 27.2.1, corrected after returning from Control Center
Dear Apple Support Team, We are investigating a camera preview orientation issue on an iPad and would appreciate guidance on the relevant UIKit and AVFoundation behavior. Our app uses Flutter and the third-party Regula Document Reader SDK for passport MRZ scanning. We understand that third-party SDK internals are outside Apple’s support scope. Our question concerns the relationship between the active interface orientation, presentation lifecycle, and camera preview connection orientation. Environment Device: iPad (A16), hardware identifier iPad15,7 iPadOS: 27.2.1, as reported by the device and diagnostic export App distribution: TestFlight App version in the diagnostic log: 2.0.14, build 7 Flutter plugin: flutter_document_reader_api 9.8.1718 Runtime Regula SDK API version: 9.8.6944 Runtime Regula SDK Core version: 9.8.20492 Steps to reproduce Hold the affected iPad in landscape orientation and open the app. Open the passport scanner. The scanner interface appears in landscape, but the camera image appears rotated by 90 degrees. Open Control Center, then dismiss it and return to the app. The preview can then appear in the correct orientation. Close and reopen the scanner; the issue may recur. Physically rotating the device does not consistently resolve the issue. Expected: The preview should match the current interface orientation from initial presentation. Actual: The preview initially has an orientation mismatch and may recover only after leaving and returning to the app. Diagnostic observations We collected initial-entry and app-resume observations within the same scanner session: Before scanner presentation, the active UIWindowScene.interfaceOrientation is landscapeRight. The SDK’s presenting view controller belongs to the active application window. The scanner controller has landscape dimensions of approximately 1180 × 820. The third-party SDK’s supported interface orientation is configured for landscape right. However, the initial preview connection reports videoOrientation = portrait and videoRotationAngle = 90. Updating supported interface orientations and requesting layout updates did not resolve the initial mismatch in this test. A subsequent app-resume observation reports videoOrientation = landscapeRight and videoRotationAngle = 0. This change is recorded before our app’s delayed layout refresh. We recognize that interface orientation and capture rotation are different concepts, and that connection metadata alone does not establish the displayed pixel orientation. We are providing these observations alongside the visible symptom rather than treating a particular angle as universally correct. Scope and investigation status Our separate QR scanner and receipt camera work normally on the same device. The passport scanner also works normally on many other iPads. We have not established that this affects all devices running this iPadOS version. An app-side orientation enum comparison issue was corrected before collecting the build 7 log, but the preview mismatch remained. We have not isolated the cause to iPadOS, our presentation code, or the SDK’s capture initialization. We do not yet have a focused standalone Xcode reproduction project. We are also preparing an inquiry to the SDK vendor. Questions Are there known circumstances in which a camera preview initially uses portrait orientation despite being presented in a landscape UIWindowScene? What is the recommended lifecycle point for determining the initial interface orientation and configuring the preview connection, particularly while presentation or rotation transitions are in progress? Which supported APIs should be used to keep preview rotation synchronized with interface changes on this iPadOS version? Could the recovery after dismissing Control Center indicate an initialization or lifecycle ordering issue? What additional observations would help distinguish these possibilities? What should we include in a minimal native reproduction or system diagnostic collection to make this issue actionable? We can provide a symptom video and an application diagnostic export. These were collected in separate tests on the same affected device and are not time-synchronized. The application export is not an Apple sysdiagnose. Thank you for any guidance on how to investigate this further. With Best Regards, GTF_Japan_Service
Replies
0
Boosts
0
Views
27
Activity
2d
iOS 27b3 SDK: iOS App on Mac crashes on UISearchBar focus
Our app crashes when compiled with the iOS 27 beta 3 SDK and run as an iOS app on Mac, on both macOS 26 and macOS 27, as soon as a UISearchBar receives focus. The crash is due to this exception: *** Assertion failure in BOOL _screenBasedFocusUnsupported(void)(), UIScreen.m:3.725 Accessing the focus system through UIScreen is no longer supported. ( 0 CoreFoundation 0x000000018bea31c0 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000018b91e91c objc_exception_throw + 88 2 Foundation 0x000000018e092644 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0 3 UIKitCore 0x00000001c5dae8ec _screenBasedFocusUnsupported + 272 4 UIKitCore 0x00000001c5dae960 -[UIScreen _preferredFocusedWindow] + 24 5 UIKitCore 0x00000001c4ea3a60 -[UIScreen _mainSceneReferenceBounds] + 200 6 UIKitCore 0x00000001c4ea3914 -[UIScreen _mainSceneBoundsForInterfaceOrientation:] + 40 7 UIKitCore 0x00000001c5708134 +[UINavigationBar defaultSizeForOrientation:] + 76 8 UIKitCore 0x00000001c6222c88 -[_UISearchPresentationController _layoutPresentationWithSize:transitionCoordinator:] + 704 9 UIKitCore 0x00000001c622296c -[_UISearchPresentationController containerViewWillLayoutSubviews] + 84 10 UIKitCore 0x00000001c549304c block_destroy_helper.13 + 25112 11 UIKitCore 0x00000001c549344c block_destroy_helper.13 + 26136 12 UIKitCore 0x00000001c4ea26a8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1648 13 QuartzCore 0x0000000196103dbc _ZN2CA5Layer15perform_update_EPS0_P7CALayerjNS_17LayerUpdateReasonEPNS_11TransactionE + 460 14 QuartzCore 0x000000019610390c _ZN2CA5Layer17update_if_needed_EPNS_11TransactionENS_17LayerUpdateReasonE + 692 15 QuartzCore 0x0000000196035d2c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 608 16 QuartzCore 0x0000000195e69520 _ZN2CA11Transaction6commitEv + 652 17 AppKit 0x0000000190fe116c __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.7 + 44 18 CoreFoundation 0x000000018be34ad0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 19 CoreFoundation 0x000000018be34a10 __CFRunLoopDoBlocks + 396 20 CoreFoundation 0x000000018be33e54 __CFRunLoopRun + 2356 21 CoreFoundation 0x000000018bf06234 _CFRunLoopRunSpecificWithOptions + 532 22 HIToolbox 0x0000000198c1f560 RunCurrentEventLoopInMode + 320 23 HIToolbox 0x0000000198c228bc ReceiveNextEventCommon + 488 24 HIToolbox 0x0000000198dac14c _BlockUntilNextEventMatchingListInMode + 48 25 AppKit 0x00000001909163d0 _DPSBlockUntilNextEventMatchingListInMode + 228 26 AppKit 0x000000019026a084 _DPSNextEvent + 576 27 AppKit 0x0000000190dff96c -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 28 AppKit 0x0000000190dff678 -[NSApplication(NSEventRouting) nextEventMatchingMask:untilDate:inMode:dequeue:] + 72 29 AppKit 0x000000019025d13c -[NSApplication run] + 368 30 AppKit 0x00000001902357b0 NSApplicationMain + 880 31 AppKit 0x000000019047c958 +[NSWindow _savedFrameFromString:] + 0 32 UIKitMacHelper 0x00000001aa2651bc UINSApplicationMain + 972 33 UIKitCore 0x00000001c4e1aed4 UIApplicationMain + 144 34 UIKitCore 0x00000001c548bda0 block_destroy_helper.31 + 8880 35 DigitalConcertHall.debug.dylib 0x0000000106e41bd8 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 128 36 DigitalConcertHall.debug.dylib 0x0000000106e41b4c $s18DigitalConcertHall11AppDelegateC5$mainyyFZ + 32 37 DigitalConcertHall.debug.dylib 0x0000000106e4afc0 __debug_main_executable_dylib_entry_point + 28 38 dyld 0x000000018b9ac4e4 start + 6992 ) I could not test with the iOS 27 beta 4 SDK due to this blocking issue: https://developer.apple.com/forums/thread/839012 However, when I tried to set up a simple sample project, I could not reproduce the issue. Does anybody know what might be causing this? I filed feedback FB24201508
Replies
8
Boosts
2
Views
2.1k
Activity
3d
How to disable a custom detent in a UISheetPresentationController
If you are creating a UISheetPresentationController with custom detents and you have a need to disable one of the detents, then you can do so by returning a special value from the detent's resolver. This is addressed in the Objective-C documentation for customDetentWithIdentifier:resolver:. You return the special value UISheetPresentationControllerDetentInactive. For example: UISheetPresentationControllerDetent *customDetent = [UISheetPresentationControllerDetent customDetentWithIdentifier:@"customId" resolver:^CGFloat(id<UISheetPresentationControllerDetentResolutionContext> _Nonnull context) { if (some condition) { return UISheetPresentationControllerDetentInactive; } else { return context.maximumDetentValue / 3.0; } }];However, if you wish to do this in Swift, there is no corresponding API for UISheetPresentationControllerDetentInactive. It turns out that you can just use .greatestFiniteMagnitude instead. For example: let customDetent = UISheetPresentationController.Detent.custom(identifier: .init("customId")) { context in if some condition { return .greatestFiniteMagnitude //UISheetPresentationControllerDetentInactive } else { return context.maximumDetentValue / 3.0 } }It might be tempting to add the following: extension UISheetPresentationController.Detent { static let Inactive = CGFloat.greatestFiniteMagnitude }but this could cause a conflict if Apple adds a similar API in the future. This oversight in the Swift API has been reported as FB25567661.
Replies
1
Boosts
0
Views
122
Activity
1w
App launched in the background by liveactivitiesd when a Live Activity reaches its scheduled end
What we're doing During time-limited sales, our app shows a countdown Live Activity on the Lock Screen. It's started locally when the user opens the app (no push, no pushType, no push tokens), and its end is scheduled for the sale's start/end time: let activity = try Activity<SaleAttributes>.request(attributes: attributes, contentState: .init()) await activity.end(using: .init(), dismissalPolicy: .after(saleEndDate))The sale time is the same for every user, so the Live Activity ends at the same second on every device. What we expected At saleEndDate, the system removes the Live Activity from the Lock Screen, and nothing else happens. What actually happens If the app isn't running at that moment (the user left it earlier and didn't swipe it away), the system removes the Live Activity and then launches our app in the background: 01:18:59.995 SpringBoard [BundleID: com.example.app] finished, removing from the list... 01:19:00.019 liveactivitiesd Sending request to open "com.example.app" 01:19:00.023 SpringBoard Received trusted open application request … from <… com.apple.liveactivitiesd …> 01:19:00.069 SpringBoard Bootstrapping app<com.example.app> with intent backgroundThe app receives a normal application(_:didFinishLaunchingWithOptions:) with applicationState == .background and empty launchOptions. No other app delegate callback follows. Our app can't tell this apart from any other launch, so it runs its full startup: it builds the home screen and calls our backend APIs. Because this happens on a large number of devices in the same second, our backend gets a sharp burst of traffic exactly at sale start and sale end, from users who never opened the app. What we've checked App still running in the background at the end time: no new launch. App swiped away by the user before the end time: no launch. Live Activity removed by the user before the end time: no launch at the end time. Steps to reproduce Open the app; it starts a Live Activity with its end scheduled 15 minutes ahead. Leave the app with the Home gesture (don't swipe it away) and lock the device. Wait until the system terminates the app process. At the scheduled end time, the Live Activity is removed and the app is launched in the background (log above). Environment iPhone 15, iOS 26.6 (23G71) UIKit app, UIApplicationDelegate lifecycle (no scenes) NSSupportsLiveActivities = YES; UIBackgroundModes = [processing, remote-notification] Questions Why does the system launch the app when a Live Activity reaches its scheduled end? Is this intended? Can we avoid it? Is there a supported way to end a Live Activity at a scheduled time without the system launching the app? If not, how should we handle it? Is there a way to know at launch that it was caused by the Live Activity ending, or what's the recommended way to avoid running the full startup (UI and network calls) for this launch?
Replies
0
Boosts
0
Views
85
Activity
1w
Launch screen not refreshed after app update: is clearing Library/SplashBoard supported?
We're adding an option to our Unity SDK that gives a game a native launch screen: a launch storyboard (set through UILaunchStoryboardName) showing a full-screen image from an asset catalog. What we see On a clean install, the new launch screen shows as expected. When the same device installs an update over the existing app (tested through TestFlight), the previous launch screen keeps showing. Launching the app several times does not change it. Deleting the app, restarting the device and reinstalling shows the new launch screen straight away. We checked the build itself: the compiled storyboard, the image in Assets.car and the Info.plist keys are all correct, so this looks like the system's launch screen snapshot cache. We assume App Store updates behave the same way. What we're considering On the first launch after an update, the app would delete the cached launch screen snapshots in its own container (Library/SplashBoard), so the system regenerates them and the new launch screen shows on the next launch. This only uses public file APIs inside the app's own sandbox. But Library/SplashBoard is not documented anywhere, so we'd rather ask before shipping it. Questions Is deleting Library/SplashBoard from the app's own container a supported or acceptable practice, or could it cause problems (with the system, or in a future iOS version)? Is there a supported way to make iOS refresh a cached launch screen after an app update? If not, is the expected behaviour simply that the system refreshes the snapshot at some point? Is it documented when that happens (for example after a reboot, or after a certain time)? If clearing the folder isn't recommended, we won't ship it. Updating players would just keep the old launch screen until iOS refreshes it. Thanks!
Replies
1
Boosts
0
Views
297
Activity
1w
FileManager.default.contentsOfDirectory fails with SMB
Hi, I am trying to list the contents of a directory selected by the user using the following code: let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.folder]) documentPicker.delegate = self self.present(documentPicker, animated: true) func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {         guard let folderUrl = urls.first else {return} let startAccessing&#9;= folderUrl.startAccessingSecurityScopedResource()         guard startAccessing else { print("ERROR")             return         }         defer {             if startAccessing {                 folderUrl.stopAccessingSecurityScopedResource()             }         }         var error : NSError? = nil         NSFileCoordinator().coordinate(readingItemAt: folderUrl, error: &error) { (url) in             let startAccessing = url.startAccessingSecurityScopedResource()             guard startAccessing else {                 print("ERROR 2")                 return             }             defer {                 if startAccessing { folderUrl.stopAccessingSecurityScopedResource()                 }             }                          do {                 let files = try FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: [.nameKey])                 print(files)             } catch let filesError {                 print(filesError)             }         }     } This works for iCloud and for local files. It also, curiously, works on empty folders on the SMB server (though, obviously, it returns an empty array). However, for SMB folders with contents I get the following cryptic error message. Error Domain=NSCocoaErrorDomain Code=256 "The file “downloads” couldn’t be opened." UserInfo={NSURL=file:///private/var/mobile/Library/LiveFiles/com.apple.filesystems.smbclientd/Gabgugfiles/downloads, NSFilePath=/private/var/mobile/Library/LiveFiles/com.apple.filesystems.smbclientd/Gabgugfiles/downloads, NSUnderlyingError=0x28010b0c0 {Error Domain=NSPOSIXErrorDomain Code=10006 "Unknown error: 10006"}} In addition, modifying the code slightly so the user picks an image instead works just fine too. I can load the image from the supplied URL. I have read the documentation here - https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories and watched the WWDC 2019 presentation, What's New in File Management and Quicklook, where this was introduced but this hasn't turned up any answers. My app is set up with Supports Document Browser. Is there something I'm doing wrong? The way this is described what I'm trying to do, get a list of files and act on each of them, is exactly what this is intended for yet it's not working.
Replies
12
Boosts
0
Views
3.5k
Activity
1w
HiraginoSans-W4/W5 availability diverges between iOS 16.5.1 and iOS 18.0.1: UIFont(name:) returns nil, XIB labels fall back to Helvetica
Background Our app previously bundled ヒラギノ角ゴシック W4.ttc and W5.ttc via UIAppFonts. App Store review flagged them under ITMS-91198 as Apple-provided fonts. We removed the bundled .ttc files and need to verify the runtime font-resolution behavior before shipping. Case C below shows the original state (with .ttc present) for comparison. Environment Same app, same code, same XIB, physical devices only. Tested OS: iOS 16.5.1 (two builds: with and without bundled .ttc) and iOS 18.0.1 (without bundled .ttc). Xcode 16.x. How to read the logs Each log has three sections: SYSTEM HIRAGINO SANS — UIFont.fontNames(forFamilyName: "Hiragino Sans"), i.e. what the OS itself provides. RAW UIFont(name:) — UIFont(name: "HiraginoSans-W4", size: 16) etc. This is the code path our App.Font wrapper uses. XIB LABEL RESOLVED — four UILabels whose XIB fontDescription specifies HiraginoSans-W3/W4/W5/W6 respectively. resolved= is label.font.fontName at runtime. Case A — iOS 18.0.1, physical device, bundled .ttc removed ===== ENV ===== systemVersion : 18.0.1 target : Physical Device ===== SYSTEM HIRAGINO SANS ===== HiraginoSans-W3 HiraginoSans-W4 HiraginoSans-W5 HiraginoSans-W6 HiraginoSans-W7 HiraginoSans-W8 ===== RAW UIFont(name:) ===== HiraginoSans-W3 OK family=Hiragino Sans HiraginoSans-W4 OK family=Hiragino Sans HiraginoSans-W5 OK family=Hiragino Sans HiraginoSans-W6 OK family=Hiragino Sans ===== XIB LABEL RESOLVED ===== W3Lab xib=HiraginoSans-W3 resolved=HiraginoSans-W3 family=Hiragino Sans W4Lab xib=HiraginoSans-W4 resolved=HiraginoSans-W4 family=Hiragino Sans W5Lab xib=HiraginoSans-W5 resolved=HiraginoSans-W5 family=Hiragino Sans W6Lab xib=HiraginoSans-W6 resolved=HiraginoSans-W6 family=Hiragino Sans ===== END =====Case B — iOS 16.5.1, physical device, bundled .ttc removed ===== ENV ===== systemVersion : 16.5.1 target : Physical Device ===== SYSTEM HIRAGINO SANS ===== HiraginoSans-W3 HiraginoSans-W6 HiraginoSans-W7 ===== RAW UIFont(name:) ===== HiraginoSans-W3 OK family=Hiragino Sans HiraginoSans-W4 nil HiraginoSans-W5 nil HiraginoSans-W6 OK family=Hiragino Sans ===== XIB LABEL RESOLVED ===== W3Lab xib=HiraginoSans-W3 resolved=HiraginoSans-W3 family=Hiragino Sans W4Lab xib=HiraginoSans-W4 resolved=Helvetica family=Helvetica W5Lab xib=HiraginoSans-W5 resolved=Helvetica family=Helvetica W6Lab xib=HiraginoSans-W6 resolved=HiraginoSans-W6 family=Hiragino Sans ===== END =====Case C — iOS 16.5.1, physical device, bundled .ttc present (original state) ===== ENV ===== systemVersion : 16.5.1 target : Physical Device ===== SYSTEM HIRAGINO SANS ===== HiraginoSans-W3 HiraginoSans-W4 HiraginoSans-W5 HiraginoSans-W6 HiraginoSans-W7 ===== RAW UIFont(name:) ===== HiraginoSans-W3 OK family=Hiragino Sans HiraginoSans-W4 OK family=Hiragino Sans HiraginoSans-W5 OK family=Hiragino Sans HiraginoSans-W6 OK family=Hiragino Sans ===== XIB LABEL RESOLVED ===== W3Lab xib=HiraginoSans-W3 resolved=HiraginoSans-W3 family=Hiragino Sans W4Lab xib=HiraginoSans-W4 resolved=HiraginoSans-W4 family=Hiragino Sans W5Lab xib=HiraginoSans-W5 resolved=HiraginoSans-W5 family=Hiragino Sans W6Lab xib=HiraginoSans-W6 resolved=HiraginoSans-W6 family=Hiragino Sans ===== END =====Observations Comparing B and C (same OS, only .ttc presence differs): removing the bundled .ttc removes HiraginoSans-W4/W5 from the system font list, makes UIFont(name:) return nil for them, and makes XIB labels naming them fall back to Helvetica — not SF, not the nearest weight in the same family. Comparing B and A (same .ttc state, only OS differs): iOS 18.0.1 ships HiraginoSans-W3–W8 in the system, so removing the bundled .ttc has no effect there. Question 1 — System font inventory by OS version Is there an official, versioned list of system-provided fonts (PostScript names) per iOS release? We need to determine which Hiragino Sans weights are available on a given OS at runtime, without hard-coding assumptions. Our observations show that iOS 16.5.1 does not provide HiraginoSans-W4/W5 in the system font set, while iOS 18.0.1 provides W3–W8. If no per-version official list exists, is UIFont.familyNames / UIFont.fontNames(forFamilyName:) the recommended runtime enumeration method? Or is there a documented recommendation to avoid relying on specific PostScript names across OS versions? Question 2 — XIB fontDescription fallback rule When a UILabel's XIB fontDescription specifies a font PostScript name that is not available at runtime (e.g. HiraginoSans-W4 on iOS 16.5.1 after removing the bundled .ttc), we observe UIKit falls back to Helvetica — not SF, not the nearest available weight in the same family. Is this fallback rule documented? Is it stable across iOS versions, or should we treat the fallback target as unspecified? If the fallback target cannot be relied upon, what is the recommended approach for XIB-based layouts that must not render with an unexpected font? Must every such label be re-assigned in code after awakeFromNib / viewDidLoad? Or is there a supported way to declare a fallback chain in Interface Builder?
Replies
0
Boosts
0
Views
71
Activity
1w
Persistent scroll stutter on iPhone 17 Pro Max, 18 Pro Max and 18 Pro (iOS 27.2), also on Apple Store demo units
Affected devices (all show the same problem): 1x iPhone 17 Pro Max 2x iPhone 18 Pro Max 1x iPhone 18 Pro Many demo iPhones at several Apple Stores Current iOS version: 27.2 Issue: Vertical scrolling inside apps frequently stutters and drops frames. It happens in many, many apps, including Apple's own App Store and Apple Store apps. During a normal flick-and-decelerate scroll, the content repeatedly freezes for one or more frames and then jumps forward. Because this reproduces on four of my own devices and on many Apple Store demo units, I believe it is a widespread, system-level issue, not a defect of a single device or my settings. Impact: I have been living with this for more than six months. I use my iPhone heavily every day, and the constant stutter has made using it genuinely distressing. Everything else about iPhone feels excellent, which makes this problem even harder to accept. Steps to reproduce: Open the App Store app (or almost any app with a scrolling list). Scroll with a normal flick and let it decelerate. Observe repeated hitches during the scroll. Measurements: I filmed the screen with a second iPhone at 4K 120 fps and measured content movement frame by frame: iPhone 18 Pro Max, third-party video feed: about 4 hitches per second of scrolling, about 4% of frames dropped, mostly single-frame drops. iPhone 18 Pro Max, third-party social app list: about 11 hitches per second, about 12% of frames dropped, at a regular rhythm every 6-8 frames. About a third of the stalls last 2-3 frames, and the content does not catch up afterwards. iPhone 17 Pro Max, third-party comment list: about 5 hitches per second, about 8% of frames dropped, including several full freezes of 50-75 ms. Expected: Smooth 120 Hz scrolling, as ProMotion is designed to deliver. Is Apple aware of this issue? I am happy to provide videos, frame-by-frame data, or sysdiagnose logs.
Replies
3
Boosts
1
Views
354
Activity
1w
IOS 27 getting false response from isInterfaceOrientationLocked when autorotate is on
I have an app almost ready to submit for distribution. It is a game with a fixed background view and a token that moves around on the fixed background. The token is moved by tilting the iPhone/iPad which is translated to movement based on CMMotionManager as roll and pitch readings. This simulates a flat level playing field with gravity pulling the token when the device is tipped. The app works well only when the user has set the device to have Autorotate locked. The following code lets me sample the status of Autorate: guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return } print("Orientation locked: ", windowScene.effectiveGeometry.isInterfaceOrientationLocked) The problem is that I always get a reading of false regardless of whether Autorotate is locked or not. Can anyone help me understand. Is this the wrong approach for getting this information? If so, how is this achieved? Thanks for your attention to this, Mike Ricker
Replies
0
Boosts
0
Views
145
Activity
2w