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

SwiftUI Issues on iOS 16: App Freezes, Buttons Unresponsive, and Missing Data (Works Fine on iOS 17)
Hi everyone, I’m experiencing significant issues with my SwiftUI app when running on iOS 16. These issues are not present in iOS 17, where everything works as expected. I’m hoping someone can provide insights or suggestions on how to address these problems. The Problems App Freezing: In certain views, the app becomes completely unresponsive when running on iOS 16. There are no clear patterns or console logs pointing to the source of the freeze. Unresponsive Buttons: Buttons stop working in some views. Tapping them does nothing, even though the logic and bindings are correct. Missing Data: Data fetched from services (remote APIs) or local storage doesn’t show up in the UI. Expected Behavior The app should handle user interactions and display data correctly on both iOS 16 and iOS 17, without freezes or unresponsive elements. Environment: Xcode Version: Xcode 15.4 Deployment Target: iOS 16 Testing Devices: iPhone 14 with iOS 17.6.1, iPhone 13 with iOS 18.1.1, iPhone 8 with iOS 16.4, iPhone 12 with 16.4, iPhone 8 Plus with iOS 16.0, iPhone 8 Plus with 16.7.10
Topic: UI Frameworks SubTopic: SwiftUI
3
0
340
Jan ’25
VStack within ScrollView on macOS 15.2 makes bottom area unclickable
Suppose there are two buttons in VStack, the second button is unclickable. I'm running macOS 15.2 with Xcode 16.2. import SwiftUI struct ContentView: View { var body: some View { ScrollView(.horizontal) { VStack { Spacer() // this button is clickable Button("foo") { print("foo") } // this button can't be clicked Button("bar") { print("bar") } } } } } If I change .horizontal -> .vertical and VStack -> HStack, the second button behave normally. If I remove ScrollView, everything works fine. it works fine before macOS 15.2.
Topic: UI Frameworks SubTopic: SwiftUI
3
0
275
Dec ’24
QuickLook Library updated text tampered on PDF
We were using below delegate methods from QuickLook to get modified PDF file URL after the sketching But we are not able see the multi line text properly laid out on PDF and part of text missing. Same time Other pencil kit tools are working as expected. `func previewController(_ controller: QLPreviewController, didSaveEditedCopyOf previewItem: QLPreviewItem, at modifiedContentsURL: URL) func previewController(_ controller: QLPreviewController, didUpdateContentsOf previewItem: any QLPreviewItem)` We tested all code in iOS 18.2. Please let us know if the text edited URL on PDF can be retrieved in any possible way without tampering text
0
0
374
Feb ’25
iOS18 UIPinchGestureRecognizer finger change
Before ios18, when two fingers are switched to single fingers, the printing scale value will not change. When switching to two fingers again, the pinch and zoom printing scale will change. The same operation is performed after ios18, and two fingers are switched to single fingers. Switch back to two fingers, and the scale printing will not change. code here: - (void)pinchGesture:(UIPinchGestureRecognizer *)recognizer { NSSet <UIEvent*> *events = [recognizer valueForKey:@"_activeEvents"]; UIEvent *event = [events anyObject]; if (recognizer.state == UIGestureRecognizerStateBegan) { NSLog(@"---- begin finger count: %d scale: %f",event.allTouches.count,recognizer.scale); recognizer.scale = 1.0; } else if (recognizer.state == UIGestureRecognizerStateChanged) { NSLog(@"---- change finger count: %d scale: %f",event.allTouches.count,recognizer.scale); // recognizer.scale = 1.0; } log image for iOS 17.7 log image for ios18.0.2
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
290
Jan ’25
.sheet or .fullScreenSheet Looping when presenting Image Picker on visionOS
I am having issues with my app on visionOS. It works fine on iOS. The app is presenting a ImagePicker, I had tried converting to PhotoPicker and the behavior did not change. The relevant code is in the EditGreetingCardView - // // Created by Michael Rowe on 1/2/24. // import AVKit import SwiftData import SwiftUI struct EditGreetingCardView: View { @Environment(\.modelContext) private var modelContext @Environment(\.dismiss) private var dismiss @Query(sort: \EventType.eventName) private var events: [EventType] var greetingCard: GreetingCard? private var editorTitle: String { greetingCard == nil ? "Add Greeting Card" : "Edit Greeting Card" } @State var frontImageSelected: Image? = Image("frontImage") @State var sourceType: UIImagePickerController.SourceType = .photoLibrary @State var frontPhoto = false @State var captureFrontImage = false var eventTypePassed: EventType? @State private var eventType: EventType? @State private var cardName = "" @State private var cardManufacturer = "" @State private var cardURL = "" @State private var cardUIImage: UIImage? @State private var cameraNotAuthorized = false @State private var isCameraPresented = false @State private var newEvent = false @AppStorage("walkthrough") var walkthrough = 1 init(eventTypePassed: EventType?) { if let eventTypePassed { _eventType = .init(initialValue: eventTypePassed) } } init(greetingCard: GreetingCard?) { self.greetingCard = greetingCard _eventType = .init(initialValue: greetingCard?.eventType) } var body: some View { NavigationStack { Form { Section("Occasion") { Picker("Select Occasion", selection: $eventType) { Text("Unknown Occasion") .tag(Optional<EventType>.none) //basically added empty tag and it solve the case if events.isEmpty == false { Divider() ForEach(events) { event in Text(event.eventName) .tag(Optional(event)) } } } } .foregroundColor(Color("AccentColor")) Section("Card details") { } .foregroundColor(Color("AccentColor")) Section("Card Image") { HStack(alignment: .center){ Spacer() ZStack { Image(uiImage: cardUIImage ?? UIImage(named: "frontImage")!) .resizable() .aspectRatio(contentMode: .fit) .shadow(radius: 10 ) Image(systemName: "camera.fill") .foregroundColor(.white) .font(.largeTitle) .shadow(radius: 10) .frame(width: 200) .onTapGesture { self.frontPhoto = true } .actionSheet(isPresented: $frontPhoto) { () -> ActionSheet in #if !os(visionOS) ActionSheet( title: Text("Choose mode"), message: Text("Select one."), buttons: [ ActionSheet.Button.default(Text("Camera"), action: { checkCameraAuthorization() self.captureFrontImage.toggle() self.sourceType = .camera }), ActionSheet.Button.default(Text("Photo Library"), action: { self.captureFrontImage.toggle() self.sourceType = .photoLibrary }), ActionSheet.Button.cancel() ] ) #else ActionSheet( title: Text("Choose mode"), message: Text("Select one."), buttons: [ ActionSheet.Button.default(Text("Photo Library"), action: { self.captureFrontImage.toggle() self.sourceType = .photoLibrary }), ActionSheet.Button.cancel() ] ) #endif } .fullScreenCover(isPresented: $captureFrontImage) { #if !os(visionOS) ImagePicker( sourceType: sourceType, image: $frontImageSelected) .interactiveDismissDisabled(true) #else ImagePicker( image: $frontImageSelected) .interactiveDismissDisabled(true) #endif } } .frame(width: 250, height: 250) Spacer() } } } .alert(isPresented: $cameraNotAuthorized) { Alert( title: Text("Unable to access the Camera"), message: Text("To enable access, go to Settings > Privacy > Camera and turn on Camera access for this app."), primaryButton: .default(Text("Settings")) { openSettings() } , secondaryButton: .cancel() ) } .toolbar { } .onAppear { } .onChange(of: frontImageSelected) { oldValue, newValue in cardUIImage = newValue?.asUIImage() } } } }
Topic: UI Frameworks SubTopic: SwiftUI
2
0
278
Feb ’25
Multi Section Sidebar using List with selections for macOS
I'm trying to implement a 3 column NavigationSplitView in SwiftUI on macOS - very similar to Apple's own NavigationCookbook sample app - with the slight addition of multiple sections in the sidebar similar to how the Apple Music App has multiple sections in the sidebar. Note: This was easily possible using the deprecated NavigationLink(tag, selection, destination) API The most obvious approach is to simply do something like: NavigationSplitView(sidebar: { List { Section("Section1") { List(section1, selection: $selectedItem1) { item in NavigationLink(item.label, value: item) } } Section("Section2") { List(section2, selection: $selectedItem2) { item in NavigationLink(item.label, value: item) } } } }, content: { Text("Content View") }, detail: { Text("Detail View") }) But unfortunately, this doesn't work - it doesn't seem to properly iterate over all of the items in each List(data, selection: $selected) or the view is strangely cropped - it only shows 1 item. However if the 1 item is selected, then the appropriate bindable selection value is updated. See image below: If you instead use ForEach for enumerating the data, that does seem to work, however when you use ForEach, you loose the ability to track the selection offered by the List API, as there is no longer a bindable selection propery in the NavigationLink API. NavigationSplitView(sidebar: { List { Section("Section1") { ForEach(section1) { item in NavigationLink(item.label, value: item) } } Section("Section2") { ForEach(section2) { item in NavigationLink(item.label, value: item) } } } }, content: { Text("Content View") }, detail: { Text("Detail View") }) We no longer know when a sidebar selection has occurred. See image below: Obviously Apple is not going to comment on the expected lifespan of the now deprecated API - but I am having a hard time switching to the new NavigationLink with a broken sidebar implementation.
3
0
573
Jan ’25
App Clip No Available
1.APPStore Arraignment passed. Not yet released. The diagnostic link configuration is not available. Firstly,We filled in the configuration of the corresponding domain name, and the verification was successful. My AASA file is configured correctly (general deep links work with it, as well as some app clip URLs) and is also configured for app clips. "applinks": { "apps": [], "details": [ { "appID": "xxx.com.xx.easyshare", "paths": [ "*" ] }, { "appID": "xxx.com.xx.easyshareExport", "paths": [ "*" ] } ] }, "appclips": { "apps": [ "xxx.com.xx.easyshare.Clip" ] } } Well,I used https://es.xx.com/send or https://es.xx.com to get diagnostic information is wrong My TestFight config is ok Another problem is that using NFT jumps directly to Safire.
1
0
338
Jan ’25
Buttons not clickable after installing the app with Swift 6
Does anyone have a problem with buttons not clickable in the lists of elements? If I have a list of 30 elements, some of them are clickable and some not. The button is a basic button that prints something in the console. After refresh, click ability is changed but still some clickable and some not. It appears always when compiling with Swift 6. My colleague has the "old" Xcode 15.4 with Swift 5 and when he installs exactly the same code -> buttons and lists work just fine. I noticed some similar issues with onTapGesture on StackOverflow but my problem is a button. However, I have the same problem with onTapGesture (where I use it) in some of my View components and changing it with highPriorityGesture will not solve the problem since I can't click on the child elements of those Views anymore... I'm using Xcode 16.2 and iOS 18.2. Does anyone have an idea how to solve this?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
407
Dec ’24
Keyboard will not show when setting focus on a SwiftUI text field from a button in an ornament on visionOS
Using a button that is placed in the bottom ornament to set focus on a text field will not display the keyboard properly while a button embedded in the view will behave as expected. To demonstrate the issue, simply run the attached project on Vision Pro with visionOS 1.1 and tap the Toggle 2 button in the bottom ornament. You’ll see that the field does have focus but the keyboard is now visible. Run the same test with Toggle 1 and the field will get focus and the keyboard will show as expected. import SwiftUI import RealityKit import RealityKitContent struct ContentView: View { @State private var text = "" @State private var showKeyboard = false @FocusState private var focusedField: FocusField? private enum FocusField: Hashable { case username case password } var body: some View { VStack { TextField("Test", text: $text) .focused($focusedField, equals: .username) Text("Entered Text: \(text)") .padding() Button("Toggle 1") { // This button will work and show the keyboard if focusedField != nil { focusedField = nil } else { focusedField = .username } } Spacer() } .padding() .toolbar { ToolbarItem(placement: .bottomOrnament) { Button("Toggle 2") { // This button will set focus properly but not show the keyboard if focusedField != nil { focusedField = nil } else { focusedField = .username } } } } } } Is there a way to work around this? FB13641609
1
0
756
Jan ’25
Variable modification in forEach
Hi! I'm trying to do a forEach loop on an array of objects. Here's my code : ForEach($individus) { $individu in if individu.reussite == true { individu.score -= 10 } else { individu.score = (individu.levees * 10) + 20 + individu.score } } I have an error on the code in the 'if' saying that "Type '()' cannot conform to 'View'", but I have no idea on how solving this problem.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
258
Jan ’25
Do the coordinates obtained by scanning a QR code with VNDetectBarcodesRequest match the coordinates of the finder pattern?
I am creating an application that uses VNDetectBarcodesRequest to read QR codes from images and adjust the image orientation to match that of the QR code finder pattern. The QR code was successfully read, and the coordinates of the QR code were obtained.Upon checking the obtained topLeft, topRight, and bottomLeft coordinates, they always seem to match the topLeft, topRight, and bottomLeft coordinates of the finder pattern. Is it specified that the coordinates of topLeft, topRight, and bottomLeft obtained with VNDetectBarcodesRequest match the topLeft, topRight, and bottomLeft of the finder pattern? Or do they just happen to match? I would appreciate it if you could tell me if the matching of coordinates is a specification. Thank you for your help.
0
0
319
Feb ’25
Bug in iOS 18 with NSTimeZone and DatePicker
iOS 18 broke some functionality in my Objective-C app with regard to using the DatePicker. The key lines are as follows: datePicker.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:timezoneOffset]; datePicker.date = [NSDate date]; When timezoneOffset is -29380, the value for San Francisco, the Date Picker is a whole MONTH off. It shows November instead of December. But when it is -29359, the value for Seattle, which is in the same time zone (PST), it shows the correct month. In fact, even towns surrounding San Francisco usually return the correct value. Some other cities in other time zones also cause the Date Picker to be a month off.
7
0
760
Jan ’25
Swiftui Rendering issue: View not displayed when using almost full screen height
I plan to use the entire screen height minus 40 pixels approximately to not overlap with the time, batter and carrier data. However, I noticed that in the code shared below the vstack with pink background is not displayed at the top of the screen. The interesting part is that it's actually occupying an offset at the top of the screen. What's more, when I set an offset greater than 70 pixels, then the pink vstack displays on the view! Thus, I'm looking for an explanation to this swiftui rendering issue. Offset less than 70 pixels: Offset greater or equal than 70 pixels: GeometryReader { proxy in let offset = 40.0 let height = proxy.size.height - offset ZStack { VStack(spacing:0){ VStack{Text("heasdas")}.frame(width: 300,height: offset,alignment: .leading) .background(.pink) VStack { HStack(alignment:.center,spacing:10){ Text("Shapecloud") .font(.callout) .fontWeight(.semibold) .frame(alignment: .leading) SLine() } .frame(maxWidth: .infinity,alignment: .leading) Text("Digital Twin Solutions\nServices") .font(.largeTitle) .fontWeight(.medium) .frame(maxWidth: .infinity,alignment: .leading) } .frame(maxWidth: .infinity,maxHeight: 0.3*height,alignment: .top) .background(.red) VStack { VideoPlayer(player: player) .frame(maxWidth: .infinity,maxHeight: 300) } .frame(maxWidth: .infinity,maxHeight: 0.4*height) .background(.yellow) VStack{ Button { } label: { Text("Subscribe now").foregroundStyle(.black) .font(.headline) .fontWeight(.semibold) } .frame(maxWidth: .infinity,maxHeight: 50) .border(Color.black, width: 2) Button { } label: { Text("Sign In").foregroundStyle(.white) .font(.headline) } .frame(maxWidth: .infinity,maxHeight: 50) .background(Color.theme.primary) } .frame(maxWidth: .infinity,maxHeight: 0.3*height) .background(.green) } .padding(.horizontal, 32) .background(.cyan) .ignoresSafeArea(.all) } .ignoresSafeArea(.all) } .ignoresSafeArea(.all)
2
0
236
Feb ’25
Retrieve input field text as a keyboard extension in Swift
I am able to retrieve the text in the input field by doing: let contextBeforeInput = textDocumentProxy.documentContextBeforeInput ?? "" let contextAfterInput = textDocumentProxy.documentContextAfterInput ?? "" let fullText = contextBeforeInput + contextAfterInput However, when I'm pasting text into the input field, textDocumentProxy.documentContextBeforeInput refuses to return the entire text from the input field but instead only returns the last two sentences. I have tried this with the input fields in WhatsApp, Signal, and Telegram and it's all the same, so it doesn't seem to be caused by the specific app. At first I thought it was a limitation imposed by Apple but other third party keyboard extensions such as Grammarly are able to pick up the whole pasted text from the input field, so how are they doing it?
Topic: UI Frameworks SubTopic: UIKit
0
0
234
Jan ’25
Is MapKit.mapCameraKeyframeAnimator broken on macOS 15.2?
Hi! I'm attempting to run the Quakes Sample App^1 from macOS. I am running breakpoints and confirming the mapCameraKeyframeAnimator is being called: .mapCameraKeyframeAnimator(trigger: selectedId) { initialCamera in let start = initialCamera.centerCoordinate let end = quakes[selectedId]?.location.coordinate ?? start let travelDistance = start.distance(to: end) let duration = max(min(travelDistance / 30, 5), 1) let finalAltitude = travelDistance > 20 ? 3_000_000 : min(initialCamera.distance, 3_000_000) let middleAltitude = finalAltitude * max(min(travelDistance / 5, 1.5), 1) KeyframeTrack(\MapCamera.centerCoordinate) { CubicKeyframe(end, duration: duration) } KeyframeTrack(\MapCamera.distance) { CubicKeyframe(middleAltitude, duration: duration / 2) CubicKeyframe(finalAltitude, duration: duration / 2) } } But I don't actually see any map animations taking place when that selection changes. Running the application from iPhone simulator does show the animations. I am building from Xcode Version 16.2 and macOS 15.2. Are there known issues with this API on macOS?
0
0
289
Dec ’24
NavigationSplitView detail view not updating
I have a NavigationSplitView with all three columns, and NavigationLinks in the sidebar to present different Lists for the content column. When a list item is selected in the content view, I want to present a view in the detail view. Since different detail views should be presented for different content views, I represent state like this (some details omitted for space): // Which detail view to show in the third column enum DetailViewKind: Equatable { case blank case localEnv(RegistryEntry) case package(SearchResult) } // Which link in the sidebar was tapped enum SidebarMenuItem: Int, Hashable, CaseIterable { case home case localEnvs case remoteEnvs case packageSearch } // Binds to a DetailViewKind, defines the activate SidebarMenuItem struct SidebarView: View { @State private var selectedMenuItem: SidebarMenuItem? @Binding var selectedDetailView: DetailViewKind var body: some View { VStack(alignment: .leading, spacing: 32) { SidebarHeaderView() Divider() // Creates the navigationLinks with a SidebarMenuRowView as labels SidebarMenuView(selectedMenuItem: $selectedMenuItem, selectedDetailView: $selectedDetailView) Spacer() Divider() SidebarFooterView() } .padding() .frame(alignment: .leading) } } struct SidebarMenuRowView: View { var menuItem: SidebarMenuItem @Binding var selectedMenuItem: SidebarMenuItem? @Binding var selectedDetailView: DetailViewKind private var isSelected: Bool { return menuItem == selectedMenuItem } var body: some View { HStack { Image(systemName: menuItem.systemImageName).imageScale(.small) Text(menuItem.title) Spacer() } .padding(.leading) .frame(height: 24) .foregroundStyle(isSelected ? Color.primaryAccent : Color.primary) .background(isSelected ? Color.menuSelection : Color.clear) .clipShape(RoundedRectangle(cornerRadius: 10)) .navigationDestination(for: SidebarMenuItem.self) { item in navigationDestinationFor(menuItem: item, detailView: $selectedDetailView) } .onTapGesture { if menuItem != selectedMenuItem { selectedMenuItem = menuItem } } } } // Determines which detail view to present struct DetailView: View { @Binding var selectedDetailView: DetailViewKind var innerView: some View { switch selectedDetailView { case .blank: AnyView(Text("Make a selection") .font(.subheadline) .foregroundStyle(.secondary) .navigationSplitViewColumnWidth(min: 200, ideal: 350)) case .localEnv(let regEntry): AnyView(EnvironmentDetailView(regEntry: regEntry)) case .package(let searchResult): AnyView(PackageDetailView(searchResult: searchResult)) } } var body: some View { innerView } } struct ContentView: View { @State private var detailView: DetailViewKind = .blank var body: some View { NavigationSplitView { SidebarView(selectedDetailView: $detailView) .navigationSplitViewColumnWidth(175) } content: { HomeView() .navigationSplitViewColumnWidth(min: 300, ideal: 450) } detail: { DetailView(selectedDetailView: $detailView) } } } My issue is that the detail view is not updated when the ContentView's detailView property is updated. I've verified that the value itself is changing, but the view is not. I searched around to see why this would be (this is my first Swift/SwiftUI application) and from what I gather a @Binding alone will not cause a view to be updated, that binding either needs to be used in the view hierarchy, or it needs to be stored as a @State property that gets updated when the binding value changes. I added a dummy @State property to DetailView and that still doesn't work, so I'm a little confused: struct DetailView: View { @Binding var selectedDetailView: DetailViewKind @State private var dummyProp: DetailViewKind? var innerView: some View { switch selectedDetailView { case .blank: AnyView(Text("Make a selection") .font(.subheadline) .foregroundStyle(.secondary) .navigationSplitViewColumnWidth(min: 200, ideal: 350)) case .localEnv(let regEntry): AnyView(EnvironmentDetailView(regEntry: regEntry)) case .package(let searchResult): AnyView(PackageDetailView(searchResult: searchResult)) } } var body: some View { innerView.onChange(of: selectedDetailView) { dummyProp = selectedDetailView } } } Any ideas?
Topic: UI Frameworks SubTopic: SwiftUI
1
0
443
Jan ’25
iOS 18 crash issue for unnecessary dequeuing
My code extension MyViewController: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView( _ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath ) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCell( withReuseIdentifier: "CollectionViewCellID", for: indexPath ) as? CollectionViewCell { cell.setup() return cell } return UICollectionViewCell() } func collectionView( _ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath ) { // Unnecessary dequeue guard collectionView.dequeueReusableCell( withReuseIdentifier: "CollectionViewCellID", for: indexPath ) is CollectionViewCell else { return } // My action for selecting cell print("Cell Selected") } } Error: *** Assertion failure in -[UICollectionView _updateVisibleCellsNow:], UICollectionView.m:5673 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Solution: The problem was doing unnecessary dequeuing in didSelectItemAt when selecting the cell. In previous iOS like 17 or 16 or lower, it was allowed to dequeue where it is not really needed but from iOS 18, it may restricted to unnecessary dequeuing. So better to remove dequeue and use cellForItem(at) if we need to get cell from collection view. Example extension MyViewController: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView( _ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath ) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCell( withReuseIdentifier: "CollectionViewCellID", for: indexPath ) as? CollectionViewCell { cell.setup() return cell } return UICollectionViewCell() } func collectionView( _ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath ) { guard collectionView.cellForItem(at: indexPath) is CollectionViewCell else { return } // My action for selecting cell print("Cell Selected") } }
0
0
3.6k
Dec ’24
SwiftUI image has isAccessibilityElement == false
My SwiftUI app uses an Image with a tap gesture: Image(systemName: "xmark.circle.fill") .accessibilityIdentifier(kTextFieldClearButton) .foregroundColor(.secondary) .padding(.trailing, 6) .onTapGesture { dataSource.textFieldText = "" } In a UI test, I want to tap this image to execute its action: let clearButton = app.images[kTextFieldClearButton] clearButton.tap() However the action is not executed. I then set a breakpoint at clearButton.tap(), to execute lldb commands. Here are the results: (lldb) p clearButton.isHittable t = 439.54s Find the "TextFieldClearButton" Imag (Bool) true e It is a little strange that "Image" has been interrupted by (Bool) true, but the image is hittable. p clearButton.isAccessibilityElement gives (lldb) p clearButton.isAccessibilityElement (Bool) false I don't understand why this Image is no accessibility element. I thought, SwiftUI Views are by default accessible. What can I do to make it accessible so that clearButton.tap() works as expected?
0
0
511
Dec ’24
https://forums.developer.apple.com/forums/post/question
Hi everyone, I’m working on an iOS app using both UITableViewDiffableDataSource and SwiftUI, and I’m facing two separate but puzzling issues: UITableViewDiffableDataSource Not Reusing Cells on first applying after initial Snapshot. After applying first time it is working as expected from second time. SwiftUI View’s inside UITableViewCell onDisappear Not Triggering the on first changes of snapshot after initial snapshot. With normal UITableView it is working fine. Issue causing - it is causing player &amp; cells to retain memory extensively Sample gist code for reproducing with diffable (DiffableTableViewExampleViewController) and working fine without diffable (RegularTableViewExampleViewController) https://gist.github.com/SURYAKANTSHARMA/d83fa9e7e0de309e27485100ba5aed17 Any insights or suggestions for these issues would be greatly appreciated! Thanks in advance!
0
0
223
Jan ’25