Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Created

A Summary of the WWDC25 Group Lab - UI Frameworks
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for UI Frameworks. How would you recommend developers start adopting the new design? Start by focusing on the foundational structural elements of your application, working from the "top down" or "bottom up" based on your application's hierarchy. These structural changes, like edge-to-edge content and updated navigation and controls, often require corresponding code modifications. As a first step, recompile your application with the new SDK to see what updates are automatically applied, especially if you've been using standard controls. Then, carefully analyze where the new design elements can be applied to your UI, paying particular attention to custom controls or UI that could benefit from a refresh. Address the large structural items first then focus on smaller details is recommended. Will we need to migrate our UI code to Swift and SwiftUI to adopt the new design? No, you will not need to migrate your UI code to Swift and SwiftUI to adopt the new design. The UI frameworks fully support the new design, allowing you to migrate your app with as little effort as possible, especially if you've been using standard controls. The goal is to make it easy to adopt the new design, regardless of your current UI framework, to achieve a cohesive look across the operating system. What was the reason for choosing Liquid Glass over frosted glass, as used in visionOS? The choice of Liquid Glass was driven by the desire to bring content to life. The see-through nature of Liquid Glass enhances this effect. The appearance of Liquid Glass adapts based on its size; larger glass elements look more frosted, which aligns with the design of visionOS, where everything feels larger and benefits from the frosted look. What are best practices for apps that use customized navigation bars? The new design emphasizes behavior and transitions as much as static appearance. Consider whether you truly need a custom navigation bar, or if the system-provided controls can meet your needs. Explore new APIs for subtitles and custom views in navigation bars, designed to support common use cases. If you still require a custom solution, ensure you're respecting safe areas using APIs like SwiftUI's safeAreaInset. When working with Liquid Glass, group related buttons in shared containers to maintain design consistency. Finally, mark glass containers as interactive. For branding, instead of coloring the navigation bar directly, consider incorporating branding colors into the content area behind the Liquid Glass controls. This creates a dynamic effect where the color is visible through the glass and moves with the content as the user scrolls. I want to know why new UI Framework APIs aren’t backward compatible, specifically in SwiftUI? It leads to code with lots of if-else statements. Existing APIs have been updated to work with the new design where possible, ensuring that apps using those APIs will adopt the new design and function on both older and newer operating systems. However, new APIs often depend on deep integration across the framework and graphics stack, making backward compatibility impractical. When using these new APIs, it's important to consider how they fit within the context of the latest OS. The use of if-else statements allows you to maintain compatibility with older systems while taking full advantage of the new APIs and design features on newer systems. If you are using new APIs, it likely means you are implementing something very specific to the new design language. Using conditional code allows you to intentionally create different code paths for the new design versus older operating systems. Prefer to use if #available where appropriate to intentionally adopt new design elements. Are there any Liquid Glass materials in iOS or macOS that are only available as part of dedicated components? Or are all those materials available through new UIKit and AppKit views? Yes, some variations of the Liquid Glass material are exclusively available through dedicated components like sliders, segmented controls, and tab bars. However, the "regular" and "clear" glass materials should satisfy most application requirements. If you encounter situations where these options are insufficient, please file feedback. If I were to create an app today, how should I design it to make it future proof using Liquid Glass? The best approach to future-proof your app is to utilize standard system controls and design your UI to align with the standard system look and feel. Using the framework-provided declarative API generally leads to easier adoption of future design changes, as you're expressing intent rather than specifying pixel-perfect visuals. Pay close attention to the design sessions offered this year, which cover the design motivation behind the Liquid Glass material and best practices for its use. Is it possible to implement your own sidebar on macOS without NSSplitViewController, but still provide the Liquid Glass appearance? While technically possible to create a custom sidebar that approximates the Liquid Glass appearance without using NSSplitViewController, it is not recommended. The system implementation of the sidebar involves significant unseen complexity, including interlayering with scroll edge effects and fullscreen behaviors. NSSplitViewController provides the necessary level of abstraction for the framework to handle these details correctly. Regarding the SceneDelagate and scene based life-cycle, I would like to confirm that AppDelegate is not going away. Also if the above is a correct understanding, is there any advice as to what should, and should not, be moved to the SceneDelegate? UIApplicationDelegate is not going away and still serves a purpose for application-level interactions with the system and managing scenes at a higher level. Move code related to your app's scene or UI into the UISceneDelegate. Remember that adopting scenes doesn't necessarily mean supporting multiple scenes; an app can be scene-based but still support only one scene. Refer to the tech note Migrating to the UIKit scene-based life cycle and the Make your UIKit app more flexible WWDC25 session for more information.
Topic: UI Frameworks SubTopic: General
0
0
836
Jun ’25
Live Q&A Summary - SwiftUI foundations: Build great apps with SwiftUI
Here’s a recap of the Live Q&A for SwiftUI foundations: Build great apps with SwiftUI. If you participated and asked questions, thank you for coming and participating! If you weren’t able to join us live we hope this recap is useful Where can I watch the VOD? Is the sample code “Wishlist” that was shown available for download? You can view the replay of the entire event here https://www.youtube.com/watch?v=Z3vloOtZLkQ The sample code for the Wishlist app will be made available in the coming weeks on the Apple Developer website, we'll send an update via email when it is available. What are the best practices when it comes to building complex navigations in SwiftUI? The developer website has documentation on navigation style best practices. Explore navigation basics like NavigationStack and TabView to get a ground-up understanding. For documentation on navigation APIs see Navigation. How can I integrate UIKit with my SwiftUI app? What about adding SwiftUI into my UIKit app? See UIKit integration: Add UIKit views to your SwiftUI app, or use SwiftUI views in your UIKit app. Both UIKit and SwiftUI provide API to show a view hierarchy of the other. For UIKit to SwiftUI, you would use UIViewControllerRepresentable. For SwiftUI to UIKit, you would use UIHostingController. Landmarks: Interfacing with UIKit walks you through step by step how to implement UIKit in SwiftUI with UIViewControllerRepresentable, and this WWDC22 video demonstrates UIHostingController, for those that want to add SwiftUI to their UIKit. Does Wishlist feature a new iOS 26 font? How can I add custom fonts and text of my app? We’re glad to hear many of you liked wide text shown in Wishlist, however, It is the default system font with some light SwiftUI styling! Check it out for yourself in the sample code when made available, and you can learn more about customizing fonts and text by seeing Font and Applying custom fonts to text. Does Xcode have a dependency graph we can use to optimize our SwiftUI Views? Xcode comes with Instruments. Instruments is the best way to figure out what is causing excessive updates and other issues with performance. That link provides direct tutorials and resources for how to use and understand. Previews also have many useful tools for analyzing SwiftUI views, for more info see Previews in Xcode Check out this video from our latest WWDC Optimize SwiftUI performance with Instruments for information on how to use Instruments to profile and optimize your app with real-world applications If you still have questions, Check out the Instruments section of these forums and create a post so the community has the opportunity to help guide you. Are there UI debugging tools to help diagnose layout issues? Yes, Xcode also features a View Debugger located by selecting the View Debug Hierarchy, pictured below. Use the View Debugger to capture and inspect your view hierarchy, identifying which views affect window sizing. The SwiftUI Inspector also lets you examine view frames and layout behavior. See Diagnosing issues in the appearance of a running app to learn about debugging visual and layout issues. As an absolute beginner, what would be the first go-to step to go for training? Do I need prior knowledge of frameworks to get started with SwiftUI? A great place to learn how to develop for Apple platforms is with Pathways! Many developers start with Develop in Swift tutorials, which exposes you to several frameworks while teaching you the basics of SwiftUI. When you're ready to take your learning further, you can read the documentation for the specific frameworks that interest you at https://developer.apple.com/documentation/.
Topic: UI Frameworks SubTopic: SwiftUI
4
0
239
3w
NSProgress - way to publish progress to make the file url unselectable in Finder?
So I'm in the middle of an asynchronous file operation. I publish an NSProgress and it displays wonderfully in Finder. But it is a folder and while the operation is in progress the user should not be allowed to enter it, modify it, etc, while the work is being done. I want to do this to protect the user from doing something silly. But Finder does not prevent the selection with the published progress. And while it would be kind of dumb to do - the user can just go about adding/removing contents to the folder while it has progress. If I remember correctly publishing an NSProgress did use to prevent the file from being selectable in Finder until either the progress finished or my app is quit (or maybe not)? But now the user is free to select, edit, modify during progress which could cause problems if the user does something unexpectedly silly. Is there a way to mark the file 'unselectable' with the published progress? Thanks in advance.
0
0
18
3h
Crown Sequencer warning on Scroll
I have a Form (scrollable) that contains 2 inputs as a Picker and a Stepper where frequency is an enum and time an Int. struct ConfigurationView: View { @Bindable var configuration: ConfigurationModel var body: some View { NavigationStack { Form { Picker(.frequency, selection: $configuration.frequency) { /* ... */ } Stepper(value: $configuration.time, in: 1...8) { // Stepper Label } .focusable() Button(.save) { configuration.save() } .buttonStyle(.borderedProminent) .listRowBackground(Color.clear) } .navigationTitle(.configuration) } } } The main issue I'm facing is a delay in the UI (1-3 seconds) while interacting with the Digital Crown over the focused Stepper which prints a Crown Sequencer warning: Crown Sequencer was set up without a view property. This will inevitably lead to incorrect crown indicator states This mainly happens when the Picker, which is showed as a modal or Sheet, changes its value, so the Stepper no longer gets focusable again. Looking into the docs, lectures and WWDC videos I just found that we need to provide a some sort of a focus, that's why the Stepper control has a focusable() modifier. I don't know if there is an overlap between the scroll and the focus event on the control.
0
0
21
13h
How do you disable split view tracking separators in macOS 26 Tahoe?
In the attached screenshot, we have an NSSplitViewController with three split view items. The first two are viewController split view items, while the third is an inspector split view item. The NSWindow is configured for full screen content so that the inspector split view items is full height itself. However, when we enable full height content view, AppKit is automatically adding a tracking separator into the toolbar when we don't want one. (Neither of the two split views are sidebars.) This tracking separator is out of place, cannot be dragged itself, and is drawn under the center aligned segmented control. We've tried a multitude of permutations to configure the NSWindow, NSToolbar and NSSplitViewItem but to no avail. Surely we're just missing the magic combo but a lot of the properties appear to be no-ops in macOS 26. How do we use an NSSplitViewController, in a full screen content window, such that we get a full height inspector but we don't get tracking separators for the main split view divider?
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
47
21h
File Export from iOS - eventually import too
iOS 15 - iOS 26.x, SwiftUI, Xcode 26.1.1 (rewritten without links) I’m attempting to add the capability to export a file from CoreData. Since ShareLink requires iOS16+, I found an article showing how to create a UIKit wrapper for 'UIActivityViewController' This does work, but I end up with multiple files instead of one. How do I merge this into one file? Note: I don’t think I want to write to the app’s document directory – rather I’d like to allow the user to export to iCloud. Eventually, I’d like to share a list of dates with descriptions and if someone puts a sensitive date in there – I don’t want it to be left in a directory. I would include a warning that the file that they export needs to be handled with care if there are any sensitive dates. Some might consider birthdays as private information, right? I'd also like to be able to name the file - so far when the share sheet comes up, I select "Save to Files" and it uses a default name of text.txt My next step is to be able to import a CSV file (roundtrip) - could you point me to resources for how to do that?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
16
23h
URLByResolvingAliasFileAtURL: Appears to Be Broken - resolves to the the wrong folder
So if I create an Alias of a folder in Finder and hand the alias to my app (I also moved the alias file to a new folder, but I did not move the original folder)...so then my app resolves the alias using: NSURL +URLByResolvingAliasFileAtURL: What happens? The resolved URL points to a completely different folder. Well not completely different. It resolves to a folder that happens to share same last path component as the original folder...but this folder is inside the same parent folder the alias file is in. It does not resolve to the original folder I created the alias of. So then once my app touches the alias with +URLByResolvingAliasFileAtURL: the alias now resolves to this new (wrong) location (even in Finder). Couple details: My app is not sandboxed. I have permission to access the original folder in my app (but even if I didn't the alias shouldn't be mutated just by merely resolving it). Only seems to happen if the folder I move the alias to happens to contain a sibling folder that has the same title as the original folder. Like it's just deleting the last path component of the alias and then appending the last path component of the original filename and just going with that. I hope that makes sense. I tried creating the alias myself using -bookmarkDataWithOptions: and going the other way (to Finder) but Finder must be resolving the alias using a different API because it resolves to the original location as expected.
2
0
118
3d
Putting 2 existing pdf pages side by side (half size) in a new pdf
In Swift, iOS, I have a pdf file. I want to take the pages 2 by 2 and put them side by side, on the new page. For this, I have to scale initial pages half size and rotate .pi/2. I managed to achieve this by converting pdf pages to UIImages and using a UIGraphicsImageRenderer. But with a critical loss of resolution. I've tried improving the resolution by creating images as jpegData(withCompressionQuality: 1.0), to no avail. So I would need to work directly on the pdf pages using CGPDFDocument format. The code structure is as follows, to insert a single scaled page: for iPage in … { if let _page = theCGPdfDocument.page(at: 1) { var _pageRect: CGRect = _page.getBoxRect(CGPDFBox.mediaBox) writeContextInDestination!.beginPage(mediaBox: &_pageRect) // translate to compensate for the flip caused displacement writeContextInDestination!.translateBy(x: _pageRect.size.width, y: _pageRect.size.height) Scale (-1, -1) // rotate 180° // add rotate as needed writeContextInDestination!.scaleBy(x: -1, y: -1) writeContextInDestination!.clip(to: _pageRect) writeContextInDestination!.drawPDFPage(_page) writeContextInDestination!.endPage() // end the current page } } writeContextInDestination!.closePDF() But I do not succeed in inserting the drawing of the second page. I've tried repeating lines 7 to 11 for a second page at line 13. No success. What is the direction to look for ?
1
0
108
4d
DataScannerViewController freezes when enabling torch using AVCaptureDevice
I am using DataScannerViewController from VisionKit to scan text in my iOS application. The scanner works correctly while running. However, I added a custom button to toggle the device torch (flashlight). To toggle the torch, I access the camera device using AVCaptureDevice and set torchMode after locking the configuration. When I turn on the torch while DataScannerViewController is actively scanning, the scanner UI freezes and the camera preview stops updating. The app becomes unresponsive until I leave the screen. This issue appears on all iOS versions. Code used to toggle the torch: guard let device = AVCaptureDevice.default(for: .video),       device.hasTorch else { return } do {     try device.lockForConfiguration()     device.torchMode = device.torchMode == .on ? .off : .on     device.unlockForConfiguration() } catch {     print(error) } Questions: Is it supported to control the torch directly via AVCaptureDevice while DataScannerViewController is running? Does DataScannerViewController internally lock or manage the camera configuration in a way that can cause this freeze? Is there a recommended way to enable/disable the torch when using DataScannerViewController? Environment: VisionKit DataScannerViewController iPhone device (not simulator) iOS versions where freeze occurs: All Any clarification about whether this behavior is expected or a limitation of VisionKit would be appreciated.
Topic: UI Frameworks SubTopic: General
0
1
42
4d
How to disable the iOS 26 navigation bar glass style
Hi dear, Our app have adapt for iOS26 ,but we don't need the navigation right and back view style. Design Team Style. Navigation item style is plain style Apple iOS 26 System Navigation Item style (back item with circle background and efffort) We don't want to redesign a new custom navigation view .We need to keep the UIDesignRequiresCompatibility to NO. Do we have any feature to disable the system style? Thank you all. ------------------------分隔符--------------------- 亲爱的,我们的应用已适配iOS26系统,但不需要iOS26导航自带的玻璃样式。 我们不想重新设计新的自定义导航视图。系统的UIDesignRequiresCompatibility配置我们需要设置为NO(其他地方的液态玻璃效果需要保留),我们是否有功能或者设置可以禁用系统样式?谢谢大家。
Topic: UI Frameworks SubTopic: General
0
0
38
4d
iOS 26: default gray background on UITabBarItem
In iOS 26, when a UITabBarItem is selected, a gray background appears behind the selected item. This seems to happen automatically with the new tab bar design. I tried configuring the tab bar using UITabBarAppearance, but the background highlight still appears. Is this the expected behavior in iOS 26 or is there a recommended way to configure the tab bar so that only the icon and title change color when selected?
Topic: UI Frameworks SubTopic: UIKit
3
0
121
4d
How to stop ios 26 glass effect UI in ios app
Hi everyone, I want to avoid the iOS 26 Liquid Glass effect in my app’s UI. While researching, I found the following possible solution: Steps: Go to Info.plist Add the key: UIDesignRequiresCompatibility Type: Boolean Value: YES I have a few questions about this approach: According to the Apple Developer website, this seems to be a temporary solution. How long will this continue to work, and what would be the recommended long-term solution? Which iOS versions does this support (both older and upcoming versions)? If this method is not recommended, is there another way to disable or avoid the glass effect across the entire app without making major UI changes? Any guidance or suggestions would be greatly appreciated. Thank you!
1
0
134
5d
DynamicViewContent and drop validation (macOS)
If I see it correctly, it is currently not possible to validate a drop operation on a DynamicViewContent when using dropDestination? Just a simple example: Let's say I build a folder view on macOS where I can arrange folders freely. In this case I need to use DynamicViewContent.dropDestination to get an insertion index on drop. However, it seems that methods like dropConfiguration do not have any effect. Als dropDestionation(…, isTargeted:) seems not to be available. Here is my sample code: struct FolderRow: View { let folder: Folder var body: some View { DisclosureGroup(isExpanded: .constant(true)) { ForEach(folder.children) { child in FolderRow(folder: child) } .dropDestination(for: Folder.self) { item, idx in print("Dropped at \(idx)") } } label: { Label(folder.name, systemImage: "folder") .draggable(folder) .dropDestination(for: Folder.self) { items, _ in print("Dropped on Item") } } .dropConfiguration { session in DropConfiguration(operation: .move) } } } struct ContentView: View { @State private var folder: Folder = Folder.sampleData @State private var selection: Set<UUID> = [] var body: some View { NavigationSplitView { List(selection: $selection) { FolderRow(folder: folder) } } detail: { EmptyView() } } } The dropConfiguration is applied on the Label (in this case the "Move" cursor is used instead of the "Copy" cursor). Is there any way to do that or is it just an omission in Swift UI?
0
0
77
5d
SwiftUI and undo
In my multiplatform SwiftUI document app, where should I implement undo? In the Views with Forms and Lists, Bindings, data classes or somewhere else? I am now implementing undo in Bindings and Lists, but I'm wondering if that's the right way to do it.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
126
5d
SwipeActions-triggered reorder animation briefly removes row and re-inserts it
I’m seeing a visual glitch in SwiftUI List on iOS 26 when row order changes after a swipeActions action. Setup: List + ForEach of items Items are sorted dynamically by isSelected (unselected first, selected last) Swipe action toggles isSelected Row should animate to new position Problem: On swipe select/unselect, the row sometimes appears to disappear briefly, then reappear in the new position Most visible when unselecting an item from the bottom selected group (it should move to top) Sometimes there is a temporary “empty gap” near the top during the move In some row styling setups, row corner masking also looks wrong during animation What I tried: Different animations (default, easeInOut, spring) Adding/removing small dispatch delay before state change Moving section header content outside List Using custom row backgrounds/corners vs system row styling Keeping stable IDs in ForEach Behavior still appears with native List + swipeActions on iOS 26. So my question is: Is this a known issue/regression with List row move animations on iOS 26? Recommended pattern to keep native swipe actions but avoid this visual artifact? This worked smoothly on iOS 18 with the same approach, and the visual glitch appears only after moving to iOS 26.
Topic: UI Frameworks SubTopic: SwiftUI
0
0
92
5d
macOS Tahoe 26.3 - System Is Playing NSBeep At Inappropriate Times When Text Editing Ends Via -cancelOperation: (field editor)
When I end editing pressing the escape key, the system sometimes plays NSBeep(). I noticed this with NSBrowser. Every time I press escape to end editing the system beeps. At first I thought it was somewhere in my app but I set a symbolic breakpoint and discovered it was not coming from my code. I filed FB22127038. Since then I discovered that NSBeep playing at inappropriate times is not exclusive to NSBrowser. It appears if there is a NSTableView in the window and you just press the escape key (even if you aren't editing anything) AppKit beeps. It can be traced to: #0 0x0000000199e3184c in NSBeep () #1 0x000000019aa03fac in -[NSWindow doCommandBySelector:] () #2 0x000000019ac1d01c in -[NSTableView(NSTableViewViewBased) cancelOperation:] ()
3
0
72
6d
How to Reload Collection View (DiffableDataSource) after API Finishes Calling
Hello, I have a collection view that uses a diffable data source, and I am initiating an API call while configuring a cell RuntimeCell in the cell registration block inside setupDataSource(). The cell has a runtimeLabel property whose text I am setting inside a configureLabel(movieId:) function. I noticed that the collection view does not automatically refresh the text label once this API call finishes and after setting the text property on a UILabel in the collection view cell to a value retrieved during the API call. I presume this is because I need to call dataSource.apply(snapshot) myself to reload the changes in the collection view after the API call finishes retrieving the runtime data. However, since the API call happens via the configuration of the cell in the cell registration closure, this API call ends up being called infinitely if I call dataSource.apply(snapshot) every time the API call finishes (i.e. calling dataSource.applySnapshot() calls the closure for the cell registration handler which re-triggers the API call). What is the correct architecture to apply to accomplish reloading the collection view so that the text label appears once the API finishes calling? Thank you class MovieDetailViewController: UIViewController { func setupDataSource() { // ... let runTimeCellRegistration = UICollectionView.CellRegistration<RuntimeCell, Item> { cell, indexPath, item in cell.runtimeLabelDelegate = self cell.configureLabel(movieId: self.selectedMovie.id) } dataSource = UICollectionViewDiffableDataSource(collectionView: collectionView, cellProvider: { collectionView, indexPath, itemIdentifier in let section = Section(rawValue: indexPath.section) switch section { //... case .runtime: return collectionView.dequeueConfiguredReusableCell(using: runTimeCellRegistration, for: indexPath, item: itemIdentifier) //... } return nil }) } } protocol RuntimeLabelCellDelegate: AnyObject { func didUpdateRuntime() } class RuntimeCell: UICollectionViewCell { var runtimeLabel: UILabel! //... UI Setup func configureLabel(movieId: Int) { Task { do { let details = try await movieSearchService.fetchMovieDetails(movieId: movieId) await MainActor.run { let minutes = details.runTime let durationText = "\(minutes)m" var emojiText = "" if minutes < 90 { emojiText = "Short & Sweet ⚡️" } else if minutes > 150 { emojiText = "Get the snacks ready 🍿" } runtimeLabel.text = emojiText.isEmpty ? durationText : "\(durationText) • \(emojiText)" runtimeLabelDelegate?.didUpdateRuntime() } } catch { print("Failed to load details: \(error)") } } } } extension MovieDetailViewController: RuntimeLabelCellDelegate { func didUpdateRuntime() { var snapshot = dataSource.snapshot() snapshot.appendItems([.runtime], toSection: .runtime) dataSource.apply(snapshot, animatingDifferences: true) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
69
6d
What is the lifecycle of onReceive subscriptions in SwiftUI views?
I'm trying to better understand how the onReceive modifier behaves in SwiftUI, specifically how its subscription lifecycle relates to view updates. Consider this example: TextField("Name", text: $name) .onReceive(Just(name)) { value in print(value) } This closure runs every time name changes. A common explanation is that SwiftUI recomputes body, which creates a new Just(name) publisher each time. However, this raises some questions for me about how onReceive actually works internally: When SwiftUI recomputes body, is the onReceive modifier recreated and resubscribed? Does SwiftUI automatically cancel the previous subscription when the view updates?
0
0
47
1w
Not precise scroll in XCTest
I'm working on UI automation tests using XCUITest for an iOS application (iPhone). My goal is to programmatically scroll a view by a very precise number of pixels (e.g., exactly 500 points down). I understand the scroll(byDeltaX:deltaY:) method is not supported on iPhone, so I'm using the coordinate-based drag method as an alternative. Specifically, I am using XCUICoordinate.press(forDuration:thenDragTo:withVelocity:thenHoldForDuration:) to simulate a drag gesture. I calculate a start and end coordinate with a specific vertical offset in points, expecting the view to scroll by that exact amount. However, I'm observing that the resulting scroll offset is not perfectly accurate. There's a consistent error of several pixels, making the scroll amount unpredictable for precise test assertions. Is there a known limitation to the accuracy of coordinate-based dragging for simulating programmatic scrolling? Are there any alternative methods or best practices within XCUITest to achieve a more reliable and pixel-accurate scroll on iPhone, or is this level of precision simply not achievable with the current framework?
1
0
104
1w
touchesEnded: not triggered on newer iOS when view is inside UIScrollView (was working on iOS 18)
Hi everyone, I’m facing an issue with touch handling on newer iOS versions. I have a custom view controller implemented in Objective-C that overrides touchesEnded:. The same code works correctly on iOS 18, but on newer iOS versions (tested on iOS 26), touchesEnded: is no longer being triggered. Important observations: touchesBegan: is triggered. touchesEnded: is NOT triggered. touchesCancelled: is also NOT triggered. No code changes were made between iOS 18 and iOS 26. Same code, same sample works fine in iOS18 device but not in iOS26 device Questions: Has gesture arbitration behavior changed in recent iOS 26 versions when views are inside UIScrollView? Any clarification on whether this is intended behavior or a regression would be greatly appreciated. Thank you.
Topic: UI Frameworks SubTopic: UIKit
6
0
264
1w