Group Group Group Group Group Group Group Group Group

Chapter 16 ,Challenge solution 's test not pass in catalyst

yesterday I update my mac system to latest one, and update Xcode to 12 as well.

open Chapter 16 challenge folder’s solution, for below test, can not pass when target to catalyst.

when I run project ,manual operate the double tap the memoryDisplay, it will disappear.

but run below test, it will fail, as memoryDisplay will not disappear.

func testSwipeToClearMemory() {
let app = XCUIApplication()
app.launch()

let threeButton = app.buttons["3"]
threeButton.tap()
let fiveButton = app.buttons["5"]
fiveButton.tap()

let memoryButton = app.buttons["M+"]
memoryButton.tap()

let memoryDisplay = app.staticTexts["memoryDisplay"]
// 1
XCTAssert(memoryDisplay.exists)
// 2
#if targetEnvironment(macCatalyst)
memoryDisplay.doubleTap()
#else
memoryDisplay.swipeLeft()
#endif
// 3
XCTAssertFalse(memoryDisplay.exists)

}

@yangwulong1978 This is due to some changes in Catalyst in the new version. The next edition of the book will cover the changes in Xcode 12 and Big Sur. For now, you can change the doubleTap() here and in the ConventView to a tap gesture to get the code working in Xcode 12.