Is there a way to combine ScrollViewReader and LazyVGrid in order to scroll to a selected item?
It looks like ScrollViewReader only works with ONE column designs like list.
Ideally, something like this would be ideal, but does not work currently.
ScrollViewReader { scroller in
LazyVGrid(columns: columns) {
ForEach(viewModel.tileArray, id: \.id) { thisTile in
MyTileView(viewModel: thisTile)
}
}
.onAppear {
scroller.scrollTo(viewModel.selectedTileID, anchor: nil)
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
When running test cases I get inconsistent behavior with .doubleTap recognized about half the time as a single tap. Clearly breaks my UI tests.
Here the code fragment:
uiTestApp = XCUIApplication()
uiTestApp.launch()
let texts = uiTestApp.staticTexts
XCTAssertTrue(texts["hello"].waitForExistence(timeout: 2))
sleep(1)
texts["hello"].doubleTap()
Any tips for avoiding this? I already added .waitForExistence and a sleep(1) to make sure the element is on the screen. Did not help.