Post

Replies

Boosts

Views

Activity

Reply to NavigationStack Back Button obscured in MacOS
The code was compiled and run on MacOS 15.6.1 The two files are Swift, I had to append a "txt" to the file name to get them uploaded. NOTE: The example uses NavigationLink for a destination view that takes two (2) arguments. If you have no arguments or one (1) argument, the first time you use the link will not usually exhibit the behavior. You usually need use the back button and navigate again to trigger the behavior. However, with two (2) arguments, the overlay behavior is usually observed on the first try. ContentView.swift.txt BackButtonOverlayApp.swift.txt
Topic: UI Frameworks SubTopic: SwiftUI
Nov ’25
Reply to Drag on a Canvas with XCUICoordinate.press(...)
Thank-you for your reply. First, I want to re-iterate that the application appears run correctly and the difficulty is only with the XCUITest part. That of course does not mean that the application is put together correctly, only that it seems to work for me. I did use an explicit co-ordinate space. My SwiftUI Canvas structure employed the .coordinateSpace modifier with a .named(...) parameter specifying a character string constant. My DragGesture also used the same .named(...) parameter; as do my MagnifyGesture and my SpatialTapGesture. I'll change the code to use .local for the gesture definitions and remove the modifier to the Canvas structure. It is also the case that my Canvas structure employs an animation modifier .animation(.interactiveSpring, value: currentOffset) Did you also animate the drag in your test application? The view hierarchy is: - NavigationStack -- VStack --- Spacer --- Text --- HStack ---- Text ---- Text ---- Text ---- Text --- Text --- Spacer --- GeometryReader ---- Canvas --- NavigationLink The modifiers used for the Canvas structure are: accessibilityIdentifier coordinateSpace gesture(drag definition) offset(current offset CGSize variable) animation clipped onTapGesture(count of 2 sets currentOffset to .zero and current scale to 1.0) gesture(magnification definition) scaleEffect(scale CGFloat variable initially 1.0 and anchor UnitPoint set to .zero animation(.easeInOut, value: scale) gesture(the SpatialTapGesture) onChangeOf the tap location, sets an optional variable with the display information popover(item: the optional variable with display information) So, after trying the coordinateSpace change to .local assuming that there is no change), I'll create a simple application and the corresponding UI test classes to explore further. Thanks again.
1w
Reply to NavigationStack Back Button obscured in MacOS
The code was compiled and run on MacOS 15.6.1 The two files are Swift, I had to append a "txt" to the file name to get them uploaded. NOTE: The example uses NavigationLink for a destination view that takes two (2) arguments. If you have no arguments or one (1) argument, the first time you use the link will not usually exhibit the behavior. You usually need use the back button and navigate again to trigger the behavior. However, with two (2) arguments, the overlay behavior is usually observed on the first try. ContentView.swift.txt BackButtonOverlayApp.swift.txt
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Nov ’25
Reply to How to call API of tested app in UI Testing of Xcode7?
I had a UI test case that needed to use a function that was defined in my application. Since there was only a single function, I just added the UITest target as a target for the file that contained the definition. If I had more than one function, I would have created a file with all of the functions that a UI Test might need.
Replies
Boosts
Views
Activity
Feb ’26
Reply to Drag on a Canvas with XCUICoordinate.press(...)
Thank-you for your reply. First, I want to re-iterate that the application appears run correctly and the difficulty is only with the XCUITest part. That of course does not mean that the application is put together correctly, only that it seems to work for me. I did use an explicit co-ordinate space. My SwiftUI Canvas structure employed the .coordinateSpace modifier with a .named(...) parameter specifying a character string constant. My DragGesture also used the same .named(...) parameter; as do my MagnifyGesture and my SpatialTapGesture. I'll change the code to use .local for the gesture definitions and remove the modifier to the Canvas structure. It is also the case that my Canvas structure employs an animation modifier .animation(.interactiveSpring, value: currentOffset) Did you also animate the drag in your test application? The view hierarchy is: - NavigationStack -- VStack --- Spacer --- Text --- HStack ---- Text ---- Text ---- Text ---- Text --- Text --- Spacer --- GeometryReader ---- Canvas --- NavigationLink The modifiers used for the Canvas structure are: accessibilityIdentifier coordinateSpace gesture(drag definition) offset(current offset CGSize variable) animation clipped onTapGesture(count of 2 sets currentOffset to .zero and current scale to 1.0) gesture(magnification definition) scaleEffect(scale CGFloat variable initially 1.0 and anchor UnitPoint set to .zero animation(.easeInOut, value: scale) gesture(the SpatialTapGesture) onChangeOf the tap location, sets an optional variable with the display information popover(item: the optional variable with display information) So, after trying the coordinateSpace change to .local assuming that there is no change), I'll create a simple application and the corresponding UI test classes to explore further. Thanks again.
Replies
Boosts
Views
Activity
1w