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

Crash occured in UIDatePicker Calendar type
I am encountering a consistent, reproducible crash in our app when presenting a UIDatePicker configured with the calendar style. The crash triggers every single time the picker is invoked and points directly to the modern date picker's internal UICollectionView. The Exception: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView internal inconsistency: attempted to set layout with the collection view requiring a reload' let datePicker = UIDatePicker() datePicker.datePickerMode = .date datePicker.preferredDatePickerStyle = .compact This crash is occuring in inline style too when I try to open the calendar. I tried this in other apps. It works fine. I didn't override any collectionView layouts
0
0
6
40m
Debugging multi-window AppKit apps: Identifying the window associated with a breakpoint
When working on a multi-window AppKit app, how do you identify which window instance is associated with the current breakpoint? The same question applies when using LLDB. If execution stops inside an object that can exist in more than one window, such as a shared NSViewController subclass, how do you know which window’s object you are currently inspecting? Does Xcode provide a mechanism for showing the NSWindow associated with the current view, view controller or responder while debugging? My current approach is to print object identities and compare them manually. For example, if several identical windows are open, I might print the current object and its window: print(self, #function) Then I interact with one window, make a note of the printed memory addresses in the console, switch to another window and compare the output. This works, but it feels manual. I am not dealing with different window subclasses. The windows may be instances of the same class and may contain instances of the same view controller classes. I simply want an easier way to distinguish which window instance I am debugging. Is there a recommended Xcode, LLDB or AppKit workflow for this?
0
0
10
7h
How to get the glassy picker showed at WWD27
In the session "What’s new in SwiftUI", at 02:38 Steven shows various Liquid Glass components, among them, a very pretty interactive glassy Picker. At first I thought this was built into the system and tried everything possible, until to rewatch the presentation and notice this: "On macOS, like on iOS, you can mark Liquid Glass custom elements as "interactive" so they respond more fluidly to user's clicks. And this is optimized to work great with the mouse pointer, so it feels right at home on the Mac." Does anyone have pointers to where one can find a Picker that implements all these system behaviors that folks have come to expect? I have my own version, which is deeply lacking, and so is every other implementation out there that I saw, and I thought sprinkling some "interactive" as instructed would help, but it barely made a dent.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
79
7h
Correct UIScene Configuration for UISceneAccessory
What is the correct configuration of the Info.plist to get a UISceneAccessory to display on an external monitor? I'm currently getting: Info.plist contained no UIScene configuration dictionary (looking for configuration named "scene-accessory") My Info.plist looks as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleExternalDisplayNonInteractive</key> <array> <dict> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).AccessorySceneDelegate</string> <key>UISceneConfigurationName</key> <string>scene-accessory</string> </dict> </array> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> </dict> </array> </dict> </dict> </dict> </plist> And the view controller scene registration code: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sceneConfiguration = UISceneConfiguration(name: "scene-accessory") let accessory = UISceneAccessory.externalNonInteractive(sceneConfiguration: sceneConfiguration) let registration = registerSceneAccessory(accessory) registration.isEnabled = true } } Thanks!
Topic: UI Frameworks SubTopic: UIKit
1
0
46
8h
Supplying custom menu elements to a UITextView's edit menu
When appending additional UIAction children to the horizontal edit menu UIMenu returned in the delegate method func textView(_ textView: UITextView, editMenuForTextIn range: NSRange, suggestedActions: [UIMenuElement]) -> UIMenu? If the menu is long enough to need an overflow chevron vertical menu (introduced in iOS 26) my UIAction only show either a title or an image not both, is UIAction the right UIMenuElement type to supply here? How to get both the title and the image to appear in the overflow vertical menu?
Topic: UI Frameworks SubTopic: UIKit
3
0
53
9h
List selection (UI) does not update when selection is changed programmatically
I have a List that's embedded in an NSHostingView with an @Observable data connecting the two worlds. I can select an item in the list with the mouse and use arrow keys to change the selection and it is updated properly on the AppKit side. However, when I change the selection from the AppKit side, the selection disappears in the List, even though an .onChange does get triggered with the right new selection ID. But the UI no longer displays it. I created a simple NSHostView example and that works. But the same method does not work in a more complex layout where the view is much deeper in the hierarchy. Something is happening because the List loses its last selection highlight. What's the best approach to tracking down why the List UI is not updating the selection? I am trying to avoid going back to using NSTableView and doing it all manually, but I really need to selection to be able to change. Thank you.
Topic: UI Frameworks SubTopic: SwiftUI
1
0
20
9h
Correct way to use AppDependencyManager
Hi in the CometCal sample they have this: @main struct CometCalApp: App { init() { let dependency = CalendarManager.shared AppDependencyManager.shared.add(dependency: dependency) } var body: some Scene { WindowGroup { CalendarListView() } .modelContainer(CalendarManager.shared.modelContainer) } } However I do not want my manager to init when I am using SwiftUI previews. FYI in SwiftUI previews the App is init but body isn't called. So I require the CalendarManager to be init lazily. Is this a valid way to achieve that: init() { let dependency: @Sendable () async -> (CalendarManager) = { @MainActor in return CalendarManager.shared } AppDependencyManager.shared.add(dependency: dependency) } If so it would be great if the API could be improved to let me just do this: AppDependencyManager.shared.add(dependency: CalendarManager.shared) Which currently fails with Main actor-isolated static property 'shared' can not be referenced from a Sendable closure Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
0
0
5
9h
Does TextKit 2 support tables and printing now?
At WWDC22, it was stated that TextKit 2 did not support tables and printing and possibly other attributes and NSTextView would revert back to TextKit 1. At what point can we be sure that TextKit 2 supports everything TextKit 1 did and NSTextView will no longer revert back. My app makes use of a subclass of NSTextView and custom layoutManager and migrating to support both versions seems incredibly complex. Thank you.
Topic: UI Frameworks SubTopic: AppKit
1
0
47
9h
Dynamic layouts with multi-line Text views
For a dynamic layout reacting to width changes using ViewThatFits, I need a 2-line Text view where content gets wrapped exactly once, but doesn't get abbreviated. If the text is too long to fit in two lines, ViewThatFits should choose the next layout. I tried to use .lineLimit(2, reservesSpace: true), but then ViewThatFits always takes this layout even when the text content gets too long to fit, so it gets abbreviated with "...", instead of choosing the next layout. How else can I build a layout with a two-line Text, which does signal to ViewThatFits if the space doesn't fit the entire text so it can choose the next layout?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
52
8h
How to achieve visual consistency between NSComboBox and NSTextView on sidebar
Do you have any ideas on how to make the background color of a NSTextView the same as the background of a NSComboBox when both are on a sidebar? The closest I could get is using a NSVisualEffectView, but it's still not optimal (the text view is slightly darker) override init(frame: NSRect) { self.scrollView = NSTextView.scrollableTextView() if #available(macOS 26.0, *) { scrollView.borderType = .lineBorder let backgroundView = NSVisualEffectView() backgroundView.material = .contentBackground backgroundView.blendingMode = .withinWindow backgroundView.state = .followsWindowActiveState backgroundView.translatesAutoresizingMaskIntoConstraints = false self.materialBackgroundView = backgroundView } else { self.materialBackgroundView = nil } ...
Topic: UI Frameworks SubTopic: AppKit
7
0
55
8h
Can I use a template image for quick actions?
Hey Team, System-provided quick actions in Finder sport a template image that adapts correctly to light and dark modes. However when I add a quick action extension in my app, the icon I refer to in the Info.plist renders in full color, even if it is defined in the asset catalog as a template image. This forces me to either use my app icon or a gray icon that will work in either appearance. How can I get the system-provided quick actions treatment? Thanks, Ari
Topic: UI Frameworks SubTopic: AppKit
1
0
29
9h
ForEach with calculations between each cell
I'm attempting to add a TimeInterval calculated at each step of a ForEach to a Date (hr & min) of the previous cell. For each cell this works: Start Time = 12:55 Delta interval = 3600 seconds (1hr) Next time = 1:55 I want to use that Next time as the start one for the next cell - instead what I have working is Delta interval = 30 (5 min) Next time = 1:00 but what I want is 2:00 (12:55 + 1hr + 5min) I'm just having trouble thinking through how to do that. Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
2
0
33
9h
Updates on Storyboards
In the past few years, there hasn't been much updates around Storyboards and yet it seems like Xcode supports them. Even before the first release of SwiftUI, many developers stopped using Storyboards for compelling reasons such as: They introduce two sources of truth for the UI It's not easy to read the content during code-review They can cause merge conflicts Often they fail to load, especially after a new major release of Xcode, without any error I was wondering whether there's a dedicated team working on Storyboards or if they're just abandoned. I understand this question may overlap with what the Xcode team does; so, let me rephrase it: in a large project, what are the pros and cons of using Storyboards when building views using UIKit? For instance, do they work well with things such as navigation by employing segues, the liquid glass or the new resizing feature? Finally, one of the benefits of using Storyboards is the fact that they visualize the UI, including the constraints. However, since now we can UIViewController in Preview, can we safely say that Previews can deliver the same thing?
Topic: UI Frameworks SubTopic: UIKit
1
0
58
9h
When the marked text is touched, or when the cursor is moved between the marked text, the marked text will be disappear
When the marked text is touched, or when the cursor is moved between the marked text, the marked text will be disappear In order to implement the function of active input, we use the setMarkedText(_:selectedRange:) method provided by UITextDocumentProxy to insert and mark the input text, but when the marked text is touched, or when the cursor is moved between the text, the marked text will be disappear. This is a very obvious error and cannot be avoided. So far, this problem still occurs on devices with the system version of iOS 27 beta , so we cannot use this method to perfectly implement the function of active input, which is a big trouble for us. We want the text to be displayed normally after the user touches the marked text. And the cursor can move in the marked text, so that the user can perform operations such as insert, remove, etc. May I ask what methods can be used to achieve the above effect? If this is a bug, please fix it as soon as possible. More details can be found by the video link: [https://www.youtube.com/shorts/dd8VhBJ88og] STEPS TO REPRODUCE 1.Use the setMarkedText(_:selectedRange:) method provided by UITextDocumentProxy to insert and mark text 2.Touch the marked text or long press the cursor to move to the marked text
Topic: UI Frameworks SubTopic: UIKit
1
0
67
9h
Supporting iOS15 with widgets & CoreData
I have an app where CoreData is working great - but I want to add widgets. I'm following a tutorial where they create an AppGroup and in the migration they use appendingPathComponent(_:) which is deprecated (iOS 8.0–26.1) however the recommended replacement appending(path:directoryHint:) starts support at iOS 16. I'm hanging on to iOS 15 for some users who don't want to upgrade their phones - but is it time to give up on that for widgets running on released iOS 26 and beyond? I assume I'll need to use if #available(iOS 16.0, *) for the new code. How does this work for the CoreData migration for the older phones? So far this is just in TestFlight. Any recommendations?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
27
9h
How does macOS 27 generate suggested titles for draft documents?
In macOS 27, document-based applications appear to gain a new feature where, when Autosave in Place is enabled, draft document titles are automatically suggested based on the document’s content. I was surprised to see this, but I think it is a great feature. (Interestingly, I have received similar feature requests from users of my own application in the past, but I declined them because I felt they would add unnecessary complexity.) My question is mostly out of curiosity: how is this feature implemented? My assumption is that the system may be reusing the new Spotlight indexing infrastructure to extract document content, perhaps by combining the Data returned from NSDocument.data(ofType:) during autosave with the document’s fileType. Is that understanding correct, or is a different mechanism involved? Are there any articles, WWDC sessions, or other documentation that explain this new draft title suggestion feature? I have not been able to find any information about it. Also, is there currently any way to disable this behavior? I am not personally looking to turn it off, but I suspect some users of my application may eventually ask for that option.
Topic: UI Frameworks SubTopic: AppKit
2
0
59
9h
UITabBarController prominentTabIdentifier as Action Behaviour
UITabBarController's new prominentTabIdentifier property is a really nice addition! Thank you! Will there be official support via the UITab API for using the underlying _UITabBarAuxiliaryView as a primary action as many apps, such as the Apple Design Award Finalist, Structured, does for presenting a sheet, for example?
Topic: UI Frameworks SubTopic: UIKit
1
0
27
9h
Crash occured in UIDatePicker Calendar type
I am encountering a consistent, reproducible crash in our app when presenting a UIDatePicker configured with the calendar style. The crash triggers every single time the picker is invoked and points directly to the modern date picker's internal UICollectionView. The Exception: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView internal inconsistency: attempted to set layout with the collection view requiring a reload' let datePicker = UIDatePicker() datePicker.datePickerMode = .date datePicker.preferredDatePickerStyle = .compact This crash is occuring in inline style too when I try to open the calendar. I tried this in other apps. It works fine. I didn't override any collectionView layouts
Replies
0
Boosts
0
Views
6
Activity
40m
Debugging multi-window AppKit apps: Identifying the window associated with a breakpoint
When working on a multi-window AppKit app, how do you identify which window instance is associated with the current breakpoint? The same question applies when using LLDB. If execution stops inside an object that can exist in more than one window, such as a shared NSViewController subclass, how do you know which window’s object you are currently inspecting? Does Xcode provide a mechanism for showing the NSWindow associated with the current view, view controller or responder while debugging? My current approach is to print object identities and compare them manually. For example, if several identical windows are open, I might print the current object and its window: print(self, #function) Then I interact with one window, make a note of the printed memory addresses in the console, switch to another window and compare the output. This works, but it feels manual. I am not dealing with different window subclasses. The windows may be instances of the same class and may contain instances of the same view controller classes. I simply want an easier way to distinguish which window instance I am debugging. Is there a recommended Xcode, LLDB or AppKit workflow for this?
Replies
0
Boosts
0
Views
10
Activity
7h
How to get the glassy picker showed at WWD27
In the session "What’s new in SwiftUI", at 02:38 Steven shows various Liquid Glass components, among them, a very pretty interactive glassy Picker. At first I thought this was built into the system and tried everything possible, until to rewatch the presentation and notice this: "On macOS, like on iOS, you can mark Liquid Glass custom elements as "interactive" so they respond more fluidly to user's clicks. And this is optimized to work great with the mouse pointer, so it feels right at home on the Mac." Does anyone have pointers to where one can find a Picker that implements all these system behaviors that folks have come to expect? I have my own version, which is deeply lacking, and so is every other implementation out there that I saw, and I thought sprinkling some "interactive" as instructed would help, but it barely made a dent.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
79
Activity
7h
Correct UIScene Configuration for UISceneAccessory
What is the correct configuration of the Info.plist to get a UISceneAccessory to display on an external monitor? I'm currently getting: Info.plist contained no UIScene configuration dictionary (looking for configuration named "scene-accessory") My Info.plist looks as follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleExternalDisplayNonInteractive</key> <array> <dict> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).AccessorySceneDelegate</string> <key>UISceneConfigurationName</key> <string>scene-accessory</string> </dict> </array> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> </dict> </array> </dict> </dict> </dict> </plist> And the view controller scene registration code: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sceneConfiguration = UISceneConfiguration(name: "scene-accessory") let accessory = UISceneAccessory.externalNonInteractive(sceneConfiguration: sceneConfiguration) let registration = registerSceneAccessory(accessory) registration.isEnabled = true } } Thanks!
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
46
Activity
8h
Supplying custom menu elements to a UITextView's edit menu
When appending additional UIAction children to the horizontal edit menu UIMenu returned in the delegate method func textView(_ textView: UITextView, editMenuForTextIn range: NSRange, suggestedActions: [UIMenuElement]) -> UIMenu? If the menu is long enough to need an overflow chevron vertical menu (introduced in iOS 26) my UIAction only show either a title or an image not both, is UIAction the right UIMenuElement type to supply here? How to get both the title and the image to appear in the overflow vertical menu?
Topic: UI Frameworks SubTopic: UIKit
Replies
3
Boosts
0
Views
53
Activity
9h
List selection (UI) does not update when selection is changed programmatically
I have a List that's embedded in an NSHostingView with an @Observable data connecting the two worlds. I can select an item in the list with the mouse and use arrow keys to change the selection and it is updated properly on the AppKit side. However, when I change the selection from the AppKit side, the selection disappears in the List, even though an .onChange does get triggered with the right new selection ID. But the UI no longer displays it. I created a simple NSHostView example and that works. But the same method does not work in a more complex layout where the view is much deeper in the hierarchy. Something is happening because the List loses its last selection highlight. What's the best approach to tracking down why the List UI is not updating the selection? I am trying to avoid going back to using NSTableView and doing it all manually, but I really need to selection to be able to change. Thank you.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
20
Activity
9h
Correct way to use AppDependencyManager
Hi in the CometCal sample they have this: @main struct CometCalApp: App { init() { let dependency = CalendarManager.shared AppDependencyManager.shared.add(dependency: dependency) } var body: some Scene { WindowGroup { CalendarListView() } .modelContainer(CalendarManager.shared.modelContainer) } } However I do not want my manager to init when I am using SwiftUI previews. FYI in SwiftUI previews the App is init but body isn't called. So I require the CalendarManager to be init lazily. Is this a valid way to achieve that: init() { let dependency: @Sendable () async -> (CalendarManager) = { @MainActor in return CalendarManager.shared } AppDependencyManager.shared.add(dependency: dependency) } If so it would be great if the API could be improved to let me just do this: AppDependencyManager.shared.add(dependency: CalendarManager.shared) Which currently fails with Main actor-isolated static property 'shared' can not be referenced from a Sendable closure Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
5
Activity
9h
Does TextKit 2 support tables and printing now?
At WWDC22, it was stated that TextKit 2 did not support tables and printing and possibly other attributes and NSTextView would revert back to TextKit 1. At what point can we be sure that TextKit 2 supports everything TextKit 1 did and NSTextView will no longer revert back. My app makes use of a subclass of NSTextView and custom layoutManager and migrating to support both versions seems incredibly complex. Thank you.
Topic: UI Frameworks SubTopic: AppKit
Replies
1
Boosts
0
Views
47
Activity
9h
Dynamic layouts with multi-line Text views
For a dynamic layout reacting to width changes using ViewThatFits, I need a 2-line Text view where content gets wrapped exactly once, but doesn't get abbreviated. If the text is too long to fit in two lines, ViewThatFits should choose the next layout. I tried to use .lineLimit(2, reservesSpace: true), but then ViewThatFits always takes this layout even when the text content gets too long to fit, so it gets abbreviated with "...", instead of choosing the next layout. How else can I build a layout with a two-line Text, which does signal to ViewThatFits if the space doesn't fit the entire text so it can choose the next layout?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
52
Activity
8h
How to achieve visual consistency between NSComboBox and NSTextView on sidebar
Do you have any ideas on how to make the background color of a NSTextView the same as the background of a NSComboBox when both are on a sidebar? The closest I could get is using a NSVisualEffectView, but it's still not optimal (the text view is slightly darker) override init(frame: NSRect) { self.scrollView = NSTextView.scrollableTextView() if #available(macOS 26.0, *) { scrollView.borderType = .lineBorder let backgroundView = NSVisualEffectView() backgroundView.material = .contentBackground backgroundView.blendingMode = .withinWindow backgroundView.state = .followsWindowActiveState backgroundView.translatesAutoresizingMaskIntoConstraints = false self.materialBackgroundView = backgroundView } else { self.materialBackgroundView = nil } ...
Topic: UI Frameworks SubTopic: AppKit
Replies
7
Boosts
0
Views
55
Activity
8h
What is the performance improvement in UIKit on iOS27?
What improvements have been made in iOS27, and what can we expect to see in terms of performance enhancements in UIKit this year? How would these changes help enhance our app’s user experience?
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
56
Activity
9h
Can I use a template image for quick actions?
Hey Team, System-provided quick actions in Finder sport a template image that adapts correctly to light and dark modes. However when I add a quick action extension in my app, the icon I refer to in the Info.plist renders in full color, even if it is defined in the asset catalog as a template image. This forces me to either use my app icon or a gray icon that will work in either appearance. How can I get the system-provided quick actions treatment? Thanks, Ari
Topic: UI Frameworks SubTopic: AppKit
Replies
1
Boosts
0
Views
29
Activity
9h
Reproducing the date label above the editor scroll/text view in Journal and Notes app
I made a few attempts to implement a similar label but I'm not sure if it's possible using public APIs. Could you give any tips about how to approach implementing this? Thank you!
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
76
Activity
9h
ForEach with calculations between each cell
I'm attempting to add a TimeInterval calculated at each step of a ForEach to a Date (hr & min) of the previous cell. For each cell this works: Start Time = 12:55 Delta interval = 3600 seconds (1hr) Next time = 1:55 I want to use that Next time as the start one for the next cell - instead what I have working is Delta interval = 30 (5 min) Next time = 1:00 but what I want is 2:00 (12:55 + 1hr + 5min) I'm just having trouble thinking through how to do that. Thanks!
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
33
Activity
9h
Updates on Storyboards
In the past few years, there hasn't been much updates around Storyboards and yet it seems like Xcode supports them. Even before the first release of SwiftUI, many developers stopped using Storyboards for compelling reasons such as: They introduce two sources of truth for the UI It's not easy to read the content during code-review They can cause merge conflicts Often they fail to load, especially after a new major release of Xcode, without any error I was wondering whether there's a dedicated team working on Storyboards or if they're just abandoned. I understand this question may overlap with what the Xcode team does; so, let me rephrase it: in a large project, what are the pros and cons of using Storyboards when building views using UIKit? For instance, do they work well with things such as navigation by employing segues, the liquid glass or the new resizing feature? Finally, one of the benefits of using Storyboards is the fact that they visualize the UI, including the constraints. However, since now we can UIViewController in Preview, can we safely say that Previews can deliver the same thing?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
58
Activity
9h
When the marked text is touched, or when the cursor is moved between the marked text, the marked text will be disappear
When the marked text is touched, or when the cursor is moved between the marked text, the marked text will be disappear In order to implement the function of active input, we use the setMarkedText(_:selectedRange:) method provided by UITextDocumentProxy to insert and mark the input text, but when the marked text is touched, or when the cursor is moved between the text, the marked text will be disappear. This is a very obvious error and cannot be avoided. So far, this problem still occurs on devices with the system version of iOS 27 beta , so we cannot use this method to perfectly implement the function of active input, which is a big trouble for us. We want the text to be displayed normally after the user touches the marked text. And the cursor can move in the marked text, so that the user can perform operations such as insert, remove, etc. May I ask what methods can be used to achieve the above effect? If this is a bug, please fix it as soon as possible. More details can be found by the video link: [https://www.youtube.com/shorts/dd8VhBJ88og] STEPS TO REPRODUCE 1.Use the setMarkedText(_:selectedRange:) method provided by UITextDocumentProxy to insert and mark text 2.Touch the marked text or long press the cursor to move to the marked text
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
67
Activity
9h
Is there an AppKit equivalent to UIKit.UIApplication setAlternateIconName(_ alternateIconName: String?)?
I would like to provide alternate IconComposer-designed icons (that support light, dark, mono) for my macOS app. The DockTile approach only works when app is running, but also only with NSImage. And there doesn't seem to be a way to load an NSImage from a .icon file that matches the current appearance option. Thank you.
Topic: UI Frameworks SubTopic: AppKit
Replies
2
Boosts
1
Views
66
Activity
9h
Supporting iOS15 with widgets & CoreData
I have an app where CoreData is working great - but I want to add widgets. I'm following a tutorial where they create an AppGroup and in the migration they use appendingPathComponent(_:) which is deprecated (iOS 8.0–26.1) however the recommended replacement appending(path:directoryHint:) starts support at iOS 16. I'm hanging on to iOS 15 for some users who don't want to upgrade their phones - but is it time to give up on that for widgets running on released iOS 26 and beyond? I assume I'll need to use if #available(iOS 16.0, *) for the new code. How does this work for the CoreData migration for the older phones? So far this is just in TestFlight. Any recommendations?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
27
Activity
9h
How does macOS 27 generate suggested titles for draft documents?
In macOS 27, document-based applications appear to gain a new feature where, when Autosave in Place is enabled, draft document titles are automatically suggested based on the document’s content. I was surprised to see this, but I think it is a great feature. (Interestingly, I have received similar feature requests from users of my own application in the past, but I declined them because I felt they would add unnecessary complexity.) My question is mostly out of curiosity: how is this feature implemented? My assumption is that the system may be reusing the new Spotlight indexing infrastructure to extract document content, perhaps by combining the Data returned from NSDocument.data(ofType:) during autosave with the document’s fileType. Is that understanding correct, or is a different mechanism involved? Are there any articles, WWDC sessions, or other documentation that explain this new draft title suggestion feature? I have not been able to find any information about it. Also, is there currently any way to disable this behavior? I am not personally looking to turn it off, but I suspect some users of my application may eventually ask for that option.
Topic: UI Frameworks SubTopic: AppKit
Replies
2
Boosts
0
Views
59
Activity
9h
UITabBarController prominentTabIdentifier as Action Behaviour
UITabBarController's new prominentTabIdentifier property is a really nice addition! Thank you! Will there be official support via the UITab API for using the underlying _UITabBarAuxiliaryView as a primary action as many apps, such as the Apple Design Award Finalist, Structured, does for presenting a sheet, for example?
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
27
Activity
9h