Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

A Summary of the WWDC25 Group Lab - UI Frameworks
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for UI Frameworks. How would you recommend developers start adopting the new design? Start by focusing on the foundational structural elements of your application, working from the "top down" or "bottom up" based on your application's hierarchy. These structural changes, like edge-to-edge content and updated navigation and controls, often require corresponding code modifications. As a first step, recompile your application with the new SDK to see what updates are automatically applied, especially if you've been using standard controls. Then, carefully analyze where the new design elements can be applied to your UI, paying particular attention to custom controls or UI that could benefit from a refresh. Address the large structural items first then focus on smaller details is recommended. Will we need to migrate our UI code to Swift and SwiftUI to adopt the new design? No, you will not need to migrate your UI code to Swift and SwiftUI to adopt the new design. The UI frameworks fully support the new design, allowing you to migrate your app with as little effort as possible, especially if you've been using standard controls. The goal is to make it easy to adopt the new design, regardless of your current UI framework, to achieve a cohesive look across the operating system. What was the reason for choosing Liquid Glass over frosted glass, as used in visionOS? The choice of Liquid Glass was driven by the desire to bring content to life. The see-through nature of Liquid Glass enhances this effect. The appearance of Liquid Glass adapts based on its size; larger glass elements look more frosted, which aligns with the design of visionOS, where everything feels larger and benefits from the frosted look. What are best practices for apps that use customized navigation bars? The new design emphasizes behavior and transitions as much as static appearance. Consider whether you truly need a custom navigation bar, or if the system-provided controls can meet your needs. Explore new APIs for subtitles and custom views in navigation bars, designed to support common use cases. If you still require a custom solution, ensure you're respecting safe areas using APIs like SwiftUI's safeAreaInset. When working with Liquid Glass, group related buttons in shared containers to maintain design consistency. Finally, mark glass containers as interactive. For branding, instead of coloring the navigation bar directly, consider incorporating branding colors into the content area behind the Liquid Glass controls. This creates a dynamic effect where the color is visible through the glass and moves with the content as the user scrolls. I want to know why new UI Framework APIs aren’t backward compatible, specifically in SwiftUI? It leads to code with lots of if-else statements. Existing APIs have been updated to work with the new design where possible, ensuring that apps using those APIs will adopt the new design and function on both older and newer operating systems. However, new APIs often depend on deep integration across the framework and graphics stack, making backward compatibility impractical. When using these new APIs, it's important to consider how they fit within the context of the latest OS. The use of if-else statements allows you to maintain compatibility with older systems while taking full advantage of the new APIs and design features on newer systems. If you are using new APIs, it likely means you are implementing something very specific to the new design language. Using conditional code allows you to intentionally create different code paths for the new design versus older operating systems. Prefer to use if #available where appropriate to intentionally adopt new design elements. Are there any Liquid Glass materials in iOS or macOS that are only available as part of dedicated components? Or are all those materials available through new UIKit and AppKit views? Yes, some variations of the Liquid Glass material are exclusively available through dedicated components like sliders, segmented controls, and tab bars. However, the "regular" and "clear" glass materials should satisfy most application requirements. If you encounter situations where these options are insufficient, please file feedback. If I were to create an app today, how should I design it to make it future proof using Liquid Glass? The best approach to future-proof your app is to utilize standard system controls and design your UI to align with the standard system look and feel. Using the framework-provided declarative API generally leads to easier adoption of future design changes, as you're expressing intent rather than specifying pixel-perfect visuals. Pay close attention to the design sessions offered this year, which cover the design motivation behind the Liquid Glass material and best practices for its use. Is it possible to implement your own sidebar on macOS without NSSplitViewController, but still provide the Liquid Glass appearance? While technically possible to create a custom sidebar that approximates the Liquid Glass appearance without using NSSplitViewController, it is not recommended. The system implementation of the sidebar involves significant unseen complexity, including interlayering with scroll edge effects and fullscreen behaviors. NSSplitViewController provides the necessary level of abstraction for the framework to handle these details correctly. Regarding the SceneDelagate and scene based life-cycle, I would like to confirm that AppDelegate is not going away. Also if the above is a correct understanding, is there any advice as to what should, and should not, be moved to the SceneDelegate? UIApplicationDelegate is not going away and still serves a purpose for application-level interactions with the system and managing scenes at a higher level. Move code related to your app's scene or UI into the UISceneDelegate. Remember that adopting scenes doesn't necessarily mean supporting multiple scenes; an app can be scene-based but still support only one scene. Refer to the tech note Migrating to the UIKit scene-based life cycle and the Make your UIKit app more flexible WWDC25 session for more information.
Topic: UI Frameworks SubTopic: General
0
0
657
Jun ’25
Getting NSScrollView to scroll to an Offset with animation
Hi I have a NSTextView set as the document of a NSScrollView scrollView.documentView = textView I want to programatically scroll to a specific offset in the scrollView. I use the following function and it jumps to the right location: scrollView.documentOffset = offset However I would like to animate the scrolling. Any suggestions? Also to mention, I have not flipped the coordinates of the NSTextView Thanks Reza
Topic: UI Frameworks SubTopic: AppKit
0
0
2
26m
UIBarButtonItem has a lot of constraints warnings
The issue can be reproduced using the simplest code. In Xcode 26 + iOS 26, when a UIBarButtonItem is created using a UIImage, it consistently prints numerous constraint conflict warnings to the console. Below is my test code and the console warnings: let btn = UIBarButtonItem(systemItem: .trash) self.toolbarItems = [btn] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x1083b4550 _TtC5UIKitP33_DDE14AA6B49FCAFC5A54255A118E1D8713ButtonWrapper:0x108374e00.width == _UIButtonBarButton:0x1083e8000.width (active)>", "<NSLayoutConstraint:0x1083b4aa0 'IB_Leading_Leading' H:|-(2)-[_UIModernBarButton:0x103ac62e0] (active, names: '|':_UIButtonBarButton:0x1083e8000 )>", "<NSLayoutConstraint:0x1083b4af0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x103ac62e0]-(2)-| (active, names: '|':_UIButtonBarButton:0x1083e8000 )>", "<NSLayoutConstraint:0x1083b4fa0 'UIView-Encapsulated-Layout-Width' _TtC5UIKitP33_DDE14AA6B49FCAFC5A54255A118E1D8713ButtonWrapper:0x108374e00.width == 0 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x1083b4af0 'IB_Trailing_Trailing' H:[_UIModernBarButton:0x103ac62e0]-(2)-| (active, names: '|':_UIButtonBarButton:0x1083e8000 )> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
1
0
72
4h
Popovers are broken on macCatalyst
.popover(isPresented: modifier doesn't work on Mac Catalyst when attached to the item in the toolbar. The app crashes on button click, when trying to present the popover. iOS 26 RC (macOS 26 RC) Feedback ID - FB20145491 import SwiftUI struct ContentView: View { @State private var isPresented: Bool = false var body: some View { NavigationStack { Text("Hello, world!") .toolbar { ToolbarItem(placement: .automatic) { Button(action: { self.isPresented.toggle() }) { Text("Toggle popover") } .popover(isPresented: $isPresented) { Text("Hello, world!") } } } } } } #Preview { ContentView() }
3
1
320
15h
Compositional Layout's broken `visibleItemsInvalidationHandler`
Hello everybody! TLDR: Issues with visibleItemsInvalidationHandler. Minimal code to reproduce available. I've been working with Compositional Layout for a while now and recently I've found myself needing to implement custom animation based on scroll position of UI elements. Once I found visibleItemsInvalidationHandler it felt like the exact solution that I needed. Once I implement I've found out it doesn't quite behave as you'd expect. To put it simply, it seems like the animations only work if your whole layout does not use .estimated nor .uniformAcrossSiblings. As soon as you use them then the animations will stop working, I've debugged it deeper and it seems like the invalidation context generated by it does not include the indexPath of the cells, which is always included in the version in which it works. Feel free to swap the line 51 with its comment to flip between the working and failing version of it. Playground Example My final question therefore is... Is this the expected behavior? The documentation doesn't give any clues about such behavior and although I've tried relentlessly to find a workaround for this specific hiccup I was not successful with it.
2
0
167
17h
Fix text in accessory view
Do you guys know how to fix the render of the text in the accessory view ? If I force the color of text to be .black it work but it will break dark mode, but forcing it .black : .white on color scheme changes makes white to still adapt to what is behind it I have noticed that Apple Music doesn’t have that artifact and it seems to break when images are behind the accessory view // MARK: - Next Routine Accessory @available(iOS 26.0, *) struct NetxRoutinesAccessory: View { @ObservedObject private var viewModel = RoutineProgressViewModel.shared @EnvironmentObject var colorSchemeManager: ColorSchemeManager @EnvironmentObject var routineStore: RoutineStore @EnvironmentObject var freemiumKit: FreemiumKit @ObservedObject var petsStore = PetsStore.shared @Environment(\.colorScheme) private var colorScheme // Tab accessory placement environment @Environment(\.tabViewBottomAccessoryPlacement) private var accessoryPlacement // Navigation callback var onTap: (() -> Void)? @State private var isButtonPressed = false /// Explicit black for light mode, white for dark mode private var textColor: Color { colorScheme == .dark ? .trueWhite : .trueBlack } /// Returns true when the accessory is in inline/minimized mode private var isInline: Bool { accessoryPlacement == .inline } var body: some View { accessoryContent() .onTapGesture { onTap?() } } private func accessoryContent() -> some View { HStack(spacing: 12) { // Content with smooth transitions VStack(alignment: .leading, spacing: 2) { if viewModel.totalTasks == 0 { Text(NSLocalizedString("Set up routines", comment: "Routines empty state")) .font(.subheadline.weight(.medium)) .foregroundColor(textColor) } else if let next = viewModel.nextRoutineTask() { HStack(spacing: 4) { Text(NSLocalizedString("Next", comment: "Next routine prefix")) .font(.caption) .foregroundColor(textColor) Text("•") .font(.caption) .foregroundColor(textColor) Text(next.routine.name) .font(.subheadline.weight(.medium)) .foregroundColor(textColor) .lineLimit(1) } .id("routine-\(next.routine.id)-\(next.time)") .transition(.opacity.combined(with: .move(edge: .leading))) HStack(spacing: 4) { Text(viewModel.petNames(for: next.routine.petIDs)) .font(.caption) .foregroundColor(textColor) Text("•") .font(.caption) .foregroundColor(textColor) Text(Routine.displayTimeFormatter.string(from: next.time)) .font(.caption.weight(.medium)) .foregroundColor(colorSchemeManager.accentColor ?? .blue) } .id("time-\(next.routine.id)-\(next.time)") .transition(.opacity.combined(with: .move(edge: .leading))) } else { // All tasks completed Text(NSLocalizedString("All done for today!", comment: "All routines completed")) .font(.subheadline.weight(.medium)) .foregroundColor(textColor) .transition(.opacity.combined(with: .scale)) Text("\(viewModel.completedTasks)/\(viewModel.totalTasks) " + NSLocalizedString("tasks", comment: "Tasks count suffix")) .font(.caption) .foregroundColor(textColor) } } .animation(colorSchemeManager.reduceMotion ? nil : .snappy(duration: 0.3), value: viewModel.completedTasks) .animation(colorSchemeManager.reduceMotion ? nil : .snappy(duration: 0.3), value: viewModel.progress) } .padding() .contentShape(.rect) .animation(colorSchemeManager.reduceMotion ? nil : .snappy(duration: 0.35), value: viewModel.completedTasks) } }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
44
21h
My app doesn't respond on iPhone Air iOS 26.1.
My app doesn't respond on iPhone Air iOS 26.1. After startup, my app shows the main view with a tab bar controller containing 4 navigation controllers. However, when a second-level view controller is pushed onto any navigation controller, the UI freezes and becomes unresponsive. The iPhone simulator running iOS 26.1 exhibits the same problem. The debug profile shows CPU usage at 100%. However, other devices and simulators do not have this problem.
6
3
278
21h
Issue with multiple touches with "Defer System Gestures" on, with iOS
I'm developing a rhythm game for iOS which has four buttons spanning the width of the screen in portrait. I noticed that my testers were having some missed inputs on the buttons on the left and right due to the fact that iOS, by default, tries to ignore accidental touches on the edges of the screen. So I enabled "Defer System Gestures" on the left and right edges, but then quickly started to notice a new, very specific, issue. Description of the issue If you have finger #1 touching and holding anywhere in the middle of the screen, and finger #2 touches on the far right or left edge of the screen just below the horizontal position of finger #1, those touches are inconsistently not recognized. If finger #1 is not present, this issue does not occur. If finger #2 is above or well below finger #1, this issue also does not occur. A dead zone is created on the right and left edges of the screen just below the horizontal position of the first touch. Here is a rough representative example of where touches #1 and #2 need to be for this issue to manifest, in case the text above is not clear. |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| It just so happens that this issue is causing major usability problems with my game, as it results in what the user sees as sporadic and inconsistent response when the game calls for two notes to be played at the same time. Steps to recreate the issue Here are the steps if you want to recreate the problem yourself using the "Create New Gesture" pane in "Assistive Touch" (Note that this problem is not specific to the Settings app, but rather is an issue across the system—however this panel defers system gestures and shows where touches are being read, so it is a great place to demonstrate): (1) Go to Settings &gt; Accessibility &gt; Touch &gt; Assistive Touch &gt; Create New Gesture...; (2) With one finger, touch the middle of the screen and hold it through step 3; (3) With a second finger, tap 4 times along the right (or left) edge of the screen in the following places: (a) well above the vertical position of the first touch, (b) just above the vertical position of the first touch, (c) just below the vertical position of the first touch, and (d) well below the vertical position of the first touch; (4) Notice how, more than half the time, touch (c) does not register. I have found that this problem is more replicatable when the first touch is on the lower half of the screen, but I have been able to replicate it when the finger is higher as well, just not as consistently. Here are the four positions described in the steps above: Position a: both touches register |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| Position b: both touches usually register |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9; 2| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| Position c: only touch 1 registers |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| Position d: both touches register |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9; 1&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9;&amp;#9;| |&amp;#9;&amp;#9;&amp;#9; 2| Is there anything I can do to resolve this behavior? My app requires gesture deferment to be on for the expected experience by the user, and this bug is causing other issues for my testers that kind of need to be resolved before I can confidently release the game.
2
2
1.2k
21h
Search Functionality Missing in FamilyActivityPicker on iPadOS 26.0+
Issue: The search functionality in FamilyActivityPicker has disappeared on iPadOS 26.0+. This feature was working in previous versions but is now missing. Framework: FamilyControls Expected: Search bar should be available in FamilyActivityPicker to help users find apps quickly. Actual: Search functionality is completely missing. Impact: Makes app selection difficult for users with many installed apps. Is this a known issue? If it's a bug, please address it in an upcoming update. If intentional, guidance on alternatives would be appreciated. Thank you.
0
0
10
21h
UIToolbar buttons losing spacing in Xcode 26.1.1 Legacy Mode (UIDesignRequiresCompatibility)
We're using XCode 26.1.1 We do not have resource to adopt Liquid Glass design. Hence, we are using the following workaround <key>UIDesignRequiresCompatibility</key> <true/> This is our Storyboard. Pre XCode 26 Before XCode 26.1.1, the bottom toolbar looks great. In XCode 26 However, in XCode 26.1.1, the bottom toolbar buttons seems to "Squish together". Do anyone have any idea, how I can make UIToolbar works by enabling UIDesignRequiresCompatibility? Thanks.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
56
1d
NSGlassEffectView issue on macOS 26.2
I have a borderless NSWindow with transparent background floating at Dock level and with collectionBehavior set to NSWindowCollectionBehaviorCanJoinAllSpaces. To render its background I was using an NSVisualEffectView, but, with the introduction of Liquid Glass, I decided to replace it with a NSGlassEffectView on Tahoe. On macOS 26.0 and 26.1 all works fine: my window's background is correctly rendered and updated. On macOS 26.2 this is not so: the background seems cached and doesn't update if I move my window or if I drag some other window underneath it. My window's movable property is set to NO (and I need this to be so): dragging is implemented by handling mouseDown, mouseDragged, and mouseUp events. Just to experiment, I tried setting movable and movableByWindowBackground both to YES. In this case, the NSGlassEffectView is correctly updated if I move the window itself, but doesn't change if I move other windows underneath it. Has anybody experienced a similar problem on maOS 26.2? If so, is there a way to solve it? Thanks, Marco
Topic: UI Frameworks SubTopic: AppKit
0
0
113
1d
How to add view below navigation bar to extend scroll edge effect
Hello! What UIKit API enables you to add a view below the navigation bar and extend the scroll edge effect below it in iOS 26? safeAreaBar is how you do it in SwiftUI but I need to achieve this design in my UIKit app (which has a collection view in a view controller in a navigation controller). struct ContentView: View { let segments = ["First", "Second", "Third"] @State private var selectedSegment = "First" var body: some View { NavigationStack { List(0..<50, id: \.self) { i in Text("Row \(i + 1)") } .safeAreaBar(edge: .top) { Picker("Segment", selection: $selectedSegment) { ForEach(segments, id: \.self) { Text($0) } } .pickerStyle(.segmented) .padding(.horizontal) .padding(.bottom, 8) } .navigationTitle("Title") .navigationBarTitleDisplayMode(.inline) } } }
3
1
334
1d
Persistent Control Center landscape layout reset after SpringBoard jetsam during charging idle (iOS 26.0–26.2)
Since iOS 26.0, the Control Center layout consistently resets in landscape orientation after certain system events. This issue is still present in the official public release of iOS 26.2. The reset occurs without a visible reboot and appears to be triggered by a background SpringBoard termination (jetsam) during charging idle maintenance windows (typically overnight while the device is plugged in). After SpringBoard relaunches: • The portrait Control Center layout is restored correctly • The landscape Control Center layout is reinitialized using the default order This indicates a state restoration failure rather than a user configuration or sync issue. ⸻ Steps to Reproduce: Use an iPhone 15 Pro running iOS 26.0, 26.1, or 26.2 Manually reorder Control Center controls Leave the device plugged in and idle overnight During charging idle, SpringBoard is terminated in the background due to memory pressure (no visible reboot) Open Control Center the next day: • Portrait layout is preserved • Landscape layout has reverted to default ⸻ Expected Result: Both portrait and landscape Control Center layouts should persist across SpringBoard restarts caused by jetsam or memory pressure, including during charging idle maintenance. ⸻ Actual Result: After SpringBoard relaunch: • Portrait layout is restored correctly • Landscape layout is lost and recreated using the default configuration ⸻ Analytics / Logs (relevant excerpt): Process: SpringBoard Case Type: MemoryResourceException Subtype: MREExceptionFatalLimitActive This occurs during charging idle and does not require a user-initiated reboot. ⸻ Additional Observations: • Issue does not occur when the device is idle overnight without charging • Manual reordering works correctly until the next SpringBoard jetsam • Resetting settings, disabling iCloud sync, or reinstalling iOS does not resolve the issue • This behavior has persisted across multiple major and minor releases, indicating a regression or unresolved bug ⸻ Suspected Root Cause: Incomplete state restoration in ControlCenterKit after SpringBoard relaunch following jetsam during charging idle. Portrait state is restored; landscape state falls back to default.
Topic: UI Frameworks SubTopic: UIKit
0
0
76
1d
26.1b4 breaks zoom transition from tabViewBottomAccessory when fullScreenCover item is non-trivial Binding
Filed in Feedback as FB20772137 Zoom transition originating from inside tabViewBottomAccessory, when the binding passed to fullScreenCover's item is a Binding other than a "$-synthesized" binding, the animation fails with the following error (and crucially fails to perform the desired animation): Starting a zoom transition from a nil view will trigger a fallback transition. To get the best possible teansition, be sure to provide a view that's visible and in a window. What I want to do is pass a binding to a property inside an ObservableObject (or @Observable, but it doesn't matter) to hold the item representing the presentation. But this stopped working as of 26.1b4. It worked in 26.1b3 and in 26.0 (and 26.0.1) Here's the gist of code that will reproduce the issue (I've omitted irrelevant details in the interest of brevity): struct ContentView: View { @Binding var presentation: PresentationDestination? @Namespace private var animation var body: some View { // Omitted TabView stuff… .tabViewBottomAccessory { miniPlayer .matchedTransitionSource( id: "player", in: animation ) } .fullScreenCover( item: $presentation, content: { _ in fullScreenPlayer .navigationTransition( .zoom( sourceID: "player", in: animation ) ) }) } As you can see, ContentView takes a Binding to the presentation, but it matters how this binding is constructed. This works: @State private var presentation: PresentationDestination … ContentView(presentation: $presentation) This fails (as does ObservableObject with @Published): @Observable class Router2 { var presentation: PresentationDestination? } … @State private var router2 = Router2() … ContentView(presentation: $router2.presentation) Also, this fails: @State private var presentation: PresentationDestination … ContentView( presentation: .init(get: { presentation }, set: { newValue in presentation = newValue }) ) These differences are unexpected, of course. I consider this a regression in 26.1b4 I should add that if I move the source of the transition to somewhere outside tabViewBottomAccessory things seem to work fine.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2
4
193
1d
Placemark Deprecated
"Use location, address and addressRepresentations instead" Is it possible to know what kind of "Address" a MapItem is representing (State, County, Neighborhood etc) after a MKGeocodingRequest? Is it possible to find out the CLRegion or similar of an map item. (Now when we cannot read it from the Placemark)
3
1
220
1d
Navigation Bar Elements Disappear When Using UIPageViewController in SwiftUI Under Low Power Mode
Problem Description: In a SwiftUI application, I've wrapped UIKit's UIPageViewController using UIViewControllerRepresentable, naming the wrapped class PagedInfiniteScrollView. This component causes navigation bar elements (title and buttons) to disappear. This issue only occurs in Low Power Mode on a physical device. Steps to Reproduce: Enable Low Power Mode on a physical device and open the app's home page. From the home page, open a detail sheet containing PagedInfiniteScrollView. This detail page include a navigation title and a toolbar button in the top-right corner. PagedInfiniteScrollView supports horizontal swiping to switch pages. Tap the toolbar button in the top-right corner of the detail page to open an edit sheet. Without making any changes, close the edit sheet and return to the detail page. On the detail page, swipe left and right on the PagedInfiniteScrollView. Expected Result: When swiping the PagedInfiniteScrollView, the navigation title and top-right toolbar button of the detail page should remain visible. Actual Result: When swiping the PagedInfiniteScrollView, the navigation title and top-right toolbar button of the detail page disappear. import SwiftUI @main struct CalendarApp: App { var body: some Scene { WindowGroup { ContentView() } } } import SwiftUI struct ContentView: View { @State private var showDetailSheet = false @State private var currentPage: Int = 0 var body: some View { NavigationStack { Button { showDetailSheet = true } label: { Text("show Calendar sheet") } .sheet(isPresented: $showDetailSheet) { DetailSheet(currentPage: $currentPage) } } } } struct DetailSheet: View { @Binding var currentPage: Int @State private var showEditSheet = false var body: some View { NavigationStack { PagedInfiniteScrollView(content: { pageIndex in Text("\(pageIndex)") .frame(width: 200, height: 200) .background(Color.blue) }, currentPage: $currentPage) .sheet(isPresented: $showEditSheet, content: { Text("edit") }) .navigationTitle("Detail") .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItemGroup(placement: .topBarTrailing) { Button { showEditSheet = true } label: { Text("Edit") } } } } } } import SwiftUI import UIKit struct PagedInfiniteScrollView<Content: View>: UIViewControllerRepresentable { typealias UIViewControllerType = UIPageViewController let content: (Int) -> Content @Binding var currentPage: Int func makeCoordinator() -> Coordinator { Coordinator(self) } func makeUIViewController(context: Context) -> UIPageViewController { let pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal) pageViewController.dataSource = context.coordinator pageViewController.delegate = context.coordinator let initialViewController = UIHostingController(rootView: IdentifiableContent(index: currentPage, content: { content(currentPage) })) pageViewController.setViewControllers([initialViewController], direction: .forward, animated: false, completion: nil) return pageViewController } func updateUIViewController(_ uiViewController: UIPageViewController, context: Context) { let currentViewController = uiViewController.viewControllers?.first as? UIHostingController<IdentifiableContent<Content>> let currentIndex = currentViewController?.rootView.index ?? 0 if currentPage != currentIndex { let direction: UIPageViewController.NavigationDirection = currentPage > currentIndex ? .forward : .reverse let newViewController = UIHostingController(rootView: IdentifiableContent(index: currentPage, content: { content(currentPage) })) uiViewController.setViewControllers([newViewController], direction: direction, animated: true, completion: nil) } } class Coordinator: NSObject, UIPageViewControllerDataSource, UIPageViewControllerDelegate { var parent: PagedInfiniteScrollView init(_ parent: PagedInfiniteScrollView) { self.parent = parent } func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { guard let currentView = viewController as? UIHostingController<IdentifiableContent<Content>>, let currentIndex = currentView.rootView.index as Int? else { return nil } let previousIndex = currentIndex - 1 return UIHostingController(rootView: IdentifiableContent(index: previousIndex, content: { parent.content(previousIndex) })) } func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { guard let currentView = viewController as? UIHostingController<IdentifiableContent<Content>>, let currentIndex = currentView.rootView.index as Int? else { return nil } let nextIndex = currentIndex + 1 return UIHostingController(rootView: IdentifiableContent(index: nextIndex, content: { parent.content(nextIndex) })) } func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { if completed, let currentView = pageViewController.viewControllers?.first as? UIHostingController<IdentifiableContent<Content>>, let currentIndex = currentView.rootView.index as Int? { parent.currentPage = currentIndex } } } } extension PagedInfiniteScrollView { struct IdentifiableContent<Content: View>: View { let index: Int let content: Content init(index: Int, @ViewBuilder content: () -> Content) { self.index = index self.content = content() } var body: some View { content } } }
5
1
745
1d
How to stop navigation items from moving into an overflow menu
One screen in my app uses a navigation bar with some buttons added to the titleView and some buttons added as a customView of a single rightBarButtonItem. In iOS 26 (beta 9), if I switch to the home screen and back again, the titleView and rightBarButtonItem disappear and an overflow button (three dots) appears instead. Nothing happens when I click the overflow button. Here's a screen capture: https://youtu.be/tthRnMz98kA This also happens when I switch to another app, when I rotate the device or when I resize the app window. In all cases, there is enough room to show all the buttons, but they still disappear. I overrode the viewWillTransition function in my view controller and logged when that runs. I can see that if I switch to the home screen and back again before that runs (within one or two seconds), there's no problem. But once that runs, the navigation bar items disappear and the overflow button appears. I have not done anything to set up the overflow button and don't have any need to use it. The documentation about it isn't very detailed, but it seems like it shouldn't be used unless I add it. This wasn't a problem in iOS 18 or earlier iOS versions. Does anyone know how to stop this? BTW, I'm using Swift, but not SwiftUI.
Topic: UI Frameworks SubTopic: UIKit
5
0
303
1d
Request Review alert is unresponsive in iOS 26.1
Try this simple code: import SwiftUI import StoreKit struct ReviewView: View { @Environment(\.requestReview) var requestReview var body: some View { Button("Leave a review") { requestReview() } } } When the Review Alert shows, the "Not Now" button is disabled for some reason!? It was always tappable in all iOS versions that I remember. And there is no way to opt out, unless the user taps on the stars first. Is it a bug or a feature? Thanks for looking into it!
4
1
707
2d
Tapping on ShareLink crashes the app
Overview Tapping on ShareLink crashes the app when ShareLink is added in the toolbar with the placement of secondaryAction Feedback FB21337385 Note: Apple engineers please priorities this is a blocker and affects production apps and prevents us from going live. Environment Xcode: 26.2 (17C52) iOS: 26.2 iPadOS: 26.2 Reproduce Able to reproduce 100% both on Simulator and Device Isolation of the crash The crash happens only when the ShareLink is used with the placement .secondaryAction The crash doesn't 'happen when the ShareLink is used with the placement .primaryAction Code import SwiftUI struct ContentView: View { var body: some View { NavigationStack { Text("Hello, world!") .toolbar { ToolbarItem(placement: .primaryAction) { Button("Dummy") { print("dummy") } } // Tapping on share button will cause it to crash // Crash only happens when the ShareLink is used with placement .secondaryAction // It doesn't crash when placement is primaryAction ToolbarItem(placement: .secondaryAction) { ShareLink(item: "Some string") } } } } } Crash stack trace *** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<_UIActivityViewControllerPresentationController: 0x105a3b580>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.' *** First throw call stack: ( 0 CoreFoundation 0x00000001804f71d0 __exceptionPreprocess + 172 1 libobjc.A.dylib 0x000000018009c094 objc_exception_throw + 72 2 UIKitCore 0x0000000185a5b17c -[UIPopoverPresentationController presentationTransitionWillBegin] + 2712 3 UIKitCore 0x0000000185a65de0 -[UIPresentationController _presentationTransitionWillBegin] + 28 4 UIKitCore 0x0000000185a6523c __80-[UIPresentationController _initViewHierarchyForPresentationSuperview:inWindow:]_block_invoke + 1928 5 UIKitCore 0x0000000185a633ec __77-[UIPresentationController runTransitionForCurrentStateAnimated:handoffData:]_block_invoke_3 + 296 6 UIKitCore 0x00000001868b2950 -[_UIAfterCACommitBlock run] + 64 7 UIKitCore 0x00000001868b2d64 -[_UIAfterCACommitQueue flush] + 164 8 UIKitCore 0x0000000186354f04 _runAfterCACommitDeferredBlocks + 256 9 UIKitCore 0x0000000186346bec _cleanUpAfterCAFlushAndRunDeferredBlocks + 76 10 UIKitCore 0x0000000186346cb4 _UIApplicationFlushCATransaction + 68 11 UIKitCore 0x0000000186263c48 __setupUpdateSequence_block_invoke_2 + 372 12 UIKitCore 0x000000018582f378 _UIUpdateSequenceRunNext + 120 13 UIKitCore 0x00000001862640a4 schedulerStepScheduledMainSectionContinue + 56 14 UpdateCycle 0x00000002501912b4 _ZN2UC10DriverCore18continueProcessingEv + 80 15 CoreFoundation 0x000000018041a4ac __CFMachPortPerform + 164 16 CoreFoundation 0x0000000180456aa8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 17 CoreFoundation 0x00000001804560c0 __CFRunLoopDoSource1 + 480 18 CoreFoundation 0x0000000180455188 __CFRunLoopRun + 2100 19 CoreFoundation 0x000000018044fcec _CFRunLoopRunSpecificWithOptions + 496 20 GraphicsServices 0x0000000192a669bc GSEventRunModal + 116 21 UIKitCore 0x0000000186348574 -[UIApplication _run] + 772 22 UIKitCore 0x000000018634c79c UIApplicationMain + 124 23 SwiftUI 0x00000001da58d620 $s7SwiftUI17KitRendererCommon33_ACC2C5639A7D76F611E170E831FCA491LLys5NeverOyXlXpFAESpySpys4Int8VGSgGXEfU_ + 164 24 SwiftUI 0x00000001da58d368 $s7SwiftUI6runAppys5NeverOxAA0D0RzlF + 180 25 SwiftUI 0x00000001da31b42c $s7SwiftUI3AppPAAE4mainyyFZ + 148 26 ShareLinkSecondaryPlacementDemo.deb 0x0000000104d82b0c $s31ShareLinkSecondaryPlacementDemo0abcdE3AppV5$mainyyFZ + 40 27 ShareLinkSecondaryPlacementDemo.deb 0x0000000104d82bb8 __debug_main_executable_dylib_entry_point + 12 28 dyld 0x0000000104cc53d0 start_sim + 20 29 ??? 0x0000000104ff0d54 0x0 + 4378791252 ) libc++abi: terminating due to uncaught exception of type NSException
1
0
80
2d
iOS 26.1 PHPickerConfiguration.preselectedAssetIdentifiers doesn't select previous pictures in the PHPickerViewController
Hi, I faced with the issue on iOS 26.1 with PHPickerViewController. After first selection I save assetIdentifier of PHPickerResult for images. next time I open the picker I expect to have the images selected based on assetIdentifier Code: var config = PHPickerConfiguration(photoLibrary: .shared()) config.selectionLimit = 10 config.filter = .images config.preselectedAssetIdentifiers = images.compactMap(\.assetID) let picker = PHPickerViewController(configuration: config) picker.delegate = self present(picker, animated: true) But on iOS 26.1 they aren't selected. On lower iOS version all works fine. Does anybody faced with similar issue?
Topic: UI Frameworks SubTopic: UIKit
3
2
245
2d