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.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

MEMessageActionHandler — Mail shows "Uninstall only", no enable toggle, consent dialog never fires
I'm implementing a MEMessageActionHandler Mail extension on macOS 26.4.1 (Xcode 26.4). The extension is discovered by Mail and appears in Mail > Settings > Extensions, but Mail shows only an "Uninstall" button — no enable toggle. The MailKit consent dialog asking permission to process messages in the background has never appeared. Console logs show optedIn: NO / userEnabled: Not Enabled. Extension Info.plist (key parts): NSExtensionPointIdentifier com.apple.email.extension NSExtensionPrincipalClass CheckThisMailExtension.MailExtension MEExtensionCapabilities MEMessageActionHandler Principal class: class MailExtension: NSObject, MEExtension { func handlerForMessageActions() -> any MEMessageActionHandler { return MessageActionHandler() } } Entitlements: app-sandbox: true, application-groups: [group.com.xxx]. App is Developer ID signed and notarized. Has anyone successfully gotten the consent dialog to appear for MEMessageActionHandler on macOS 15/26? Is there something beyond the standard template configuration that enables it? Any entitlement that needs to be provisioned separately?
1
0
126
14h
How can I reliably get the final restored window size on macOS when onAppear / viewDidAppear fires too early?
I’m running into a macOS window restoration behavior issue where viewDidAppear (AppKit) or onAppear (SwiftUI) fires before the window’s final restored size is applied. AppKit example class MyViewController: NSViewController { override func viewDidLayout() { print("viewDidLayout: \(view.bounds.size)") } override func viewDidAppear() { print("viewDidAppear: \(view.bounds.size)") } } Logs on launch: viewDidAppear: (480.0, 270.0) viewDidLayout: (480.0, 270.0) viewDidLayout: (556.0, 476.0) viewDidLayout: (556.0, 476.0) The correct restored size is (556.0, 476.0), but viewDidAppear initially reports the old default size (480.0, 270.0). SwiftUI equivalent struct MyView: View { var body: some View { GeometryReader { geo in VStack {} .onAppear { print("onAppear: \(geo.size)") } .onChange(of: geo.size) { print("onChange: \(geo.size)") } } } } Logs on launch: onAppear: (900.0, 450.0) onChange: (680.0, 658.0) Problem I need to run some setup code: Only once After the view/window has its correct restored size Without rerunning on every layout or geometry change Question What is the proper macOS-native way to perform one-time startup logic only after the final restored window size is available? Is there a recommended lifecycle hook or pattern for this? Also, is it expected behavior that onAppear / viewDidAppear reports the pre-restoration size, or is it a bug?
3
0
131
20h
Custom keyboard.
I have created a keyboard extension but I do not feel the responsiveness like the default keyboard. I feel I have to mash down the keys and I feel when typing quickly the touch will skip a letter or two till the UI catches back up. My process - I have an xib that the visual is made. I have created my view then I added a view inside that and then 4 rows(views) inside that. In the rows I place the buttons. I had the touch down event for the buttons but that seemed it wouldn't register some times so I moved to the touch up and outside and inside but then I felt the edges when clicked wouldnt register. I know moved to every button in the key board has a tap gesture. This seems to be alot better but still missing the fluidness of the default keyboard. I am not expecting it to be perfect but something like swiftkey. Please ask if you want to see anything or if anything didnt make sense.Thank you!
3
0
635
2d
Custom keyboard extension left edge detecting touch after a second.
I'm creating a custom keyboard extension. So as a result, there are buttons which are pinned to the left edge of the keyboard. (Think of q key as an example). The logic of the key presses go something like this: Button detects a touchDown event and shows the magnified text which you normally see in system keyboard when tapping a key. Button detects a touchUpInside/touchDragOutside event and the magnified text disappears, again very similar to the system keyboard. This logic worked for all the buttons which were not pinned to the left edge of the keyboard. But for the buttons that were pinned to the left edge, the touchDown events were being detected after a second. So you can see this is obviously bad because I want to see the magnified text right after I place my finger on the button. WHAT I TRIED AS AN ALTERNATIVE: I removed all the touchDown, touchUpInside and touchDragOutside events from the button and disabled all their user interaction. Then I implemented to touches functions(touchesBegan, touchesEnded, etc.) and observed the touch locations on the background view. Surprisingly, even in this case, the touchesBegan function was called after a second after I placed my finger on the left edge of the screen and as usual, the touchesBegan function called just fine in the rest of the screen. Here's the code for the touches function: override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { 		guard let touch = event?.allTouches?.first else { return } 		let location = touch.location(in: self.touchView) 				 		print(location) } What exactly is happening here? And what can I do to avoid this problem? NOTE: It works fine in simulator for some reason but has a problem with real devices.
1
2
554
2d
Navigation Title and UIAlertViewController actions truncated/cut on iPhone 13/14/15 Pro Max with iOS 26.4/5 using Cyrillic localisation
Since iOS 26.4, we are observing an issue on iPhone 13 Pro Max, iPhone 14 Pro Max, and iPhone 15 Pro Max where text is truncated on first presentation when using Bulgarian (Cyrillic) localization. The issue affects: UINavigationBar title (both inline and large titles) UIAlertController action titles Behavior: On first presentation, the text is truncated/cut off. On subsequent presentations, the layout appears correct. Adding a zero-width space (\u{200B}) before the last character of the string prevents truncation. This appears to slightly increase the layout width calculation and avoids the issue. Has anyone else encountered this behavior or found a more appropriate workaround?
0
0
55
4d
Switch view that digital crown controls
I wonder if there is way to switch the view that the digital crown controls. Like if have a list and a vertical tab view, when the tab displays, I want the crown control the scrolling in the tab. I dont want to use sheet, cause I have some special UX design, and also dont want to use if else to toggle between the two views. I have tried with resetFocus and other focus related functions, not working
0
0
23
5d
Under what conditions can a LocalizedStringResource be serialised?
I had a need to store a localised string in a shared file used by other applications, and noticed that LocalizedStringResource conforms to Codable -- and indeed, if I encode a string from App A, then switch to App B, B is able to read the value and load different localisations of that string out of App A's bundle. Very cool. This isn't clearly documented (the documentation for LocalizedStringResource just mentions cross-process use, not generally longer-term storage), so I wondered if there are any caveats to be aware of when using this approach? I am aware that LocalizedStringResource is just a reference, so obviously if App A is deleted, it becomes a kind of dangling reference and will presumably fall back to its default value (which is included in the encoded representation). But I also noticed that the encoded LSR includes a sandbox extension token. Is there anything in particular to be aware of with that? Is it time-limited? One thing I did notice, that is quite annoying (potentially a bug) is that if I serialise and deserialise a record containing a LSR, it no longer compares as == to its previous self. That is because the original LSR did not contain a sandbox extension token, but as part of encoding it, that field seems to get populated. I'm not sure if there is a good workaround there; perhaps the extension token could be ignored from ==? That would result in extension tokens being dropped (e.g. if you had two LSRs in a Dictionary, differing only by the sandbox token, they would still be considered substitutable and already "in" the dictionary), but perhaps that's fine.
1
0
61
5d
Creating UTImportedTypeDeclarations entries yields duplicate Open menu entry
My iPadOS app can open .xml files. In my XMLApp.swift, I hooked up a: var body: some Scene { WindowGroup(id: "main") { .commands CommandGroup(replacing: .newItem) { ... Button(.openDot) { openXMLFile() } ... Next, I entered a new UTImportedTypeDeclarations / UTExportedTypeDeclarations in Project Settings -> Target -> Info -> Document Types, Exported Type Identifiers, Imported Type Identifiers, for the XML file-type: ... <key>UTImportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> <string>public.xml</string> <string>public.content</string> </array> ... As soon as I do that, Xcode creates an additional Open... menu entry all the way at the bottom of the File menu. I cannot get rid of this additional menu entry. Its state is disabled (grayed out). I have my own Open (per the code above), which also responds to ⌘ - O. My menu entry works fine, as long as I disable the same keyboard shortcut so they don't collide. The extra Open entry is also displayed on the matching iPadOS simulator. From the same codebase, the Open is not displayed on the Mac (targeting macOS, not Catalyst). On macOS, only my Open is in the File menu, as expected. Why is there a duplicate Open menu entry and how do I get rid of it?
0
0
153
1w
Embedded Collection View in SwiftUI offset issue
I have a collection view that covers all the screen and it is scrolling behavior is paging. This collection view is embedded in a UIViewRepresentable and used in a SwiftUI app. The issue is that when users rotate the devices, sometimes the CollectionView.contentOffset get miscalculated and shows 2 pages. This is the code that I'm using for the collectionView and collectionViewLayout: class PageFlowLayout: UICollectionViewFlowLayout { override class var layoutAttributesClass: AnyClass { UICollectionViewLayoutAttributes.self } private var calculatedAttributes: [UICollectionViewLayoutAttributes] = [] private var calculatedContentWidth: CGFloat = 0 private var calculatedContentHeight: CGFloat = 0 public weak var delegate: PageFlowLayoutDelegate? override var collectionViewContentSize: CGSize { return CGSize(width: self.calculatedContentWidth, height: self.calculatedContentHeight) } override init() { super.init() self.estimatedItemSize = .zero self.scrollDirection = .horizontal self.minimumLineSpacing = 0 self.minimumInteritemSpacing = 0 self.sectionInset = .zero } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func prepare() { guard let collectionView = collectionView, collectionView.numberOfSections > 0, calculatedAttributes.isEmpty else { return } estimatedItemSize = collectionView.bounds.size for item in 0..<collectionView.numberOfItems(inSection: 0) { let indexPath = IndexPath(item: item, section: 0) let attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath) let itemOrigin = CGPoint(x: CGFloat(item) * collectionView.frame.width, y: 0) attributes.frame = .init(origin: itemOrigin, size: collectionView.frame.size) calculatedAttributes.append(attributes) } calculatedContentWidth = collectionView.bounds.width * CGFloat(calculatedAttributes.count) calculatedContentHeight = collectionView.bounds.size.height } override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { return calculatedAttributes.compactMap { return $0.frame.intersects(rect) ? $0 : nil } } override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { return calculatedAttributes[indexPath.item] } override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { guard let collectionView else { return false } if newBounds.size != collectionView.bounds.size { return true } if newBounds.size.width > 0 { let pages = calculatedContentWidth / newBounds.size.width // If the contentWidth matches the number of pages, // if not it requires to layout the cells let arePagesExact = pages.truncatingRemainder(dividingBy: 1) == 0 return !arePagesExact } return false } override func invalidateLayout() { calculatedAttributes = [] super.invalidateLayout() } override func shouldInvalidateLayout(forPreferredLayoutAttributes preferredAttributes: UICollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: UICollectionViewLayoutAttributes) -> Bool { guard let collectionView, #available(iOS 18.0, *) else { return false } return preferredAttributes.size != collectionView.bounds.size } override func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext) { guard let customContext = context as? UICollectionViewFlowLayoutInvalidationContext else { return } if let collectionView, let currentPage = delegate?.currentPage() { let delta = (CGFloat(currentPage) * collectionView.bounds.width) - collectionView.contentOffset.x customContext.contentOffsetAdjustment.x += delta } calculatedAttributes = [] super.invalidateLayout(with: customContext) } override func prepare(forAnimatedBoundsChange oldBounds: CGRect) { super.prepare(forAnimatedBoundsChange: oldBounds) guard let collectionView else { return } if oldBounds.width != collectionView.bounds.width { invalidateLayout() } } override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint { guard let collectionView, let currentPage = delegate?.currentPage() else { return .zero } let targetContentOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset) let targetPage = targetContentOffset.x / collectionView.frame.width if targetPage != CGFloat(currentPage) { let xPosition = CGFloat(currentPage) * collectionView.frame.width return CGPoint(x: xPosition, y: 0) } return targetContentOffset } // This function updates the contentOffset in case is wrong override func finalizeCollectionViewUpdates() { guard let collectionView, let currentPage = delegate?.currentPage() else { return } let xPosition = CGFloat(currentPage) * collectionView.bounds.width if xPosition != collectionView.contentOffset.x { let offset = CGPoint(x: xPosition, y: 0) collectionView.setContentOffset(offset, animated: false) } } } The full implementation is attached in the .txt file: RotationTestView.txt
6
0
179
2w
MIDI Drag-and-drop to Logic Pro via NSItemProvider
Logic Pro recently changed the way it accepts drag and drop. If the ItemProvider contains UTType.midi, then Logic Pro shows visual feedback for the drop operation, but when the item is dropped, nothing happens. In the past, drag-and-drop used to work. With today's version (Logic Pro 11.2), the only way I was able to successfully drop MIDI was to provide UTType.fileURL and no other data types. But that's not a viable solution; I need other data types to be included too. As a side note, I tested with Ableton Live 12 and it works with no issue. Is this a bug in Logic Pro? What ItemProvider structure does Logic Pro expect to correctly receive the MIDI data?
5
0
334
2w
CarPlay CPListImageRowItem causes Inverted Scrolling and Side Button malfunction
In my CarPlaySceneDelegate.swift, I have two tabs: The first tab uses a CPListImageRowItem with a CPListImageRowItemRowElement. The scroll direction is inverted, and the side button does not function correctly. The second tab uses multiple CPListItem objects. There are no issues: scrolling works in the correct direction, and the side button behaves as expected. Steps To Reproduce Launch the app. Connect to CarPlay. In the first tab, scroll up and down, then use the side button to navigate. In the second tab, scroll up and down, then use the side button to navigate. As observed, the scrolling behavior is different between the two tabs. Code Example: import CarPlay import UIKit class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate { var interfaceController: CPInterfaceController? func templateApplicationScene( _ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController ) { self.interfaceController = interfaceController downloadImageAndSetupTemplates() } func templateApplicationScene( _ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController ) { self.interfaceController = nil } private func downloadImageAndSetupTemplates() { let urlString = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRcYUjd1FYkF04-8Vb7PKI1mGoF2quLPHKjvnR7V4ReZR8UjW-0NJ_kC7q13eISZGoTCLHaDPVbOthhH9QNq-YA0uuSUjfAoB3PPs1aXQ&s=10" guard let url = URL(string: urlString) else { setupTemplates(with: UIImage(systemName: "photo")!) return } URLSession.shared.dataTask(with: url) { [weak self] data, _, _ in let image: UIImage if let data = data, let downloaded = UIImage(data: data) { image = downloaded } else { image = UIImage(systemName: "photo")! } DispatchQueue.main.async { self?.setupTemplates(with: image) } }.resume() } private func setupTemplates(with image: UIImage) { // Tab 1 : un seul CPListImageRowItem avec 12 CPListImageRowItemRowElement let elements: [CPListImageRowItemRowElement] = (1...12).map { index in CPListImageRowItemRowElement(image: image, title: "test \(index)", subtitle: nil) } let rowItem = CPListImageRowItem(text: "Images", elements: elements, allowsMultipleLines: true) rowItem.listImageRowHandler = { item, elementIndex, completion in print("tapped element \(elementIndex)") completion() } let tab1Section = CPListSection(items: [rowItem]) let tab1Template = CPListTemplate(title: "CPListImageRowItemRowElement", sections: [tab1Section]) // Tab 2 : 12 CPListItem simples let tab2Items: [CPListItem] = (1...12).map { index in let item = CPListItem(text: "Item \(index)", detailText: "Detail \(index)") item.handler = { _, completion in print("handler Tab 2") completion() } return item } let tab2Section = CPListSection(items: tab2Items) let tab2Template = CPListTemplate(title: "CPListItem", sections: [tab2Section]) // CPTabBarTemplate avec les deux tabs let tabBar = CPTabBarTemplate(templates: [tab1Template, tab2Template]) interfaceController?.setRootTemplate(tabBar, animated: true) } } Here is a quick video:
7
0
573
2w
CarPlay navigation guidance panel with red color in iOS 26.4
When upgrading to iOS 26.4, the guidance panel in CPMapTemplate is displayed in a striking red color. This happens with App Store version of the app which was compiled with iOS 26.2. Up to iOS 26.4 this panel has always been shown with a color which matches the ETA view below, in a dark gray. Compiling the app with iOS 26.4 makes nos difference. I have checked my code and I cannot see anything on my side which can trigger this change in the colour and only for iOS 26.4. I thought of restoring the old behaviour by using the property guidanceBackgroundColor in CPMapTemplate. But although I have tried to use a gray, I still get the red color. Is this the intended color in iOS 26.4? Is it a bug? Is there a way to use a custom color which matches the left and ETA panels? Thank you.
1
0
151
3w
Cursing the cursor.
There are 2 text entry points, a text view and a text field. The text view Compose disallows touch. Enter text in the text field, return to the text view and the text view cursor is gone. Is there a way to reset the pointer to visible using a xcode button? My workaround is to change views, return (the cursor is visible) then restore the text. Which is an annoying process. The app myownkeyboard PAD is free. The Compose view has the problem. Any suggestions would be appreciated. Thanks.....Charlie 10apr2026
Topic: UI Frameworks SubTopic: General
0
0
63
3w
React Native iOS TextInput autofill bar goes blank/flickers while editing username field
I’m seeing a weird iOS Password AutoFill behavior in React Native and I’m trying to figure out whether this is: expected iOS behavior, a known React Native TextInput issue, or something I can work around. Setup: React Native 0.81.5 iOS app with Associated Domains configured and working Password AutoFill generally works fine two fields on a login screen: username/email: autoComplete="username" password: autoComplete="current-password" What happens: when the login screen opens, the iOS autofill bar above the keyboard shows the saved credential suggestion as expected as soon as I type a single character into the username field, the autofill bar goes blank instead of continuing to show a suggestion if I press delete while the field is already empty, the autofill suggestion flickers Important detail: autofill itself is not completely broken Associated Domains are set up and credential suggestions do appear the issue is specifically the unstable behavior of the autofill bar while editing Question: has anyone seen this with React Native TextInput on iOS? is this just how iOS reevaluates credential suggestions once the username starts changing? or is there a known RN-side trigger here, for example controlled inputs, secureTextEntry, rerenders, focus changes, or textContentType / autoComplete combinations?
0
0
71
3w
AVCaptureVideoDataOutput stops zooming while AVCaptureVideoPreviewLayer continues — physical wide / ultra-wide / telephoto only
We use a single AVCaptureSession with AVCaptureVideoPreviewLayer and AVCaptureVideoDataOutput (preview-sized buffers, BGRA). When we increase videoZoomFactor, beyond a certain zoom level the image from AVCaptureVideoDataOutput no longer zooms further, while AVCaptureVideoPreviewLayer continues to zoom with the same zoom control. The preview and the video-data output therefore diverge. This behavior appears when the active camera is a physical lens device — wide, ultra-wide, or telephoto (e.g. builtInWideAngleCamera, builtInUltraWideCamera, builtInTelephotoCamera, or similar). It does not appear when the active input is a virtual / multi-camera (e.g. triple camera, dual-wide, or other system multi-camera). Are there known conditions under which this mismatch between preview and video-data output is expected? Thank you.
1
0
144
3w
How to use CPTabBarTemplate on navigation apps?
According to the CarPlay developer guide navigation apps are allowed to use the CPTabBarTemplate. Thing is that navigation apps most likely use a CPMapTemplate as root template already, so how should the CPTabBarTemplate be used then? Setting a new root with a CPTabBarTemplate will probably break ongoing navigation and CPTabBarTemplate can't be pushed.
0
0
133
3w
MEMessageActionHandler — Mail shows "Uninstall only", no enable toggle, consent dialog never fires
I'm implementing a MEMessageActionHandler Mail extension on macOS 26.4.1 (Xcode 26.4). The extension is discovered by Mail and appears in Mail > Settings > Extensions, but Mail shows only an "Uninstall" button — no enable toggle. The MailKit consent dialog asking permission to process messages in the background has never appeared. Console logs show optedIn: NO / userEnabled: Not Enabled. Extension Info.plist (key parts): NSExtensionPointIdentifier com.apple.email.extension NSExtensionPrincipalClass CheckThisMailExtension.MailExtension MEExtensionCapabilities MEMessageActionHandler Principal class: class MailExtension: NSObject, MEExtension { func handlerForMessageActions() -> any MEMessageActionHandler { return MessageActionHandler() } } Entitlements: app-sandbox: true, application-groups: [group.com.xxx]. App is Developer ID signed and notarized. Has anyone successfully gotten the consent dialog to appear for MEMessageActionHandler on macOS 15/26? Is there something beyond the standard template configuration that enables it? Any entitlement that needs to be provisioned separately?
Replies
1
Boosts
0
Views
126
Activity
14h
How can I reliably get the final restored window size on macOS when onAppear / viewDidAppear fires too early?
I’m running into a macOS window restoration behavior issue where viewDidAppear (AppKit) or onAppear (SwiftUI) fires before the window’s final restored size is applied. AppKit example class MyViewController: NSViewController { override func viewDidLayout() { print("viewDidLayout: \(view.bounds.size)") } override func viewDidAppear() { print("viewDidAppear: \(view.bounds.size)") } } Logs on launch: viewDidAppear: (480.0, 270.0) viewDidLayout: (480.0, 270.0) viewDidLayout: (556.0, 476.0) viewDidLayout: (556.0, 476.0) The correct restored size is (556.0, 476.0), but viewDidAppear initially reports the old default size (480.0, 270.0). SwiftUI equivalent struct MyView: View { var body: some View { GeometryReader { geo in VStack {} .onAppear { print("onAppear: \(geo.size)") } .onChange(of: geo.size) { print("onChange: \(geo.size)") } } } } Logs on launch: onAppear: (900.0, 450.0) onChange: (680.0, 658.0) Problem I need to run some setup code: Only once After the view/window has its correct restored size Without rerunning on every layout or geometry change Question What is the proper macOS-native way to perform one-time startup logic only after the final restored window size is available? Is there a recommended lifecycle hook or pattern for this? Also, is it expected behavior that onAppear / viewDidAppear reports the pre-restoration size, or is it a bug?
Replies
3
Boosts
0
Views
131
Activity
20h
Custom keyboard.
I have created a keyboard extension but I do not feel the responsiveness like the default keyboard. I feel I have to mash down the keys and I feel when typing quickly the touch will skip a letter or two till the UI catches back up. My process - I have an xib that the visual is made. I have created my view then I added a view inside that and then 4 rows(views) inside that. In the rows I place the buttons. I had the touch down event for the buttons but that seemed it wouldn't register some times so I moved to the touch up and outside and inside but then I felt the edges when clicked wouldnt register. I know moved to every button in the key board has a tap gesture. This seems to be alot better but still missing the fluidness of the default keyboard. I am not expecting it to be perfect but something like swiftkey. Please ask if you want to see anything or if anything didnt make sense.Thank you!
Replies
3
Boosts
0
Views
635
Activity
2d
Custom keyboard extension left edge detecting touch after a second.
I'm creating a custom keyboard extension. So as a result, there are buttons which are pinned to the left edge of the keyboard. (Think of q key as an example). The logic of the key presses go something like this: Button detects a touchDown event and shows the magnified text which you normally see in system keyboard when tapping a key. Button detects a touchUpInside/touchDragOutside event and the magnified text disappears, again very similar to the system keyboard. This logic worked for all the buttons which were not pinned to the left edge of the keyboard. But for the buttons that were pinned to the left edge, the touchDown events were being detected after a second. So you can see this is obviously bad because I want to see the magnified text right after I place my finger on the button. WHAT I TRIED AS AN ALTERNATIVE: I removed all the touchDown, touchUpInside and touchDragOutside events from the button and disabled all their user interaction. Then I implemented to touches functions(touchesBegan, touchesEnded, etc.) and observed the touch locations on the background view. Surprisingly, even in this case, the touchesBegan function was called after a second after I placed my finger on the left edge of the screen and as usual, the touchesBegan function called just fine in the rest of the screen. Here's the code for the touches function: override func touchesBegan(_ touches: Set&lt;UITouch&gt;, with event: UIEvent?) { &#9;&#9;guard let touch = event?.allTouches?.first else { return } &#9;&#9;let location = touch.location(in: self.touchView) &#9;&#9;&#9;&#9; &#9;&#9;print(location) } What exactly is happening here? And what can I do to avoid this problem? NOTE: It works fine in simulator for some reason but has a problem with real devices.
Replies
1
Boosts
2
Views
554
Activity
2d
Navigation Title and UIAlertViewController actions truncated/cut on iPhone 13/14/15 Pro Max with iOS 26.4/5 using Cyrillic localisation
Since iOS 26.4, we are observing an issue on iPhone 13 Pro Max, iPhone 14 Pro Max, and iPhone 15 Pro Max where text is truncated on first presentation when using Bulgarian (Cyrillic) localization. The issue affects: UINavigationBar title (both inline and large titles) UIAlertController action titles Behavior: On first presentation, the text is truncated/cut off. On subsequent presentations, the layout appears correct. Adding a zero-width space (\u{200B}) before the last character of the string prevents truncation. This appears to slightly increase the layout width calculation and avoids the issue. Has anyone else encountered this behavior or found a more appropriate workaround?
Replies
0
Boosts
0
Views
55
Activity
4d
Switch view that digital crown controls
I wonder if there is way to switch the view that the digital crown controls. Like if have a list and a vertical tab view, when the tab displays, I want the crown control the scrolling in the tab. I dont want to use sheet, cause I have some special UX design, and also dont want to use if else to toggle between the two views. I have tried with resetFocus and other focus related functions, not working
Replies
0
Boosts
0
Views
23
Activity
5d
Under what conditions can a LocalizedStringResource be serialised?
I had a need to store a localised string in a shared file used by other applications, and noticed that LocalizedStringResource conforms to Codable -- and indeed, if I encode a string from App A, then switch to App B, B is able to read the value and load different localisations of that string out of App A's bundle. Very cool. This isn't clearly documented (the documentation for LocalizedStringResource just mentions cross-process use, not generally longer-term storage), so I wondered if there are any caveats to be aware of when using this approach? I am aware that LocalizedStringResource is just a reference, so obviously if App A is deleted, it becomes a kind of dangling reference and will presumably fall back to its default value (which is included in the encoded representation). But I also noticed that the encoded LSR includes a sandbox extension token. Is there anything in particular to be aware of with that? Is it time-limited? One thing I did notice, that is quite annoying (potentially a bug) is that if I serialise and deserialise a record containing a LSR, it no longer compares as == to its previous self. That is because the original LSR did not contain a sandbox extension token, but as part of encoding it, that field seems to get populated. I'm not sure if there is a good workaround there; perhaps the extension token could be ignored from ==? That would result in extension tokens being dropped (e.g. if you had two LSRs in a Dictionary, differing only by the sandbox token, they would still be considered substitutable and already "in" the dictionary), but perhaps that's fine.
Replies
1
Boosts
0
Views
61
Activity
5d
Creating UTImportedTypeDeclarations entries yields duplicate Open menu entry
My iPadOS app can open .xml files. In my XMLApp.swift, I hooked up a: var body: some Scene { WindowGroup(id: "main") { .commands CommandGroup(replacing: .newItem) { ... Button(.openDot) { openXMLFile() } ... Next, I entered a new UTImportedTypeDeclarations / UTExportedTypeDeclarations in Project Settings -> Target -> Info -> Document Types, Exported Type Identifiers, Imported Type Identifiers, for the XML file-type: ... <key>UTImportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> <string>public.xml</string> <string>public.content</string> </array> ... As soon as I do that, Xcode creates an additional Open... menu entry all the way at the bottom of the File menu. I cannot get rid of this additional menu entry. Its state is disabled (grayed out). I have my own Open (per the code above), which also responds to ⌘ - O. My menu entry works fine, as long as I disable the same keyboard shortcut so they don't collide. The extra Open entry is also displayed on the matching iPadOS simulator. From the same codebase, the Open is not displayed on the Mac (targeting macOS, not Catalyst). On macOS, only my Open is in the File menu, as expected. Why is there a duplicate Open menu entry and how do I get rid of it?
Replies
0
Boosts
0
Views
153
Activity
1w
Embedded Collection View in SwiftUI offset issue
I have a collection view that covers all the screen and it is scrolling behavior is paging. This collection view is embedded in a UIViewRepresentable and used in a SwiftUI app. The issue is that when users rotate the devices, sometimes the CollectionView.contentOffset get miscalculated and shows 2 pages. This is the code that I'm using for the collectionView and collectionViewLayout: class PageFlowLayout: UICollectionViewFlowLayout { override class var layoutAttributesClass: AnyClass { UICollectionViewLayoutAttributes.self } private var calculatedAttributes: [UICollectionViewLayoutAttributes] = [] private var calculatedContentWidth: CGFloat = 0 private var calculatedContentHeight: CGFloat = 0 public weak var delegate: PageFlowLayoutDelegate? override var collectionViewContentSize: CGSize { return CGSize(width: self.calculatedContentWidth, height: self.calculatedContentHeight) } override init() { super.init() self.estimatedItemSize = .zero self.scrollDirection = .horizontal self.minimumLineSpacing = 0 self.minimumInteritemSpacing = 0 self.sectionInset = .zero } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func prepare() { guard let collectionView = collectionView, collectionView.numberOfSections > 0, calculatedAttributes.isEmpty else { return } estimatedItemSize = collectionView.bounds.size for item in 0..<collectionView.numberOfItems(inSection: 0) { let indexPath = IndexPath(item: item, section: 0) let attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath) let itemOrigin = CGPoint(x: CGFloat(item) * collectionView.frame.width, y: 0) attributes.frame = .init(origin: itemOrigin, size: collectionView.frame.size) calculatedAttributes.append(attributes) } calculatedContentWidth = collectionView.bounds.width * CGFloat(calculatedAttributes.count) calculatedContentHeight = collectionView.bounds.size.height } override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { return calculatedAttributes.compactMap { return $0.frame.intersects(rect) ? $0 : nil } } override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { return calculatedAttributes[indexPath.item] } override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { guard let collectionView else { return false } if newBounds.size != collectionView.bounds.size { return true } if newBounds.size.width > 0 { let pages = calculatedContentWidth / newBounds.size.width // If the contentWidth matches the number of pages, // if not it requires to layout the cells let arePagesExact = pages.truncatingRemainder(dividingBy: 1) == 0 return !arePagesExact } return false } override func invalidateLayout() { calculatedAttributes = [] super.invalidateLayout() } override func shouldInvalidateLayout(forPreferredLayoutAttributes preferredAttributes: UICollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: UICollectionViewLayoutAttributes) -> Bool { guard let collectionView, #available(iOS 18.0, *) else { return false } return preferredAttributes.size != collectionView.bounds.size } override func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext) { guard let customContext = context as? UICollectionViewFlowLayoutInvalidationContext else { return } if let collectionView, let currentPage = delegate?.currentPage() { let delta = (CGFloat(currentPage) * collectionView.bounds.width) - collectionView.contentOffset.x customContext.contentOffsetAdjustment.x += delta } calculatedAttributes = [] super.invalidateLayout(with: customContext) } override func prepare(forAnimatedBoundsChange oldBounds: CGRect) { super.prepare(forAnimatedBoundsChange: oldBounds) guard let collectionView else { return } if oldBounds.width != collectionView.bounds.width { invalidateLayout() } } override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint { guard let collectionView, let currentPage = delegate?.currentPage() else { return .zero } let targetContentOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset) let targetPage = targetContentOffset.x / collectionView.frame.width if targetPage != CGFloat(currentPage) { let xPosition = CGFloat(currentPage) * collectionView.frame.width return CGPoint(x: xPosition, y: 0) } return targetContentOffset } // This function updates the contentOffset in case is wrong override func finalizeCollectionViewUpdates() { guard let collectionView, let currentPage = delegate?.currentPage() else { return } let xPosition = CGFloat(currentPage) * collectionView.bounds.width if xPosition != collectionView.contentOffset.x { let offset = CGPoint(x: xPosition, y: 0) collectionView.setContentOffset(offset, animated: false) } } } The full implementation is attached in the .txt file: RotationTestView.txt
Replies
6
Boosts
0
Views
179
Activity
2w
Logic Pro 11.2.2 drag audio into plugin Broken
I am an audio plugin developer. 11.2.1 we were able to drag audio from the arrange page into the plugin. 11.2.2. that is now broken. I saw someone have a similar post, but MIDI. Any help would be greatly appreciated.
Replies
1
Boosts
0
Views
83
Activity
2w
MIDI Drag-and-drop to Logic Pro via NSItemProvider
Logic Pro recently changed the way it accepts drag and drop. If the ItemProvider contains UTType.midi, then Logic Pro shows visual feedback for the drop operation, but when the item is dropped, nothing happens. In the past, drag-and-drop used to work. With today's version (Logic Pro 11.2), the only way I was able to successfully drop MIDI was to provide UTType.fileURL and no other data types. But that's not a viable solution; I need other data types to be included too. As a side note, I tested with Ableton Live 12 and it works with no issue. Is this a bug in Logic Pro? What ItemProvider structure does Logic Pro expect to correctly receive the MIDI data?
Replies
5
Boosts
0
Views
334
Activity
2w
CarPlay CPListImageRowItem causes Inverted Scrolling and Side Button malfunction
In my CarPlaySceneDelegate.swift, I have two tabs: The first tab uses a CPListImageRowItem with a CPListImageRowItemRowElement. The scroll direction is inverted, and the side button does not function correctly. The second tab uses multiple CPListItem objects. There are no issues: scrolling works in the correct direction, and the side button behaves as expected. Steps To Reproduce Launch the app. Connect to CarPlay. In the first tab, scroll up and down, then use the side button to navigate. In the second tab, scroll up and down, then use the side button to navigate. As observed, the scrolling behavior is different between the two tabs. Code Example: import CarPlay import UIKit class CarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate { var interfaceController: CPInterfaceController? func templateApplicationScene( _ templateApplicationScene: CPTemplateApplicationScene, didConnect interfaceController: CPInterfaceController ) { self.interfaceController = interfaceController downloadImageAndSetupTemplates() } func templateApplicationScene( _ templateApplicationScene: CPTemplateApplicationScene, didDisconnectInterfaceController interfaceController: CPInterfaceController ) { self.interfaceController = nil } private func downloadImageAndSetupTemplates() { let urlString = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRcYUjd1FYkF04-8Vb7PKI1mGoF2quLPHKjvnR7V4ReZR8UjW-0NJ_kC7q13eISZGoTCLHaDPVbOthhH9QNq-YA0uuSUjfAoB3PPs1aXQ&s=10" guard let url = URL(string: urlString) else { setupTemplates(with: UIImage(systemName: "photo")!) return } URLSession.shared.dataTask(with: url) { [weak self] data, _, _ in let image: UIImage if let data = data, let downloaded = UIImage(data: data) { image = downloaded } else { image = UIImage(systemName: "photo")! } DispatchQueue.main.async { self?.setupTemplates(with: image) } }.resume() } private func setupTemplates(with image: UIImage) { // Tab 1 : un seul CPListImageRowItem avec 12 CPListImageRowItemRowElement let elements: [CPListImageRowItemRowElement] = (1...12).map { index in CPListImageRowItemRowElement(image: image, title: "test \(index)", subtitle: nil) } let rowItem = CPListImageRowItem(text: "Images", elements: elements, allowsMultipleLines: true) rowItem.listImageRowHandler = { item, elementIndex, completion in print("tapped element \(elementIndex)") completion() } let tab1Section = CPListSection(items: [rowItem]) let tab1Template = CPListTemplate(title: "CPListImageRowItemRowElement", sections: [tab1Section]) // Tab 2 : 12 CPListItem simples let tab2Items: [CPListItem] = (1...12).map { index in let item = CPListItem(text: "Item \(index)", detailText: "Detail \(index)") item.handler = { _, completion in print("handler Tab 2") completion() } return item } let tab2Section = CPListSection(items: tab2Items) let tab2Template = CPListTemplate(title: "CPListItem", sections: [tab2Section]) // CPTabBarTemplate avec les deux tabs let tabBar = CPTabBarTemplate(templates: [tab1Template, tab2Template]) interfaceController?.setRootTemplate(tabBar, animated: true) } } Here is a quick video:
Replies
7
Boosts
0
Views
573
Activity
2w
How to disable automatic hyphenation on iPhone?
Does anyone know how to remove that automatic hyphen at the end of a sentence when the word doesn't fit on the line? It's so annoying and incredibly disruptive. I tried sending an HTML file on WhatsApp, and I couldn't get it to work without that darn hyphen. Iphone 17, ios 26.5 beta
Replies
3
Boosts
0
Views
180
Activity
2w
CarPlay navigation guidance panel with red color in iOS 26.4
When upgrading to iOS 26.4, the guidance panel in CPMapTemplate is displayed in a striking red color. This happens with App Store version of the app which was compiled with iOS 26.2. Up to iOS 26.4 this panel has always been shown with a color which matches the ETA view below, in a dark gray. Compiling the app with iOS 26.4 makes nos difference. I have checked my code and I cannot see anything on my side which can trigger this change in the colour and only for iOS 26.4. I thought of restoring the old behaviour by using the property guidanceBackgroundColor in CPMapTemplate. But although I have tried to use a gray, I still get the red color. Is this the intended color in iOS 26.4? Is it a bug? Is there a way to use a custom color which matches the left and ETA panels? Thank you.
Replies
1
Boosts
0
Views
151
Activity
3w
Cursing the cursor.
There are 2 text entry points, a text view and a text field. The text view Compose disallows touch. Enter text in the text field, return to the text view and the text view cursor is gone. Is there a way to reset the pointer to visible using a xcode button? My workaround is to change views, return (the cursor is visible) then restore the text. Which is an annoying process. The app myownkeyboard PAD is free. The Compose view has the problem. Any suggestions would be appreciated. Thanks.....Charlie 10apr2026
Topic: UI Frameworks SubTopic: General
Replies
0
Boosts
0
Views
63
Activity
3w
.icon files and "imageNamed:"
Composer icons can be loaded with NSImage's imageNamed: but I haven't figured out how to make it load any variation other than the light style. Is this even possible? Thank you!
Replies
0
Boosts
0
Views
108
Activity
3w
React Native iOS TextInput autofill bar goes blank/flickers while editing username field
I’m seeing a weird iOS Password AutoFill behavior in React Native and I’m trying to figure out whether this is: expected iOS behavior, a known React Native TextInput issue, or something I can work around. Setup: React Native 0.81.5 iOS app with Associated Domains configured and working Password AutoFill generally works fine two fields on a login screen: username/email: autoComplete="username" password: autoComplete="current-password" What happens: when the login screen opens, the iOS autofill bar above the keyboard shows the saved credential suggestion as expected as soon as I type a single character into the username field, the autofill bar goes blank instead of continuing to show a suggestion if I press delete while the field is already empty, the autofill suggestion flickers Important detail: autofill itself is not completely broken Associated Domains are set up and credential suggestions do appear the issue is specifically the unstable behavior of the autofill bar while editing Question: has anyone seen this with React Native TextInput on iOS? is this just how iOS reevaluates credential suggestions once the username starts changing? or is there a known RN-side trigger here, for example controlled inputs, secureTextEntry, rerenders, focus changes, or textContentType / autoComplete combinations?
Replies
0
Boosts
0
Views
71
Activity
3w
iOS 26.4 lock screen shortcuts not able to change
The Lock Screen customization menu fails to replace the default "Camera" shortcut with a selected third-party or system control. Despite the UI appearing to save the new selection, the Lock Screen reverts to the Camera icon immediately upon exiting customization mode.
Topic: UI Frameworks SubTopic: General
Replies
0
Boosts
0
Views
70
Activity
3w
AVCaptureVideoDataOutput stops zooming while AVCaptureVideoPreviewLayer continues — physical wide / ultra-wide / telephoto only
We use a single AVCaptureSession with AVCaptureVideoPreviewLayer and AVCaptureVideoDataOutput (preview-sized buffers, BGRA). When we increase videoZoomFactor, beyond a certain zoom level the image from AVCaptureVideoDataOutput no longer zooms further, while AVCaptureVideoPreviewLayer continues to zoom with the same zoom control. The preview and the video-data output therefore diverge. This behavior appears when the active camera is a physical lens device — wide, ultra-wide, or telephoto (e.g. builtInWideAngleCamera, builtInUltraWideCamera, builtInTelephotoCamera, or similar). It does not appear when the active input is a virtual / multi-camera (e.g. triple camera, dual-wide, or other system multi-camera). Are there known conditions under which this mismatch between preview and video-data output is expected? Thank you.
Replies
1
Boosts
0
Views
144
Activity
3w
How to use CPTabBarTemplate on navigation apps?
According to the CarPlay developer guide navigation apps are allowed to use the CPTabBarTemplate. Thing is that navigation apps most likely use a CPMapTemplate as root template already, so how should the CPTabBarTemplate be used then? Setting a new root with a CPTabBarTemplate will probably break ongoing navigation and CPTabBarTemplate can't be pushed.
Replies
0
Boosts
0
Views
133
Activity
3w