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

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
3d
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
105
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
DynamicViewContent and drop validation (macOS)
If I see it correctly, it is currently not possible to validate a drop operation on a DynamicViewContent when using dropDestination? Just a simple example: Let's say I build a folder view on macOS where I can arrange folders freely. In this case I need to use DynamicViewContent.dropDestination to get an insertion index on drop. However, it seems that methods like dropConfiguration do not have any effect. Als dropDestionation(…, isTargeted:) seems not to be available. Here is my sample code: struct FolderRow: View { let folder: Folder var body: some View { DisclosureGroup(isExpanded: .constant(true)) { ForEach(folder.children) { child in FolderRow(folder: child) } .dropDestination(for: Folder.self) { item, idx in print("Dropped at \(idx)") } } label: { Label(folder.name, systemImage: "folder") .draggable(folder) .dropDestination(for: Folder.self) { items, _ in print("Dropped on Item") } } .dropConfiguration { session in DropConfiguration(operation: .move) } } } struct ContentView: View { @State private var folder: Folder = Folder.sampleData @State private var selection: Set<UUID> = [] var body: some View { NavigationSplitView { List(selection: $selection) { FolderRow(folder: folder) } } detail: { EmptyView() } } } The dropConfiguration is applied on the Label (in this case the "Move" cursor is used instead of the "Copy" cursor). Is there any way to do that or is it just an omission in Swift UI?
2
0
176
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
4d
NSProgress - way to publish progress to make the file url unselectable in Finder?
So I'm in the middle of an asynchronous file operation. I publish an NSProgress and it displays wonderfully in Finder. But it is a folder and while the operation is in progress the user should not be allowed to enter it, modify it, etc, while the work is being done. I want to do this to protect the user from doing something silly. But Finder does not prevent the selection with the published progress. And while it would be kind of dumb to do - the user can just go about adding/removing contents to the folder while it has progress. If I remember correctly publishing an NSProgress did use to prevent the file from being selectable in Finder until either the progress finished or my app is quit (or maybe not)? But now the user is free to select, edit, modify during progress which could cause problems if the user does something unexpectedly silly. Is there a way to mark the file 'unselectable' with the published progress? Thanks in advance.
7
0
564
4d
iOS 26+ UITabBar unselected item colors not updating with UITabBarAppearance
I'm using UITabBarAppearance to customize my TabBar in a SwiftUI app. The customization works perfectly on iOS 18 and earlier, but after updating to iOS 26, the unselected tab items no longer respect my color settings - they just appear black (they are on a white background).Here's my simplified setup: struct ContentView: View { var body: some View { TabView { Text("Home") .tabItem { Image(systemName: "house") Text("Home") } .tag(0) Text("Settings") .tabItem { Image(systemName: "gear") Text("Settings") } .tag(1) } .onAppear { setupTabBarAppearance() } } private func setupTabBarAppearance() { let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() let itemAppearance = UITabBarItemAppearance() // These settings work for selected items itemAppearance.selected.iconColor = .systemBlue itemAppearance.selected.titleTextAttributes = [ .font: UIFont.systemFont(ofSize: 10), .foregroundColor: UIColor.systemBlue ] // These settings STOPPED working on iOS 26 for unselected items itemAppearance.normal.iconColor = .gray itemAppearance.normal.titleTextAttributes = [ .font: UIFont.systemFont(ofSize: 10), .foregroundColor: UIColor.gray ] appearance.stackedLayoutAppearance = itemAppearance appearance.inlineLayoutAppearance = itemAppearance appearance.compactInlineLayoutAppearance = itemAppearance UITabBar.appearance().standardAppearance = appearance UITabBar.appearance().scrollEdgeAppearance = appearance } }
1
0
106
4d
ShareLink "Save Image" action dismisses presenting view after saving
When using ShareLink in SwiftUI to share an image, the “Save Image” action dismisses not only the share sheet but also the presenting SwiftUI view. The behavior differs depending on whether the photo library permission alert appears. Observed behavior: The first time the user taps Save Image, the system permission alert appears. After granting permission, the image saves successfully and the share sheet dismisses normally. On subsequent attempts, the image is saved successfully, but both the share sheet and the presenting view are dismissed unexpectedly. Expected behavior: After saving the image, only the share sheet should dismiss. The presenting SwiftUI view should remain visible. Steps to Reproduce Present a SwiftUI view using .sheet. Inside that view, add a ShareLink configured to export a PNG image using Transferable. Tap the ShareLink button. Choose Save Image. Grant permission the first time (if prompted). Repeat the action. Result: On subsequent saves, the share sheet dismisses and the presenting view is dismissed as well. Sample code ` internal import System import UniformTypeIdentifiers import SwiftUI struct RootView: View { @State private var isPresented: Bool = false var body: some View { ZStack { Color.white Button("Show parent view") { isPresented = true } } .sheet(isPresented: $isPresented) { ParentView() } } } struct ParentView: View { @State private var isPresented: Bool = false var body: some View { NavigationStack { ZStack { Color.red.opacity(0.5) } .toolbar { ToolbarItem() { let name = "\(UUID().uuidString)" let image = UIImage(named: "after")! return ShareLink( item: ShareableImage(image: image, fileName: name), preview: SharePreview( name, image: Image(uiImage: image) ) ) { Image(uiImage: UIImage(resource: .Icons.share24)) .resizable() .foregroundStyle(Color.black) .frame(width: 24, height: 24) } } } } } } struct ShareableImage: Transferable { let image: UIImage let fileName: String static var transferRepresentation: some TransferRepresentation { FileRepresentation(exportedContentType: .png) { item in let fileURL = FileManager.default.temporaryDirectory .appendingPathComponent(item.fileName) .appendingPathExtension("png") guard let data = item.image.pngData() else { throw NSError(domain: "ImageEncodingError", code: 0) } try data.write(to: fileURL) return SentTransferredFile(fileURL) } } } `
1
0
54
4d
Korean IME forces Smart Quotes, ignoring UITextInputTraits and OS Settings
There is a long-standing, structural issue with the iPadOS Korean IME when using a hardware keyboard. The IME forcibly intercepts the " (quote) keydown event and injects Unicode smart/curved quotes (“ or ”) directly into the text field. This hardcoded behavior ignores both: User Settings: The global "Smart Punctuation" toggle in [Settings > General > Keyboard] is completely ignored. Developer APIs: Setting UITextInputTraits.smartQuotesType = .no on a UITextView or UITextField has absolutely no effect when the Korean keyboard is active. Steps to Reproduce: Set smartQuotesType = .no on a standard UITextView. Connect a hardware keyboard. Switch input language to English -> Press the quote key. (Result: ASCII straight quote " - Correct behavior) Switch input language to Korean -> Press the quote key. (Result: Unicode curved quote “ - Incorrect behavior) Impact on Developers & Users: Because the OS IME forcefully injects the curved Unicode character before the app can process the raw key event, developers building code editors, markdown editors, or specific word processors (like Google Docs) cannot prevent this behavior. We cannot provide a standard text-editing experience for Korean users without forcing them to manually toggle their keyboard language to English just to type a straight quote. Expected Behavior: The Korean hardware keyboard IME must respect UITextInputTraits.smartQuotesType and the global OS toggle. Please provide a mechanism for developers and users to bypass this forced CJK typography rule.
1
0
56
4d
MultiDatePicker bug in iOS26
Hi! I've encountered strange bug in iOS 26. The MultiDatePicker component exhibits unreliable behavior when attempting to deselect previously chosen dates. Users often need to tap a selected date multiple times (e.g., tap to deselect, tap to re-select, then tap again to deselect) for the UI to correctly register the deselection and update the displayed state. This issue does not occur on iOS 18 or Xcode 26 previews, where MultiDatePicker functions as expected, allowing single-tap deselection. The bug only occurs on physical device or simulator. I can't lie, I have multidatepicker as crucial component in my larger app and can't really find a solution to this. Has anyone encountered this problem before? Here is the code to replicate the issue: import SwiftUI struct ContentView: View {     @ State private var selectedDates: Set = []     var body: some View {         NavigationStack {             Form {                 Section {                     MultiDatePicker("Select Dates", selection: $selectedDates)                 } header: {                     Text("MultiDatePicker Bug Test")                 }                 Section {                     Text("Selected Dates Count: (selectedDates.count)")                     ForEach(Array(selectedDates).sorted(by: {                         Calendar.current.date(from: $0)! < Calendar.current.date(from: $1)!                     }), id: .self) { dateComponent in                         if let date = Calendar.current.date(from: dateComponent) {                             Text(date.formatted(date: .long, time: .omitted))                         }                     }                 } header: {                     Text("Current State of Selected Dates")                 }             }             .navigationTitle("Date Picker Bug")         }     } } #Preview {     ContentView() }
2
1
289
4d
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
4d
Korean IME forces Smart Quotes, ignoring UITextInputTraits and OS Settings
There is a long-standing, structural issue with the iPadOS Korean IME when using a hardware keyboard. The IME forcibly intercepts the " (quote) keydown event and injects Unicode smart/curved quotes (“ or ”) directly into the text field. This hardcoded behavior ignores both: User Settings: The global "Smart Punctuation" toggle in [Settings > General > Keyboard] is completely ignored. Developer APIs: Setting UITextInputTraits.smartQuotesType = .no on a UITextView or UITextField has absolutely no effect when the Korean keyboard is active. Steps to Reproduce: Set smartQuotesType = .no on a standard UITextView. Connect a hardware keyboard. Switch input language to English -> Press the quote key. (Result: ASCII straight quote " - Correct behavior) Switch input language to Korean -> Press the quote key. (Result: Unicode curved quote “ - Incorrect behavior) Impact on Developers & Users: Because the OS IME forcefully injects the curved Unicode character before the app can process the raw key event, developers building code editors, markdown editors, or specific word processors (like Google Docs) cannot prevent this behavior. We cannot provide a standard text-editing experience for Korean users without forcing them to manually toggle their keyboard language to English just to type a straight quote. Expected Behavior: The Korean hardware keyboard IME must respect UITextInputTraits.smartQuotesType and the global OS toggle. Please provide a mechanism for developers and users to bypass this forced CJK typography rule.
Topic: UI Frameworks SubTopic: UIKit
0
0
71
4d
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
4d
App Shortcuts: Invalid parameter type. AppEntity and AppEnum are the only allowed types...
Hi! So while Date is supported for @Parameter in an App Intent, I just discovered that Xcode will not let me use use it in a parametrized App Shortcut phrase. In my case, I would like to give the option to say "today", tomorrow", or "day after tomorrow" for the date. Am I missing something? Any hints on the best way to approach this?
7
1
1.2k
5d
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
5d
Button in ToolbarItem is not completely tapable on iOS 26
I have an icon button in toolbar but only the icon is triggering tap events while outside icon button gives tap feedback but event is not firing. Code: ToolbarItem(placement: .navigationBarTrailing) { Button(action: toggleBookmark) { Image(systemName: isBookmarked ? "bookmark.fill" : "bookmark") .resizable() .aspectRatio(0.8, contentMode: .fit) .frame(width: 20, height: 20) } } Here toggleBookmark function is only called if I click on Image but not if I click outside image but on the circular button that appears on iOS 26. See this screen recording.
Topic: UI Frameworks SubTopic: SwiftUI
8
2
337
5d
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
Performance degradation and redraw loops when syncing SwiftUI Charts with custom AxisMarks
I am reporting a reproducible performance issue in iOS 18.6 where synchronizing the scroll position of two Chart views via chartScrollPosition(id:) causes a complete redraw loop when custom AxisMarks are used. This occurs even when the axis marks are technically "hidden," leading to significant frame drops and stuttering on modern hardware like the iPhone 15. Environment Device: iPhone 15 OS: iOS 18.6 (22G86) Frameworks: SwiftUI, Swift Charts, Observation The Issue When using a shared @Observable state to sync two charts, the scrolling is fluid only if the axes are at their default settings. As soon as a custom AxisMarks block is added to either chart, the following behavior is observed: Diffing Failure: The framework appears unable to maintain the identity of the axis components during the scroll update. Redraw Loop: Instead of an incremental scroll translation, the diffing algorithm triggers a full reload/re-render of both charts on every scroll offset change. Impact: CPU spikes to 100% and the UI becomes unresponsive. This happens even if the custom AxisMarks is used solely to hide the axis (e.g., AxisMarks { _ in }), suggesting the issue is with the custom declaration itself rather than the complexity of the marks being rendered. Steps to Reproduce Create two Chart views in a VStack. Bind both to a single @Observable property using .chartScrollPosition(id: $state.pos). Add any .chartXAxis { AxisMarks(...) { ... } } modifier. Scroll either chart; observe the stuttering. import SwiftUI import Charts import Observation @Observable class ChartState { var scrollPos: Date = .now } struct PerformanceBugView: View { @State private var state = ChartState() var body: some View { VStack { Chart(data) { ... } .chartScrollPosition(id: $state.scrollPos) .chartXAxis { // This custom mark triggers the performance issue AxisMarks { _ in AxisValueLabel() } } Chart(data) { ... } .chartScrollPosition(id: $state.scrollPos) } } } Questions for the Community/Apple Engineers: Is there a way to provide a stable identifier to AxisMarks to prevent them from being treated as "new" during a scroll update? Why does even an empty AxisMarks block (used for hiding) trigger a layout invalidation that standard axes do not? Are there internal optimizations for chartScrollPosition that are bypassed when the axis layout is customized?
1
0
85
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
3d
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
105
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
DynamicViewContent and drop validation (macOS)
If I see it correctly, it is currently not possible to validate a drop operation on a DynamicViewContent when using dropDestination? Just a simple example: Let's say I build a folder view on macOS where I can arrange folders freely. In this case I need to use DynamicViewContent.dropDestination to get an insertion index on drop. However, it seems that methods like dropConfiguration do not have any effect. Als dropDestionation(…, isTargeted:) seems not to be available. Here is my sample code: struct FolderRow: View { let folder: Folder var body: some View { DisclosureGroup(isExpanded: .constant(true)) { ForEach(folder.children) { child in FolderRow(folder: child) } .dropDestination(for: Folder.self) { item, idx in print("Dropped at \(idx)") } } label: { Label(folder.name, systemImage: "folder") .draggable(folder) .dropDestination(for: Folder.self) { items, _ in print("Dropped on Item") } } .dropConfiguration { session in DropConfiguration(operation: .move) } } } struct ContentView: View { @State private var folder: Folder = Folder.sampleData @State private var selection: Set<UUID> = [] var body: some View { NavigationSplitView { List(selection: $selection) { FolderRow(folder: folder) } } detail: { EmptyView() } } } The dropConfiguration is applied on the Label (in this case the "Move" cursor is used instead of the "Copy" cursor). Is there any way to do that or is it just an omission in Swift UI?
Replies
2
Boosts
0
Views
176
Activity
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:
Replies
2
Boosts
0
Views
142
Activity
4d
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
NSProgress - way to publish progress to make the file url unselectable in Finder?
So I'm in the middle of an asynchronous file operation. I publish an NSProgress and it displays wonderfully in Finder. But it is a folder and while the operation is in progress the user should not be allowed to enter it, modify it, etc, while the work is being done. I want to do this to protect the user from doing something silly. But Finder does not prevent the selection with the published progress. And while it would be kind of dumb to do - the user can just go about adding/removing contents to the folder while it has progress. If I remember correctly publishing an NSProgress did use to prevent the file from being selectable in Finder until either the progress finished or my app is quit (or maybe not)? But now the user is free to select, edit, modify during progress which could cause problems if the user does something unexpectedly silly. Is there a way to mark the file 'unselectable' with the published progress? Thanks in advance.
Replies
7
Boosts
0
Views
564
Activity
4d
iOS 26+ UITabBar unselected item colors not updating with UITabBarAppearance
I'm using UITabBarAppearance to customize my TabBar in a SwiftUI app. The customization works perfectly on iOS 18 and earlier, but after updating to iOS 26, the unselected tab items no longer respect my color settings - they just appear black (they are on a white background).Here's my simplified setup: struct ContentView: View { var body: some View { TabView { Text("Home") .tabItem { Image(systemName: "house") Text("Home") } .tag(0) Text("Settings") .tabItem { Image(systemName: "gear") Text("Settings") } .tag(1) } .onAppear { setupTabBarAppearance() } } private func setupTabBarAppearance() { let appearance = UITabBarAppearance() appearance.configureWithOpaqueBackground() let itemAppearance = UITabBarItemAppearance() // These settings work for selected items itemAppearance.selected.iconColor = .systemBlue itemAppearance.selected.titleTextAttributes = [ .font: UIFont.systemFont(ofSize: 10), .foregroundColor: UIColor.systemBlue ] // These settings STOPPED working on iOS 26 for unselected items itemAppearance.normal.iconColor = .gray itemAppearance.normal.titleTextAttributes = [ .font: UIFont.systemFont(ofSize: 10), .foregroundColor: UIColor.gray ] appearance.stackedLayoutAppearance = itemAppearance appearance.inlineLayoutAppearance = itemAppearance appearance.compactInlineLayoutAppearance = itemAppearance UITabBar.appearance().standardAppearance = appearance UITabBar.appearance().scrollEdgeAppearance = appearance } }
Replies
1
Boosts
0
Views
106
Activity
4d
ShareLink "Save Image" action dismisses presenting view after saving
When using ShareLink in SwiftUI to share an image, the “Save Image” action dismisses not only the share sheet but also the presenting SwiftUI view. The behavior differs depending on whether the photo library permission alert appears. Observed behavior: The first time the user taps Save Image, the system permission alert appears. After granting permission, the image saves successfully and the share sheet dismisses normally. On subsequent attempts, the image is saved successfully, but both the share sheet and the presenting view are dismissed unexpectedly. Expected behavior: After saving the image, only the share sheet should dismiss. The presenting SwiftUI view should remain visible. Steps to Reproduce Present a SwiftUI view using .sheet. Inside that view, add a ShareLink configured to export a PNG image using Transferable. Tap the ShareLink button. Choose Save Image. Grant permission the first time (if prompted). Repeat the action. Result: On subsequent saves, the share sheet dismisses and the presenting view is dismissed as well. Sample code ` internal import System import UniformTypeIdentifiers import SwiftUI struct RootView: View { @State private var isPresented: Bool = false var body: some View { ZStack { Color.white Button("Show parent view") { isPresented = true } } .sheet(isPresented: $isPresented) { ParentView() } } } struct ParentView: View { @State private var isPresented: Bool = false var body: some View { NavigationStack { ZStack { Color.red.opacity(0.5) } .toolbar { ToolbarItem() { let name = "\(UUID().uuidString)" let image = UIImage(named: "after")! return ShareLink( item: ShareableImage(image: image, fileName: name), preview: SharePreview( name, image: Image(uiImage: image) ) ) { Image(uiImage: UIImage(resource: .Icons.share24)) .resizable() .foregroundStyle(Color.black) .frame(width: 24, height: 24) } } } } } } struct ShareableImage: Transferable { let image: UIImage let fileName: String static var transferRepresentation: some TransferRepresentation { FileRepresentation(exportedContentType: .png) { item in let fileURL = FileManager.default.temporaryDirectory .appendingPathComponent(item.fileName) .appendingPathExtension("png") guard let data = item.image.pngData() else { throw NSError(domain: "ImageEncodingError", code: 0) } try data.write(to: fileURL) return SentTransferredFile(fileURL) } } } `
Replies
1
Boosts
0
Views
54
Activity
4d
Korean IME forces Smart Quotes, ignoring UITextInputTraits and OS Settings
There is a long-standing, structural issue with the iPadOS Korean IME when using a hardware keyboard. The IME forcibly intercepts the " (quote) keydown event and injects Unicode smart/curved quotes (“ or ”) directly into the text field. This hardcoded behavior ignores both: User Settings: The global "Smart Punctuation" toggle in [Settings > General > Keyboard] is completely ignored. Developer APIs: Setting UITextInputTraits.smartQuotesType = .no on a UITextView or UITextField has absolutely no effect when the Korean keyboard is active. Steps to Reproduce: Set smartQuotesType = .no on a standard UITextView. Connect a hardware keyboard. Switch input language to English -> Press the quote key. (Result: ASCII straight quote " - Correct behavior) Switch input language to Korean -> Press the quote key. (Result: Unicode curved quote “ - Incorrect behavior) Impact on Developers & Users: Because the OS IME forcefully injects the curved Unicode character before the app can process the raw key event, developers building code editors, markdown editors, or specific word processors (like Google Docs) cannot prevent this behavior. We cannot provide a standard text-editing experience for Korean users without forcing them to manually toggle their keyboard language to English just to type a straight quote. Expected Behavior: The Korean hardware keyboard IME must respect UITextInputTraits.smartQuotesType and the global OS toggle. Please provide a mechanism for developers and users to bypass this forced CJK typography rule.
Replies
1
Boosts
0
Views
56
Activity
4d
MultiDatePicker bug in iOS26
Hi! I've encountered strange bug in iOS 26. The MultiDatePicker component exhibits unreliable behavior when attempting to deselect previously chosen dates. Users often need to tap a selected date multiple times (e.g., tap to deselect, tap to re-select, then tap again to deselect) for the UI to correctly register the deselection and update the displayed state. This issue does not occur on iOS 18 or Xcode 26 previews, where MultiDatePicker functions as expected, allowing single-tap deselection. The bug only occurs on physical device or simulator. I can't lie, I have multidatepicker as crucial component in my larger app and can't really find a solution to this. Has anyone encountered this problem before? Here is the code to replicate the issue: import SwiftUI struct ContentView: View {     @ State private var selectedDates: Set = []     var body: some View {         NavigationStack {             Form {                 Section {                     MultiDatePicker("Select Dates", selection: $selectedDates)                 } header: {                     Text("MultiDatePicker Bug Test")                 }                 Section {                     Text("Selected Dates Count: (selectedDates.count)")                     ForEach(Array(selectedDates).sorted(by: {                         Calendar.current.date(from: $0)! < Calendar.current.date(from: $1)!                     }), id: .self) { dateComponent in                         if let date = Calendar.current.date(from: dateComponent) {                             Text(date.formatted(date: .long, time: .omitted))                         }                     }                 } header: {                     Text("Current State of Selected Dates")                 }             }             .navigationTitle("Date Picker Bug")         }     } } #Preview {     ContentView() }
Replies
2
Boosts
1
Views
289
Activity
4d
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
4d
Korean IME forces Smart Quotes, ignoring UITextInputTraits and OS Settings
There is a long-standing, structural issue with the iPadOS Korean IME when using a hardware keyboard. The IME forcibly intercepts the " (quote) keydown event and injects Unicode smart/curved quotes (“ or ”) directly into the text field. This hardcoded behavior ignores both: User Settings: The global "Smart Punctuation" toggle in [Settings > General > Keyboard] is completely ignored. Developer APIs: Setting UITextInputTraits.smartQuotesType = .no on a UITextView or UITextField has absolutely no effect when the Korean keyboard is active. Steps to Reproduce: Set smartQuotesType = .no on a standard UITextView. Connect a hardware keyboard. Switch input language to English -> Press the quote key. (Result: ASCII straight quote " - Correct behavior) Switch input language to Korean -> Press the quote key. (Result: Unicode curved quote “ - Incorrect behavior) Impact on Developers & Users: Because the OS IME forcefully injects the curved Unicode character before the app can process the raw key event, developers building code editors, markdown editors, or specific word processors (like Google Docs) cannot prevent this behavior. We cannot provide a standard text-editing experience for Korean users without forcing them to manually toggle their keyboard language to English just to type a straight quote. Expected Behavior: The Korean hardware keyboard IME must respect UITextInputTraits.smartQuotesType and the global OS toggle. Please provide a mechanism for developers and users to bypass this forced CJK typography rule.
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
71
Activity
4d
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
4d
App Shortcuts: Invalid parameter type. AppEntity and AppEnum are the only allowed types...
Hi! So while Date is supported for @Parameter in an App Intent, I just discovered that Xcode will not let me use use it in a parametrized App Shortcut phrase. In my case, I would like to give the option to say "today", tomorrow", or "day after tomorrow" for the date. Am I missing something? Any hints on the best way to approach this?
Replies
7
Boosts
1
Views
1.2k
Activity
5d
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
5d
Button in ToolbarItem is not completely tapable on iOS 26
I have an icon button in toolbar but only the icon is triggering tap events while outside icon button gives tap feedback but event is not firing. Code: ToolbarItem(placement: .navigationBarTrailing) { Button(action: toggleBookmark) { Image(systemName: isBookmarked ? "bookmark.fill" : "bookmark") .resizable() .aspectRatio(0.8, contentMode: .fit) .frame(width: 20, height: 20) } } Here toggleBookmark function is only called if I click on Image but not if I click outside image but on the circular button that appears on iOS 26. See this screen recording.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
8
Boosts
2
Views
337
Activity
5d
Partially disable liquid glass effect from navigation bars but retain on tabbar
I want to be able to disable all liquid glass effects from my Navigation bar, and it's bar buttons. But I still want to be able to have the liquid glass effect on my UITabbar. Is there a way to disable glass effects from navbar and still retain them all for tabbars using UIKit?
Replies
4
Boosts
2
Views
735
Activity
5d
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
Performance degradation and redraw loops when syncing SwiftUI Charts with custom AxisMarks
I am reporting a reproducible performance issue in iOS 18.6 where synchronizing the scroll position of two Chart views via chartScrollPosition(id:) causes a complete redraw loop when custom AxisMarks are used. This occurs even when the axis marks are technically "hidden," leading to significant frame drops and stuttering on modern hardware like the iPhone 15. Environment Device: iPhone 15 OS: iOS 18.6 (22G86) Frameworks: SwiftUI, Swift Charts, Observation The Issue When using a shared @Observable state to sync two charts, the scrolling is fluid only if the axes are at their default settings. As soon as a custom AxisMarks block is added to either chart, the following behavior is observed: Diffing Failure: The framework appears unable to maintain the identity of the axis components during the scroll update. Redraw Loop: Instead of an incremental scroll translation, the diffing algorithm triggers a full reload/re-render of both charts on every scroll offset change. Impact: CPU spikes to 100% and the UI becomes unresponsive. This happens even if the custom AxisMarks is used solely to hide the axis (e.g., AxisMarks { _ in }), suggesting the issue is with the custom declaration itself rather than the complexity of the marks being rendered. Steps to Reproduce Create two Chart views in a VStack. Bind both to a single @Observable property using .chartScrollPosition(id: $state.pos). Add any .chartXAxis { AxisMarks(...) { ... } } modifier. Scroll either chart; observe the stuttering. import SwiftUI import Charts import Observation @Observable class ChartState { var scrollPos: Date = .now } struct PerformanceBugView: View { @State private var state = ChartState() var body: some View { VStack { Chart(data) { ... } .chartScrollPosition(id: $state.scrollPos) .chartXAxis { // This custom mark triggers the performance issue AxisMarks { _ in AxisValueLabel() } } Chart(data) { ... } .chartScrollPosition(id: $state.scrollPos) } } } Questions for the Community/Apple Engineers: Is there a way to provide a stable identifier to AxisMarks to prevent them from being treated as "new" during a scroll update? Why does even an empty AxisMarks block (used for hiding) trigger a layout invalidation that standard axes do not? Are there internal optimizations for chartScrollPosition that are bypassed when the axis layout is customized?
Replies
1
Boosts
0
Views
85
Activity
1w