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

Created

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
865
Jun ’25
Xcode 26.3 Simulator renders SwiftUI app only inside a rounded rectangle instead of full screen
Hi everyone, I’m seeing a strange rendering issue in Xcode 26.3 that seems to affect only the iOS Simulator. Environment: Xcode 26.3 SwiftUI app Reproduces in Simulator only Reproduces across multiple simulator device models My code is just a minimal example Expected behavior: The view should fill the entire screen. Actual behavior: The app content is rendered only inside a centered rounded rectangle/card-like area, with black space around it, as if the app canvas is being clipped incorrectly. Minimal reproduction: import SwiftUI @main struct LayoutShowcaseApp: App { var body: some Scene { WindowGroup { Color.green.ignoresSafeArea() } } } I also tried wrapping it in a ZStack and using: .frame(maxWidth: .infinity, maxHeight: .infinity) .background(...) .ignoresSafeArea() but the result is the same. What I already tried: Clean Build Folder Switching simulator device models Resetting simulator content/settings Rebuilding from a fresh minimal SwiftUI project Since this happens with such a minimal example, it looks more like a Simulator/runtime rendering bug than a SwiftUI layout issue. Has anyone else seen this on Xcode 26.3? If yes, did you find any workaround? Thanks.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
31
4h
iOS 26: Toolbar button background flashes black during NavigationStack transitions (dark mode)
I’m seeing a visual glitch with toolbar buttons when building with Xcode 26 for iOS 26. During transitions (both pushing in a NavigationStack and presenting a .sheet with its own NavigationStack), the toolbar button briefly flashes the wrong background colour (black in dark mode, white in light mode) before animating to the correct Liquid Glass appearance. This happens even in a minimal example and only seems to affect system toolbar buttons. A custom view with .glassEffect() doesn’t have the issue. I’ve tried: .tint(...), UINavigationBarAppearance/UIToolbarAppearance, and setting backgrounds on hosting/nav/window but none of those made any difference. Here’s a minimal reproducible example: import SwiftUI struct ContentView: View { @State private var showingSheet = false var body: some View { NavigationStack { List { NavigationLink("Push (same stack — morphs)") { DetailView() } Button("Sheet (separate stack — flashes)") { showingSheet = true } } .navigationTitle("Root") .scrollContentBackground(.hidden) .background(.gray) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Action") {} } } .sheet(isPresented: $showingSheet) { SheetView() } } } } struct DetailView: View { var body: some View { Text("Detail (same stack)") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.gray) .navigationTitle("Detail") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Action") {} } } } } struct SheetView: View { var body: some View { NavigationStack { Text("Sheet (separate stack)") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.gray) .navigationTitle("Sheet") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Action") {} } } } } } Has anyone else seen this or found a workaround outside of disabling this background completely with .sharedBackgroundVisibility(.hidden)? I have filed a bug report under FB22141183
0
0
75
12h
NSImage with HDR-disabled image causes freezing for window resize
I have regular NSImage from iPhone and the drawing get's extremely choppy during window resize (especially at small window sizes below 100px). When the window size is large there is no problem with drawing and CPU utilization is low. I have tried kCGImageSourceDecodeToSDR + or another NSImage from CGImage but the CPU utilization is extreme at small sizes. Non-HDR images don't have problems with drawing at small sizes. Video example: https://youtu.be/x8iAYGCyACs import AppKit import AVFoundation class ImageBackgroundView: NSView { @Invalidating(.display) var image: NSImage? = nil override var clipsToBounds: Bool { set { } get { true } } override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) NSColor.red.setFill() dirtyRect.fill() guard let image = image else { return } // Calculate aspect-fit rect using AVFoundation let imageSize = image.size let targetRect = bounds let drawRect = AVMakeRect(aspectRatio: imageSize, insideRect: targetRect) image.draw(in: drawRect) } } Copy import Cocoa import UniformTypeIdentifiers class ViewController: NSViewController { @IBOutlet weak var imageView: ImageBackgroundView! @IBAction func buttonAction(_ sender: Any) { let panel = NSOpenPanel() panel.allowedContentTypes = NSImage.imageTypes.compactMap { UTType($0) } panel.begin { response in let nonHDROptions = [ kCGImageSourceDecodeRequest : kCGImageSourceDecodeToSDR, kCGImageSourceDecodeRequestOptions: [kCGComputeHDRStats: false] ] as CFDictionary guard response == .OK, let url = panel.url, let source = CGImageSourceCreateWithURL(url as CFURL, nil), let cgImage = CGImageSourceCreateImageAtIndex(source, 0, nonHDROptions) else { return } self.imageView.image = NSImage(cgImage: cgImage, size: NSMakeSize(CGFloat(cgImage.width), CGFloat(cgImage.height))) } } } Time profiler with HDR NSImage: Time profiler with NSImage + kCGImageSourceDecodeToSDR:
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
126
22h
NSPathControl Causing Disk I/O Reading NSURL Resource Values On the Main Thread
Sort of a continuation of - https://developer.apple.com/forums/thread/813641 I've made a great effort to get NSURL -getResourceValue:forKey: calls etc off the main thread. Great progress. So now I'm working with a file on a really slow network volume I discovered a little hang and luckily enough I'm attached to the debugger so I paused that thing. I see where I'm at. It is: NSPathControl's setURL:. It goes a little something like this: in realpath$DARWIN_EXTSN () +fileSystemRealPath () +[FSNode(SandboxChecks) canAccessURL:withAuditToken:operation:] () +FSNode(SandboxChecks) canReadFromSandboxWithAuditToken:] () LaunchServices::URLPropertyProvider::prepareLocalizedNameValue () LaunchServices::URLPropertyProvider::prepareValues () prepareValuesForBitmap () FSURLCopyResourcePropertiesForKeysInternal () CFURLCopyResourcePropertiesForKeys () -[NSURL resourceValuesForKeys:error:] () in function signature specialization <Arg[1] = Dead> of Foundation._NSFileManagerBridge.displayName(atPath: Swift.String) -> Swift.String () in displayName () -[NSPathCell _autoUpdateCellContents] () -[NSPathCell setURL:] () Could maybe, NSPathControl get the display name etc. asynchronously? and maybe just stick raw path components in as a placeholder while it is reading async? Or something like that? If I can preload the resource keys it needs I would but once the NSURL asks on the main main thread I think it will just dump the cache out, per the run loop rules.
1
0
49
1d
Glass Effect Label Shadow Clipping During Morph Animation
Hi all, I’m experiencing a visual bug when applying the glass effect to a Label in Liquid Glass (current version 26.2 on simulator; also reproducible in 26.3.1 on device). Issue: On a label with .glassEffect(.regular), when collapsing via morph animation, the shadow is clipped during the animation, and then suddenly "pops" back to its un-clipped state, resulting in a jarring visual effect. Minimal Example: import SwiftUI struct ContentView: View { var body: some View { Menu { Button("Duplicate", action: {}) Button("Rename", action: {}) Button("Delete…", action: {}) } label: { Label("PDF", systemImage: "doc.fill") .padding() .glassEffect(.regular) } } } #Preview { ContentView() } I am not sure if I am misusing the .glassEffect() on the label and maybe there is another more native way of achieving this look? Any advice or workaround suggestions would be greatly appreciated!
2
0
56
1d
UISheetPresentationController Disable Liquid Glass For Foreground Elements Within a Sheet
Hello just wondering if there is a supported way to disable the liquid glass effect that is passed down to every subview within a sheet using the medium or smaller detents? There are certain views with information in them within this sheet that I do not want to become semi transparent but I want to keep the background view of the sheet using the default liquid glass effect.
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
87
2d
Third-party credential manager not appearing in Apple Passwords "Export Data to Another App" list — iOS 26
Hi, I'm building a third-party credential manager app and trying to get it listed as an eligible destination in Apple Passwords → Export Data to Another App on iOS 26 / macOS 26. The app never appears in the list, even on a physical device. What I've implemented so far: The main app and the Credential Provider Extension both have the com.apple.developer.authentication-services.autofill-credential-provider entitlement set. The extension's Info.plist has ASCredentialProviderExtensionCapabilities nested correctly under NSExtension → NSExtensionAttributes, with ProvidesPasskeys and ProvidesPasswords both set to true. Both targets share the same App Group. The extension is visible and selectable under Settings → General → AutoFill & Passwords — so the extension itself is working. I've also added ASCredentialImportManager and ASCredentialExportManager support to the app based on the AuthenticationServices SDK interfaces in Xcode 26. The specific question: What is the actual eligibility criteria for appearing in the "Export Data to Another App" destination list in Apple Passwords? Is there a specific Info.plist key, entitlement, or capability declaration required beyond what's already needed for the Credential Provider Extension? The WWDC25 session (279) mentions ASCredentialExportManager and ASCredentialImportManager but doesn't describe the discovery mechanism that determines which apps are listed. Currently, only Google Chrome appear in the list on my test device. I'd like to understand whether this is a capability/entitlement issue, an App Store review requirement, or a beta limitation that will open up later. Any guidance from the team would be greatly appreciated.
Topic: UI Frameworks SubTopic: General
2
0
155
3d
iPadOS 26: How to prevent new scene creation when sharing a file to my app?
Many different types of files can be opened in my app. If a user, for example, views a file in the Files app and chooses to share the file, they can select my app from the list of options. My app is then given a chance to handle the file as needed. This works just fine in most cases. However, on iPadOS 26, if the user has set the iPad's Multitasking to either Windowed Apps or Stage Manager, then any time they choose to share a file with my app, a new scene (and window) is created. The user is usually not even aware that more and more windows/scenes are being created. It's only after they long-press on the app icon and select Show All Windows (or look under the Open Windows section) do they see far more windows than expected. Under iPadOS 17, 18, or with 26 set to Full Screen Apps, sharing a file to my app simply uses an existing scene, even if the user has explicitly created multiple scenes. A new scene is never created when sharing a file to my app unless there is no existing scene. Due to the nature of my app, even if the user has setup the iPad with Windowed App or Stage Manager under iPadOS 26, it would be far better if a new scene was not created and an existing scene was used. In other words, have it behave just as it does under iPadOS 17 or 18, or with 26 set as Full Screen Apps. Is there any way to configure an app to always use an existing scene when a file is shared with the app? My app is written with UIKit. Under iPadOS 26 with multitasking set to Windowed Apps or Stage Manager, sharing a file with my app results in the UIApplicationDelegate method application(_:configurationForConnecting:options:) being called. At this point a new scene is already in the process of being created. I don't see anything that can be set in the Info.plist. I do not see any relevant UIApplicationDelegate methods. Am I missing something or is this not possible?
0
0
68
3d
PhaseAnimator doesn't reflect @Observable state changes after animation settles
I ran into a behavior with PhaseAnimator that I'm not sure is a bug or by design. I'd appreciate any insight. The Problem When an @Observable property is read only inside a PhaseAnimator content closure, changes to that property are ignored after the animation cycle completes and reaches its resting state. The UI gets stuck showing stale data. Minimal Reproduction I've put together a simple demo with two views side by side, both driven by the same ViewModel and toggled by the same button: BrokenView — receives an @Observable object and reads its property inside PhaseAnimator. After the animation completes, toggling the property has no visible effect. FixedView — receives the same value as a Bool parameter. Updates correctly every time because view's parameter has changed. import SwiftUI @Observable class ViewModel { var isError = false } struct BrokenView: View { let viewModel: ViewModel @State private var trigger = false var body: some View { VStack(spacing: 20) { Text("Broken (@Observable)").font(.headline) PhaseAnimator([false, true], trigger: trigger) { _ in if viewModel.isError { Text("Error!").foregroundStyle(.red).font(.largeTitle) } else { Text("OK").foregroundStyle(.green).font(.largeTitle) } } } .padding() .onAppear { trigger = true } } } struct FixedView: View { let isError: Bool @State private var trigger = false var body: some View { VStack(spacing: 20) { Text("Fixed (Value Type)").font(.headline) PhaseAnimator([false, true], trigger: trigger) { _ in if isError { Text("Error!").foregroundStyle(.red).font(.largeTitle) } else { Text("OK").foregroundStyle(.green).font(.largeTitle) } } } .padding() .onAppear { trigger = true } } } struct DemoView: View { @State private var viewModel = ViewModel() var body: some View { VStack(spacing: 40) { BrokenView(viewModel: viewModel) Divider() FixedView(isError: viewModel.isError) Divider() Button("Toggle isError: \(viewModel.isError)") { viewModel.isError.toggle() } .buttonStyle(.borderedProminent) } .padding() } } Run the preview, then tap the toggle button. FixedView updates instantly; BrokenView stays stuck. My Understanding It seems like PhaseAnimator only tracks @Observable access during active animation phases. Once it settles at rest, the content closure is not re-evaluated, so observation tracking is effectively lost. Passing a value type works because SwiftUI view diffing detects the input change and triggers a body re-evaluation, which in turn re-evaluates the PhaseAnimator content. Question Is this intended behavior? Or shouldn't I use phase animator in this way? I could not find any mention of this limitation in the documentation. If it is by design, it might be worth documenting — it is a subtle pitfall that is easy to miss. Thanks in advance for any input!
0
0
90
3d
Layout glitch after rotation when using UIWindowScene sizeRestrictions on iPadOS 26
Hi everyone, I am experiencing a strange rendering issue on iPadOS 26 when sizeRestrictions.minimumSize is set on a UIWindowScene. After rotating the device and then rotating it back to the original orientation, the window appears to be stretched based on its previous dimensions. This resulting "stretched" area does not resize or redraw correctly, leaving a significant black region on the screen. Interestingly, as soon as I interact with the window (e.g., a slight drag or touch), the UI snaps back to its intended state and redraws perfectly. Here is a sample code and capture of behavior. class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } windowScene.sizeRestrictions?.minimumSize = CGSize( width: 390, height: 844 // larger than the height of iPad in landscape ) // initialize... } } Has anyone else encountered this behavior? If so, are there any known workarounds to force a layout refresh or prevent this "ghost" black area during the rotation transition? Any insights would be greatly appreciated. Thanks!
0
0
78
3d
UIDocumentPickerViewController allows to select file declared in Info.plist document types even when restricting to folder UTI
My document-based UIKit app can open plain text files such as .txt files. When tapping a particular button I want to be able to select a folder, but when using the code below, the document picker allows me to select folders as well as .txt files: class DocumentViewController: UIDocumentViewController, UIDocumentPickerDelegate { override func viewDidAppear(_ animated: Bool) { let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.folder]) documentPicker.delegate = self present(documentPicker, animated: true) } } If I remove the text file entry from the Info.plist's document types list, it works as expected. Is this a bug and if yes, is there a workaround? <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>Text</string> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Default</string> <key>LSItemContentTypes</key> <array> <string>public.text</string> </array> </dict> </array> I created FB22254960.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
142
5d
NavigationSplitView macOS
I want to create SplitView App for macOS like Apple Mail. Is it possible using swiftUI NavigationSplitView or should I use AppKit to achieve it. I want exact toolbar buttons also. Filter button will be in Invoice list pane and other buttons in the details pane. Also, I want details pane completely collapsable(just like in Mail app).
Topic: UI Frameworks SubTopic: SwiftUI
2
0
114
5d
Can two NSPanel windows both display active/focused appearance simultaneously on macOS 26?
I'm building a macOS app with two separate NSPanel windows, both using the new liquid glass material (NSVisualEffectView / macOS 26). The UI intentionally has two separate floating panels visible at the same time. The problem: only the key window displays the active liquid glass appearance. The non-key panel always renders with the inactive/foggy appearance, even with: NSWindowStyleMaskNonactivatingPanel canBecomeKeyWindow = false orderFrontRegardless() addChildWindow(_:ordered:) Is there any way — documented or otherwise — to force the active liquid glass appearance on a non-key NSPanel? Or is this fundamentally a compositor-level restriction? If it's impossible with two separate windows, is there an alternative approach to achieve two visually separate liquid glass boxes that both appear active simultaneously?
1
0
54
1w
Create a font or font like set by choosing glyphs, transforming them, and putting the result into a structure?
My basic need is that I have unicode symbols which compose to a marked musical note. I'd like that note to be rotated upside down. Obviously, I could do this by sticking each into a View of some sort, and applying rotation effect. Indeed, I've done this for the part of my app where these notes are the labels of Buttons. However, the results of pressing the buttons need to be displayed, and on most of my app, this is a simple String. However, I can find no way to rotate individual glyphs of a String. And I'm not keen to write a compositor to layout View like glyphs in a String. Is there a way to make a font by finding individual glyphs, doing the transform, and packaging them into a new specialized font, without needed to use an external Font making application?
2
0
106
1w
How do you support Preferred Font Size / Dynamic Type on macOS?
On macOS 26, how do you support the Preferred Text Size value as defined in the Accessibility Settings? Historically, "Dynamic Type" has not been available on macOS. However, the user has some control over text size through the Accessibility Settings. On macOS 26, a small subset of applications are honouring changes to that value include Finder, Mail, and sidebars in many applications. Dynamic sizing in table views has been available on macOS for awhile. But Mail.app, in particular, is also adjusting the font sizes used in the message's body pane while the Finder is adjusting font sizes used for Desktop icons. I can't find an NSNotification that is fired when the user adjusts the Accessibility Text Size slider, nor can I find an API to read the current value. NSFont.preferredFont(forTextStyle:options:) looks promising but the fonts returned do not appear to take the user's Accessibility setting into account. (Nor do they update dynamically.) SwiftUI's Text("Apple").font(.body) performs similarly to NSFont in that it does respect the style, but it does not honour dynamic sizing. NSFontDescriptor has a bunch of interesting methods, but none that seem to apply to Accessibility Text Size. Given an AppKit label: let label = NSTextField(labelWithString: "AppKit") label.font = NSFont.preferredFont(forTextStyle: .body) Or a SwiftUI label: Text("SwiftUI").font(.body) How do I make either of them responsive to the user's Text Size setting under Accessibility? Note this is on macOS 26 / Xcode 26. I realize there have been some previous forum posts related to this issue but hoping that things might have improved since then.
2
0
426
1w
Back gesture not disabled with navigationBarBackButtonHidden(true) when using .zoom transition
[Submitted as FB22226720] For a NavigationStack destination, applying .navigationBarBackButtonHidden(true) hides the back button and also disables the interactive left-edge back gesture when using the standard push navigation transition. However, when the destination uses .navigationTransition(.zoom), the back button is hidden but the left-edge back gesture is still available—it can still be dismissed even though back is intentionally suppressed. This creates inconsistent behavior between navigation transition styles. navigationBarBackButtonHidden(_:) works with a standard push transition, but not with .navigationTransition(.zoom). In the code below, .interactiveDismissDisabled(true) is also applied as another attempt to suppress the back-swipe gesture, but it has no effect. As a result, there’s currently no clean way to prevent back navigation when using the zoom transition. REPRO STEPS Create an iOS project then replace ContentView with code below, build and run. Leave nav type set to List Push. Open an item. Verify there is no back button, then try the left-edge back gesture. Return to the root view. Change nav type to Grid Zoom. Open an item. Verify there is no back button, then try the left-edge back gesture. ACTUAL In List Push mode, the left-edge back gesture is prevented. In Grid Zoom mode, the back button is hidden, but the left-edge back gesture still works and returns to the previous view. EXPECTED Behavior should be consistent across navigation transition styles. If this configuration is meant to suppress interactive backward navigation for a destination, it should also suppress the left-edge back gesture when using .navigationTransition(.zoom). SCREEN RECORDING SAMPLE CODE struct ContentView: View { private enum NavigationMode: String, CaseIterable { case listPush = "List Push" case gridZoom = "Grid Zoom" } @Namespace private var namespace @State private var navigationMode: NavigationMode = .listPush private let colors: [Color] = [.red, .blue] var body: some View { NavigationStack { VStack(spacing: 16) { Picker("Navigation Type", selection: $navigationMode) { ForEach(NavigationMode.allCases, id: \.self) { mode in Text(mode.rawValue).tag(mode) } } .pickerStyle(.segmented) if navigationMode == .gridZoom { HStack { ForEach(colors.indices, id: \.self) { index in NavigationLink(value: index) { VStack { RoundedRectangle(cornerRadius: 14) .fill(colors[index]) .frame(height: 120) Text("Grid Item \(index + 1)") .font(.subheadline.weight(.medium)) } .padding(12) .frame(maxWidth: .infinity) .background(.quaternary.opacity(0.25), in: RoundedRectangle(cornerRadius: 16)) .matchedTransitionSource(id: index, in: namespace) } .buttonStyle(.plain) } } } else { ForEach(colors.indices, id: \.self) { index in NavigationLink(value: index) { HStack { Circle() .fill(colors[index]) .frame(width: 24, height: 24) Text("List Item \(index + 1)") Spacer() Image(systemName: "chevron.right") .foregroundStyle(.secondary) } .padding() .background(.quaternary.opacity(0.25), in: RoundedRectangle(cornerRadius: 12)) } .buttonStyle(.plain) } } Spacer() } .padding(20) .navigationTitle("Prevent Back Swipe") .navigationSubtitle("Compare Grid Zoom vs List Push") .navigationDestination(for: Int.self) { index in if navigationMode == .gridZoom { DetailView(color: colors[index]) .navigationTransition(.zoom(sourceID: index, in: namespace)) } else { DetailView(color: colors[index]) } } } } } private struct DetailView: View { @Environment(\.dismiss) private var dismiss let color: Color var body: some View { ZStack { color.ignoresSafeArea() Text("Try left-edge swipe back") .font(.title.bold()) .multilineTextAlignment(.center) .padding(.horizontal, 24) } .navigationBarBackButtonHidden(true) .interactiveDismissDisabled(true) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Close", action: dismiss.callAsFunction) } } } }
2
0
557
1w
UI Testing for iPadOS 26 Menu Bar items
I need to validate whether specific menu items are correctly enabled/disabled. The XCUIAutomation elements for my menu items do not appear in the tree shown by displaying the XCUIApplication object in the debugger when building and testing the iPadOS version of my application. When running the application in an iPad simulator, I can make the menu bar appear by swiping down. The testing works as expected for the MacOS build and test. I did try to use the recording feature, but was not successful in creating a series of commands that worked for a test run.
0
0
214
1w
Is it a bug in UIActivityViewController to Airdrop ?
Context: Xcode 26.3, iOS 18.7.6 on iPhone Xs In this iOS app, I call UIActivityViewController to let user Airdrop files from the app. When trying to send a URL whose file name contains some characters like accentuated (-, é, '), the transfer fails. Removing those characters makes it work without problem. The same app running on Mac (in iPad mode) works with both cases. I also noticed that even when airdrop fails, there is no error reported by activityVC.completionWithItemsHandler = { activity, success, items, error in } Are those known issues ?
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
249
1w
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
Replies
0
Boosts
0
Views
865
Activity
Jun ’25
Xcode 26.3 Simulator renders SwiftUI app only inside a rounded rectangle instead of full screen
Hi everyone, I’m seeing a strange rendering issue in Xcode 26.3 that seems to affect only the iOS Simulator. Environment: Xcode 26.3 SwiftUI app Reproduces in Simulator only Reproduces across multiple simulator device models My code is just a minimal example Expected behavior: The view should fill the entire screen. Actual behavior: The app content is rendered only inside a centered rounded rectangle/card-like area, with black space around it, as if the app canvas is being clipped incorrectly. Minimal reproduction: import SwiftUI @main struct LayoutShowcaseApp: App { var body: some Scene { WindowGroup { Color.green.ignoresSafeArea() } } } I also tried wrapping it in a ZStack and using: .frame(maxWidth: .infinity, maxHeight: .infinity) .background(...) .ignoresSafeArea() but the result is the same. What I already tried: Clean Build Folder Switching simulator device models Resetting simulator content/settings Rebuilding from a fresh minimal SwiftUI project Since this happens with such a minimal example, it looks more like a Simulator/runtime rendering bug than a SwiftUI layout issue. Has anyone else seen this on Xcode 26.3? If yes, did you find any workaround? Thanks.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
31
Activity
4h
iOS 26: Toolbar button background flashes black during NavigationStack transitions (dark mode)
I’m seeing a visual glitch with toolbar buttons when building with Xcode 26 for iOS 26. During transitions (both pushing in a NavigationStack and presenting a .sheet with its own NavigationStack), the toolbar button briefly flashes the wrong background colour (black in dark mode, white in light mode) before animating to the correct Liquid Glass appearance. This happens even in a minimal example and only seems to affect system toolbar buttons. A custom view with .glassEffect() doesn’t have the issue. I’ve tried: .tint(...), UINavigationBarAppearance/UIToolbarAppearance, and setting backgrounds on hosting/nav/window but none of those made any difference. Here’s a minimal reproducible example: import SwiftUI struct ContentView: View { @State private var showingSheet = false var body: some View { NavigationStack { List { NavigationLink("Push (same stack — morphs)") { DetailView() } Button("Sheet (separate stack — flashes)") { showingSheet = true } } .navigationTitle("Root") .scrollContentBackground(.hidden) .background(.gray) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Action") {} } } .sheet(isPresented: $showingSheet) { SheetView() } } } } struct DetailView: View { var body: some View { Text("Detail (same stack)") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.gray) .navigationTitle("Detail") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Action") {} } } } } struct SheetView: View { var body: some View { NavigationStack { Text("Sheet (separate stack)") .frame(maxWidth: .infinity, maxHeight: .infinity) .background(.gray) .navigationTitle("Sheet") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Action") {} } } } } } Has anyone else seen this or found a workaround outside of disabling this background completely with .sharedBackgroundVisibility(.hidden)? I have filed a bug report under FB22141183
Replies
0
Boosts
0
Views
75
Activity
12h
NSImage with HDR-disabled image causes freezing for window resize
I have regular NSImage from iPhone and the drawing get's extremely choppy during window resize (especially at small window sizes below 100px). When the window size is large there is no problem with drawing and CPU utilization is low. I have tried kCGImageSourceDecodeToSDR + or another NSImage from CGImage but the CPU utilization is extreme at small sizes. Non-HDR images don't have problems with drawing at small sizes. Video example: https://youtu.be/x8iAYGCyACs import AppKit import AVFoundation class ImageBackgroundView: NSView { @Invalidating(.display) var image: NSImage? = nil override var clipsToBounds: Bool { set { } get { true } } override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) NSColor.red.setFill() dirtyRect.fill() guard let image = image else { return } // Calculate aspect-fit rect using AVFoundation let imageSize = image.size let targetRect = bounds let drawRect = AVMakeRect(aspectRatio: imageSize, insideRect: targetRect) image.draw(in: drawRect) } } Copy import Cocoa import UniformTypeIdentifiers class ViewController: NSViewController { @IBOutlet weak var imageView: ImageBackgroundView! @IBAction func buttonAction(_ sender: Any) { let panel = NSOpenPanel() panel.allowedContentTypes = NSImage.imageTypes.compactMap { UTType($0) } panel.begin { response in let nonHDROptions = [ kCGImageSourceDecodeRequest : kCGImageSourceDecodeToSDR, kCGImageSourceDecodeRequestOptions: [kCGComputeHDRStats: false] ] as CFDictionary guard response == .OK, let url = panel.url, let source = CGImageSourceCreateWithURL(url as CFURL, nil), let cgImage = CGImageSourceCreateImageAtIndex(source, 0, nonHDROptions) else { return } self.imageView.image = NSImage(cgImage: cgImage, size: NSMakeSize(CGFloat(cgImage.width), CGFloat(cgImage.height))) } } } Time profiler with HDR NSImage: Time profiler with NSImage + kCGImageSourceDecodeToSDR:
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
1
Boosts
0
Views
126
Activity
22h
Now Available: Wishlist Sample Code for SwiftUI
We’ve just added a new sample code project to the SwiftUI Essentials documentation! If you attended the recent SwiftUI foundations: Build great apps with SwiftUI activity, you might recognize Wishlist, our travel-planning sample app. You can now explore and download the complete project here
Replies
0
Boosts
1
Views
38
Activity
1d
NSPathControl Causing Disk I/O Reading NSURL Resource Values On the Main Thread
Sort of a continuation of - https://developer.apple.com/forums/thread/813641 I've made a great effort to get NSURL -getResourceValue:forKey: calls etc off the main thread. Great progress. So now I'm working with a file on a really slow network volume I discovered a little hang and luckily enough I'm attached to the debugger so I paused that thing. I see where I'm at. It is: NSPathControl's setURL:. It goes a little something like this: in realpath$DARWIN_EXTSN () +fileSystemRealPath () +[FSNode(SandboxChecks) canAccessURL:withAuditToken:operation:] () +FSNode(SandboxChecks) canReadFromSandboxWithAuditToken:] () LaunchServices::URLPropertyProvider::prepareLocalizedNameValue () LaunchServices::URLPropertyProvider::prepareValues () prepareValuesForBitmap () FSURLCopyResourcePropertiesForKeysInternal () CFURLCopyResourcePropertiesForKeys () -[NSURL resourceValuesForKeys:error:] () in function signature specialization <Arg[1] = Dead> of Foundation._NSFileManagerBridge.displayName(atPath: Swift.String) -> Swift.String () in displayName () -[NSPathCell _autoUpdateCellContents] () -[NSPathCell setURL:] () Could maybe, NSPathControl get the display name etc. asynchronously? and maybe just stick raw path components in as a placeholder while it is reading async? Or something like that? If I can preload the resource keys it needs I would but once the NSURL asks on the main main thread I think it will just dump the cache out, per the run loop rules.
Replies
1
Boosts
0
Views
49
Activity
1d
Glass Effect Label Shadow Clipping During Morph Animation
Hi all, I’m experiencing a visual bug when applying the glass effect to a Label in Liquid Glass (current version 26.2 on simulator; also reproducible in 26.3.1 on device). Issue: On a label with .glassEffect(.regular), when collapsing via morph animation, the shadow is clipped during the animation, and then suddenly "pops" back to its un-clipped state, resulting in a jarring visual effect. Minimal Example: import SwiftUI struct ContentView: View { var body: some View { Menu { Button("Duplicate", action: {}) Button("Rename", action: {}) Button("Delete…", action: {}) } label: { Label("PDF", systemImage: "doc.fill") .padding() .glassEffect(.regular) } } } #Preview { ContentView() } I am not sure if I am misusing the .glassEffect() on the label and maybe there is another more native way of achieving this look? Any advice or workaround suggestions would be greatly appreciated!
Replies
2
Boosts
0
Views
56
Activity
1d
UISheetPresentationController Disable Liquid Glass For Foreground Elements Within a Sheet
Hello just wondering if there is a supported way to disable the liquid glass effect that is passed down to every subview within a sheet using the medium or smaller detents? There are certain views with information in them within this sheet that I do not want to become semi transparent but I want to keep the background view of the sheet using the default liquid glass effect.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
0
Boosts
0
Views
87
Activity
2d
Third-party credential manager not appearing in Apple Passwords "Export Data to Another App" list — iOS 26
Hi, I'm building a third-party credential manager app and trying to get it listed as an eligible destination in Apple Passwords → Export Data to Another App on iOS 26 / macOS 26. The app never appears in the list, even on a physical device. What I've implemented so far: The main app and the Credential Provider Extension both have the com.apple.developer.authentication-services.autofill-credential-provider entitlement set. The extension's Info.plist has ASCredentialProviderExtensionCapabilities nested correctly under NSExtension → NSExtensionAttributes, with ProvidesPasskeys and ProvidesPasswords both set to true. Both targets share the same App Group. The extension is visible and selectable under Settings → General → AutoFill & Passwords — so the extension itself is working. I've also added ASCredentialImportManager and ASCredentialExportManager support to the app based on the AuthenticationServices SDK interfaces in Xcode 26. The specific question: What is the actual eligibility criteria for appearing in the "Export Data to Another App" destination list in Apple Passwords? Is there a specific Info.plist key, entitlement, or capability declaration required beyond what's already needed for the Credential Provider Extension? The WWDC25 session (279) mentions ASCredentialExportManager and ASCredentialImportManager but doesn't describe the discovery mechanism that determines which apps are listed. Currently, only Google Chrome appear in the list on my test device. I'd like to understand whether this is a capability/entitlement issue, an App Store review requirement, or a beta limitation that will open up later. Any guidance from the team would be greatly appreciated.
Topic: UI Frameworks SubTopic: General
Replies
2
Boosts
0
Views
155
Activity
3d
iPadOS 26: How to prevent new scene creation when sharing a file to my app?
Many different types of files can be opened in my app. If a user, for example, views a file in the Files app and chooses to share the file, they can select my app from the list of options. My app is then given a chance to handle the file as needed. This works just fine in most cases. However, on iPadOS 26, if the user has set the iPad's Multitasking to either Windowed Apps or Stage Manager, then any time they choose to share a file with my app, a new scene (and window) is created. The user is usually not even aware that more and more windows/scenes are being created. It's only after they long-press on the app icon and select Show All Windows (or look under the Open Windows section) do they see far more windows than expected. Under iPadOS 17, 18, or with 26 set to Full Screen Apps, sharing a file to my app simply uses an existing scene, even if the user has explicitly created multiple scenes. A new scene is never created when sharing a file to my app unless there is no existing scene. Due to the nature of my app, even if the user has setup the iPad with Windowed App or Stage Manager under iPadOS 26, it would be far better if a new scene was not created and an existing scene was used. In other words, have it behave just as it does under iPadOS 17 or 18, or with 26 set as Full Screen Apps. Is there any way to configure an app to always use an existing scene when a file is shared with the app? My app is written with UIKit. Under iPadOS 26 with multitasking set to Windowed Apps or Stage Manager, sharing a file with my app results in the UIApplicationDelegate method application(_:configurationForConnecting:options:) being called. At this point a new scene is already in the process of being created. I don't see anything that can be set in the Info.plist. I do not see any relevant UIApplicationDelegate methods. Am I missing something or is this not possible?
Replies
0
Boosts
0
Views
68
Activity
3d
PhaseAnimator doesn't reflect @Observable state changes after animation settles
I ran into a behavior with PhaseAnimator that I'm not sure is a bug or by design. I'd appreciate any insight. The Problem When an @Observable property is read only inside a PhaseAnimator content closure, changes to that property are ignored after the animation cycle completes and reaches its resting state. The UI gets stuck showing stale data. Minimal Reproduction I've put together a simple demo with two views side by side, both driven by the same ViewModel and toggled by the same button: BrokenView — receives an @Observable object and reads its property inside PhaseAnimator. After the animation completes, toggling the property has no visible effect. FixedView — receives the same value as a Bool parameter. Updates correctly every time because view's parameter has changed. import SwiftUI @Observable class ViewModel { var isError = false } struct BrokenView: View { let viewModel: ViewModel @State private var trigger = false var body: some View { VStack(spacing: 20) { Text("Broken (@Observable)").font(.headline) PhaseAnimator([false, true], trigger: trigger) { _ in if viewModel.isError { Text("Error!").foregroundStyle(.red).font(.largeTitle) } else { Text("OK").foregroundStyle(.green).font(.largeTitle) } } } .padding() .onAppear { trigger = true } } } struct FixedView: View { let isError: Bool @State private var trigger = false var body: some View { VStack(spacing: 20) { Text("Fixed (Value Type)").font(.headline) PhaseAnimator([false, true], trigger: trigger) { _ in if isError { Text("Error!").foregroundStyle(.red).font(.largeTitle) } else { Text("OK").foregroundStyle(.green).font(.largeTitle) } } } .padding() .onAppear { trigger = true } } } struct DemoView: View { @State private var viewModel = ViewModel() var body: some View { VStack(spacing: 40) { BrokenView(viewModel: viewModel) Divider() FixedView(isError: viewModel.isError) Divider() Button("Toggle isError: \(viewModel.isError)") { viewModel.isError.toggle() } .buttonStyle(.borderedProminent) } .padding() } } Run the preview, then tap the toggle button. FixedView updates instantly; BrokenView stays stuck. My Understanding It seems like PhaseAnimator only tracks @Observable access during active animation phases. Once it settles at rest, the content closure is not re-evaluated, so observation tracking is effectively lost. Passing a value type works because SwiftUI view diffing detects the input change and triggers a body re-evaluation, which in turn re-evaluates the PhaseAnimator content. Question Is this intended behavior? Or shouldn't I use phase animator in this way? I could not find any mention of this limitation in the documentation. If it is by design, it might be worth documenting — it is a subtle pitfall that is easy to miss. Thanks in advance for any input!
Replies
0
Boosts
0
Views
90
Activity
3d
Layout glitch after rotation when using UIWindowScene sizeRestrictions on iPadOS 26
Hi everyone, I am experiencing a strange rendering issue on iPadOS 26 when sizeRestrictions.minimumSize is set on a UIWindowScene. After rotating the device and then rotating it back to the original orientation, the window appears to be stretched based on its previous dimensions. This resulting "stretched" area does not resize or redraw correctly, leaving a significant black region on the screen. Interestingly, as soon as I interact with the window (e.g., a slight drag or touch), the UI snaps back to its intended state and redraws perfectly. Here is a sample code and capture of behavior. class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } windowScene.sizeRestrictions?.minimumSize = CGSize( width: 390, height: 844 // larger than the height of iPad in landscape ) // initialize... } } Has anyone else encountered this behavior? If so, are there any known workarounds to force a layout refresh or prevent this "ghost" black area during the rotation transition? Any insights would be greatly appreciated. Thanks!
Replies
0
Boosts
0
Views
78
Activity
3d
Is it safe to assume UIActivity is isolated to MainActor?
UIActivity is not annotated with concurrency information. Does anyone know if subclasses you create will always run on the @MainActor ?
Replies
1
Boosts
0
Views
83
Activity
4d
UIDocumentPickerViewController allows to select file declared in Info.plist document types even when restricting to folder UTI
My document-based UIKit app can open plain text files such as .txt files. When tapping a particular button I want to be able to select a folder, but when using the code below, the document picker allows me to select folders as well as .txt files: class DocumentViewController: UIDocumentViewController, UIDocumentPickerDelegate { override func viewDidAppear(_ animated: Bool) { let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.folder]) documentPicker.delegate = self present(documentPicker, animated: true) } } If I remove the text file entry from the Info.plist's document types list, it works as expected. Is this a bug and if yes, is there a workaround? <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>Text</string> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Default</string> <key>LSItemContentTypes</key> <array> <string>public.text</string> </array> </dict> </array> I created FB22254960.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
2
Boosts
0
Views
142
Activity
5d
NavigationSplitView macOS
I want to create SplitView App for macOS like Apple Mail. Is it possible using swiftUI NavigationSplitView or should I use AppKit to achieve it. I want exact toolbar buttons also. Filter button will be in Invoice list pane and other buttons in the details pane. Also, I want details pane completely collapsable(just like in Mail app).
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
114
Activity
5d
Can two NSPanel windows both display active/focused appearance simultaneously on macOS 26?
I'm building a macOS app with two separate NSPanel windows, both using the new liquid glass material (NSVisualEffectView / macOS 26). The UI intentionally has two separate floating panels visible at the same time. The problem: only the key window displays the active liquid glass appearance. The non-key panel always renders with the inactive/foggy appearance, even with: NSWindowStyleMaskNonactivatingPanel canBecomeKeyWindow = false orderFrontRegardless() addChildWindow(_:ordered:) Is there any way — documented or otherwise — to force the active liquid glass appearance on a non-key NSPanel? Or is this fundamentally a compositor-level restriction? If it's impossible with two separate windows, is there an alternative approach to achieve two visually separate liquid glass boxes that both appear active simultaneously?
Replies
1
Boosts
0
Views
54
Activity
1w
Create a font or font like set by choosing glyphs, transforming them, and putting the result into a structure?
My basic need is that I have unicode symbols which compose to a marked musical note. I'd like that note to be rotated upside down. Obviously, I could do this by sticking each into a View of some sort, and applying rotation effect. Indeed, I've done this for the part of my app where these notes are the labels of Buttons. However, the results of pressing the buttons need to be displayed, and on most of my app, this is a simple String. However, I can find no way to rotate individual glyphs of a String. And I'm not keen to write a compositor to layout View like glyphs in a String. Is there a way to make a font by finding individual glyphs, doing the transform, and packaging them into a new specialized font, without needed to use an external Font making application?
Replies
2
Boosts
0
Views
106
Activity
1w
How do you support Preferred Font Size / Dynamic Type on macOS?
On macOS 26, how do you support the Preferred Text Size value as defined in the Accessibility Settings? Historically, "Dynamic Type" has not been available on macOS. However, the user has some control over text size through the Accessibility Settings. On macOS 26, a small subset of applications are honouring changes to that value include Finder, Mail, and sidebars in many applications. Dynamic sizing in table views has been available on macOS for awhile. But Mail.app, in particular, is also adjusting the font sizes used in the message's body pane while the Finder is adjusting font sizes used for Desktop icons. I can't find an NSNotification that is fired when the user adjusts the Accessibility Text Size slider, nor can I find an API to read the current value. NSFont.preferredFont(forTextStyle:options:) looks promising but the fonts returned do not appear to take the user's Accessibility setting into account. (Nor do they update dynamically.) SwiftUI's Text("Apple").font(.body) performs similarly to NSFont in that it does respect the style, but it does not honour dynamic sizing. NSFontDescriptor has a bunch of interesting methods, but none that seem to apply to Accessibility Text Size. Given an AppKit label: let label = NSTextField(labelWithString: "AppKit") label.font = NSFont.preferredFont(forTextStyle: .body) Or a SwiftUI label: Text("SwiftUI").font(.body) How do I make either of them responsive to the user's Text Size setting under Accessibility? Note this is on macOS 26 / Xcode 26. I realize there have been some previous forum posts related to this issue but hoping that things might have improved since then.
Replies
2
Boosts
0
Views
426
Activity
1w
Back gesture not disabled with navigationBarBackButtonHidden(true) when using .zoom transition
[Submitted as FB22226720] For a NavigationStack destination, applying .navigationBarBackButtonHidden(true) hides the back button and also disables the interactive left-edge back gesture when using the standard push navigation transition. However, when the destination uses .navigationTransition(.zoom), the back button is hidden but the left-edge back gesture is still available—it can still be dismissed even though back is intentionally suppressed. This creates inconsistent behavior between navigation transition styles. navigationBarBackButtonHidden(_:) works with a standard push transition, but not with .navigationTransition(.zoom). In the code below, .interactiveDismissDisabled(true) is also applied as another attempt to suppress the back-swipe gesture, but it has no effect. As a result, there’s currently no clean way to prevent back navigation when using the zoom transition. REPRO STEPS Create an iOS project then replace ContentView with code below, build and run. Leave nav type set to List Push. Open an item. Verify there is no back button, then try the left-edge back gesture. Return to the root view. Change nav type to Grid Zoom. Open an item. Verify there is no back button, then try the left-edge back gesture. ACTUAL In List Push mode, the left-edge back gesture is prevented. In Grid Zoom mode, the back button is hidden, but the left-edge back gesture still works and returns to the previous view. EXPECTED Behavior should be consistent across navigation transition styles. If this configuration is meant to suppress interactive backward navigation for a destination, it should also suppress the left-edge back gesture when using .navigationTransition(.zoom). SCREEN RECORDING SAMPLE CODE struct ContentView: View { private enum NavigationMode: String, CaseIterable { case listPush = "List Push" case gridZoom = "Grid Zoom" } @Namespace private var namespace @State private var navigationMode: NavigationMode = .listPush private let colors: [Color] = [.red, .blue] var body: some View { NavigationStack { VStack(spacing: 16) { Picker("Navigation Type", selection: $navigationMode) { ForEach(NavigationMode.allCases, id: \.self) { mode in Text(mode.rawValue).tag(mode) } } .pickerStyle(.segmented) if navigationMode == .gridZoom { HStack { ForEach(colors.indices, id: \.self) { index in NavigationLink(value: index) { VStack { RoundedRectangle(cornerRadius: 14) .fill(colors[index]) .frame(height: 120) Text("Grid Item \(index + 1)") .font(.subheadline.weight(.medium)) } .padding(12) .frame(maxWidth: .infinity) .background(.quaternary.opacity(0.25), in: RoundedRectangle(cornerRadius: 16)) .matchedTransitionSource(id: index, in: namespace) } .buttonStyle(.plain) } } } else { ForEach(colors.indices, id: \.self) { index in NavigationLink(value: index) { HStack { Circle() .fill(colors[index]) .frame(width: 24, height: 24) Text("List Item \(index + 1)") Spacer() Image(systemName: "chevron.right") .foregroundStyle(.secondary) } .padding() .background(.quaternary.opacity(0.25), in: RoundedRectangle(cornerRadius: 12)) } .buttonStyle(.plain) } } Spacer() } .padding(20) .navigationTitle("Prevent Back Swipe") .navigationSubtitle("Compare Grid Zoom vs List Push") .navigationDestination(for: Int.self) { index in if navigationMode == .gridZoom { DetailView(color: colors[index]) .navigationTransition(.zoom(sourceID: index, in: namespace)) } else { DetailView(color: colors[index]) } } } } } private struct DetailView: View { @Environment(\.dismiss) private var dismiss let color: Color var body: some View { ZStack { color.ignoresSafeArea() Text("Try left-edge swipe back") .font(.title.bold()) .multilineTextAlignment(.center) .padding(.horizontal, 24) } .navigationBarBackButtonHidden(true) .interactiveDismissDisabled(true) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Close", action: dismiss.callAsFunction) } } } }
Replies
2
Boosts
0
Views
557
Activity
1w
UI Testing for iPadOS 26 Menu Bar items
I need to validate whether specific menu items are correctly enabled/disabled. The XCUIAutomation elements for my menu items do not appear in the tree shown by displaying the XCUIApplication object in the debugger when building and testing the iPadOS version of my application. When running the application in an iPad simulator, I can make the menu bar appear by swiping down. The testing works as expected for the MacOS build and test. I did try to use the recording feature, but was not successful in creating a series of commands that worked for a test run.
Replies
0
Boosts
0
Views
214
Activity
1w
Is it a bug in UIActivityViewController to Airdrop ?
Context: Xcode 26.3, iOS 18.7.6 on iPhone Xs In this iOS app, I call UIActivityViewController to let user Airdrop files from the app. When trying to send a URL whose file name contains some characters like accentuated (-, é, '), the transfer fails. Removing those characters makes it work without problem. The same app running on Mac (in iPad mode) works with both cases. I also noticed that even when airdrop fails, there is no error reported by activityVC.completionWithItemsHandler = { activity, success, items, error in } Are those known issues ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
4
Boosts
0
Views
249
Activity
1w