Post

Replies

Boosts

Views

Activity

UIKit Container View Controllers and iPhone Duo
Hi, I have an app based almost entirely on standard system components and UICollectionViewController that I'd like to adapt for the iPhone Duo I'd like to describe my viewController setup and ask a few questions, please correct me if any of the statements are incorrect. In the time between the annoucement of the Duo and the release of Xcode 27.1 I also tried to adapt the app to the iPad. It's a simple set up so I think it should be make a good example for questions. My rootViewController is a UITabBarController so on the iPad I get the sidebar (but not the iPhone Duo) Up until now, on the iPhone (horizontal compact) I normally pass a UINavigationController to the UITab's viewController provider closure. This works well because on the iPad when the sidebar is hidden the tab bar at the top of the screen floats above the visible tab's navigation bar For the iPhone Duo and iPad I need a container view controller to load two viewControllers into the rootViewController to make use of the extra horizontal space. Presumably I sholud setup and keep the same view hierarchy (for all devices) and adapt it based on changes to the traitCollection.horizontalSizeClass Using a split view controller's supplementary/second column seems to work well, the UITabBarController manages the sidebar on iPad, views can be resized by the user.Tthe supplementary column is hidden automatically in horizontalSizeClass compact. The navigation bar of the supplementary/second column stays below the floating tab bar -which is understandable because of the split. If I hide the navigationBar on the supplementary/second columns, Is it possible to instal bar items in a navigation bar at the top of the screen/below the floating tab bar? Also if i hide the supplementary column when the iPhone Duo is unfolded, the empty navigation bar becomes visible at the top of the screen, I think this might be a bug. I also tried UIArrangementView. I'm sure if it's suited for this use case as primary (leading) placement needs to switch to the secondary (trailing) placement when the iPhone Duo is unfolded. Is there something that I didn't understand correctly?
Topic: UI Frameworks SubTopic: UIKit
4
0
143
22h
Adapting UICollectionViewCompositionalLayout for iPhoneDuo
I have a question about how to adapt UICollectionViewCompositionalLayout for different size classes. Initially I adapted both the diffableDataSource snapshot and the UICollectionViewCompositionalLayout based on the horizontalSizeClass. I wasn't very happy that my datasource (snapshot construction code) needs to know about sizeClasses, it feels like it should only know about data. So I thought why not just return an empty section in the UICollectionViewCompositionalLayout because it get's passed NSCollectionLayoutEnvironment. It works fine but I'm not sure if it's supported or the right way to reason about this. Here's my empty section code. static var hiddenSection: NSCollectionLayoutSection { // Note: .zero is regarded by the system as an error, it might crash in the future let dimension = NSCollectionLayoutDimension.absolute(0.1) let size = NSCollectionLayoutSize(widthDimension: dimension, heightDimension: dimension) return NSCollectionLayoutSection(group: NSCollectionLayoutGroup.horizontal(layoutSize: size, subitems: [.init(layoutSize: size), .init(layoutSize: size), .init(layoutSize: size)] )) } ``` Thank you for any insights!
Topic: UI Frameworks SubTopic: UIKit
2
0
74
1d
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
267
Jun ’26
API to get AVSpeechSynthesisVoice that are available to download (via Settings.app) but not yet downloaded to a device
Here is the use case, I have a language learning app that uses AVSpeechSynthesizer ❤️. When a user listens to a phrase with the AVSpeechSynthesizer using a AVSpeechSynthesisVoice with a AVSpeechSynthesisVoiceQuality of default it sounds much much worse than voices with enhanced or premium, really affecting usability. There appears to be no API for the app to know if there are enhanced or premium voices available to download (via Settings.app) but not yet downloaded to a device. The only API I could find is AVSpeechSynthesisVoice.speechVoices() which returns all available voices on the device, but not a full list of voices available via download. So the app cannot know if it should inform the user "hey this voice your listening to is a much lower quality than enhanced or premium, go to settings and download the enhanced or premium version". Any ideas? Do I need to send in an enhancement request via Feedback Assistant? Thank you for helping my users ears and helping them turn speech synthesis voice quality up to 11 when it's available to them with just a couple of extra taps! (I suppose the best workaround is to display a warning every time the user is using a default quality voice, I wonder what % of voices have enhanced or premium versions...)
2
0
1.1k
Jul ’24
AttributedString (without NS prefix) and Genmoji
My app uses AttributedString for both text formatting and storage using MarkdownDecodableAttributedStringKey. The new API for Genmoji looks very interesting but I don't see an AttributeScope for it. Is it possible to work around this and stick with AttributedString, am I in the wrong room or should I send in an enhancement request via Feedback Assistant? Thanks a lot for your time!
2
0
891
Jul ’24
UIKit Container View Controllers and iPhone Duo
Hi, I have an app based almost entirely on standard system components and UICollectionViewController that I'd like to adapt for the iPhone Duo I'd like to describe my viewController setup and ask a few questions, please correct me if any of the statements are incorrect. In the time between the annoucement of the Duo and the release of Xcode 27.1 I also tried to adapt the app to the iPad. It's a simple set up so I think it should be make a good example for questions. My rootViewController is a UITabBarController so on the iPad I get the sidebar (but not the iPhone Duo) Up until now, on the iPhone (horizontal compact) I normally pass a UINavigationController to the UITab's viewController provider closure. This works well because on the iPad when the sidebar is hidden the tab bar at the top of the screen floats above the visible tab's navigation bar For the iPhone Duo and iPad I need a container view controller to load two viewControllers into the rootViewController to make use of the extra horizontal space. Presumably I sholud setup and keep the same view hierarchy (for all devices) and adapt it based on changes to the traitCollection.horizontalSizeClass Using a split view controller's supplementary/second column seems to work well, the UITabBarController manages the sidebar on iPad, views can be resized by the user.Tthe supplementary column is hidden automatically in horizontalSizeClass compact. The navigation bar of the supplementary/second column stays below the floating tab bar -which is understandable because of the split. If I hide the navigationBar on the supplementary/second columns, Is it possible to instal bar items in a navigation bar at the top of the screen/below the floating tab bar? Also if i hide the supplementary column when the iPhone Duo is unfolded, the empty navigation bar becomes visible at the top of the screen, I think this might be a bug. I also tried UIArrangementView. I'm sure if it's suited for this use case as primary (leading) placement needs to switch to the secondary (trailing) placement when the iPhone Duo is unfolded. Is there something that I didn't understand correctly?
Topic: UI Frameworks SubTopic: UIKit
Replies
4
Boosts
0
Views
143
Activity
22h
Adapting UICollectionViewCompositionalLayout for iPhoneDuo
I have a question about how to adapt UICollectionViewCompositionalLayout for different size classes. Initially I adapted both the diffableDataSource snapshot and the UICollectionViewCompositionalLayout based on the horizontalSizeClass. I wasn't very happy that my datasource (snapshot construction code) needs to know about sizeClasses, it feels like it should only know about data. So I thought why not just return an empty section in the UICollectionViewCompositionalLayout because it get's passed NSCollectionLayoutEnvironment. It works fine but I'm not sure if it's supported or the right way to reason about this. Here's my empty section code. static var hiddenSection: NSCollectionLayoutSection { // Note: .zero is regarded by the system as an error, it might crash in the future let dimension = NSCollectionLayoutDimension.absolute(0.1) let size = NSCollectionLayoutSize(widthDimension: dimension, heightDimension: dimension) return NSCollectionLayoutSection(group: NSCollectionLayoutGroup.horizontal(layoutSize: size, subitems: [.init(layoutSize: size), .init(layoutSize: size), .init(layoutSize: size)] )) } ``` Thank you for any insights!
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
74
Activity
1d
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
289
Activity
Jun ’26
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
267
Activity
Jun ’26
API to get AVSpeechSynthesisVoice that are available to download (via Settings.app) but not yet downloaded to a device
Here is the use case, I have a language learning app that uses AVSpeechSynthesizer ❤️. When a user listens to a phrase with the AVSpeechSynthesizer using a AVSpeechSynthesisVoice with a AVSpeechSynthesisVoiceQuality of default it sounds much much worse than voices with enhanced or premium, really affecting usability. There appears to be no API for the app to know if there are enhanced or premium voices available to download (via Settings.app) but not yet downloaded to a device. The only API I could find is AVSpeechSynthesisVoice.speechVoices() which returns all available voices on the device, but not a full list of voices available via download. So the app cannot know if it should inform the user "hey this voice your listening to is a much lower quality than enhanced or premium, go to settings and download the enhanced or premium version". Any ideas? Do I need to send in an enhancement request via Feedback Assistant? Thank you for helping my users ears and helping them turn speech synthesis voice quality up to 11 when it's available to them with just a couple of extra taps! (I suppose the best workaround is to display a warning every time the user is using a default quality voice, I wonder what % of voices have enhanced or premium versions...)
Replies
2
Boosts
0
Views
1.1k
Activity
Jul ’24
AttributedString (without NS prefix) and Genmoji
My app uses AttributedString for both text formatting and storage using MarkdownDecodableAttributedStringKey. The new API for Genmoji looks very interesting but I don't see an AttributeScope for it. Is it possible to work around this and stick with AttributedString, am I in the wrong room or should I send in an enhancement request via Feedback Assistant? Thanks a lot for your time!
Replies
2
Boosts
0
Views
891
Activity
Jul ’24