-
Eliminate animation hitches with XCTest
Animations can dramatically enhance the user experience of your app, provide a sense of direct manipulation, and help people to better understand the results of their actions. Animation hitches can break that experience. Discover how to use XCTest to detect interruptions to smooth scrolling and animations, and learn how to catch regressions before they affect the people relying on your app.
Recursos
Videos relacionados
WWDC21
WWDC20
-
Buscar este video…
-
-
6:35 - Create an animation os_signpost interval
os_signpost(.animationBegin, log: logHandle, name: "performAnimationInterval") os_signpost(.end, log: logHandle, name: "performAnimationInterval") -
6:55 - Use a UIKit instrumented animation os_signpost interval
extension XCTOSSignpostMetric { open class var navigationTransitionMetric: XCTMetric { get } open class var customNavigationTransitionMetric: XCTMetric { get } open class var scrollDecelerationMetric: XCTMetric { get } open class var scrollDraggingMetric: XCTMetric { get } } -
7:12 - Measure scrolling animation performance using a Performance XCTest
// Measure scrolling animation performance using a Performance XCTest func testScrollingAnimationPerformance() throws { app.launch() app.staticTexts["Meal Planner"].tap() let foodCollection = app.collectionViews.firstMatch measure(metrics: [XCTOSSignpostMetric.scrollDecelerationMetric]) { foodCollection.swipeUp(velocity: .fast) } } -
8:02 - Reset the application state between runs
func testScrollingAnimationPerformance() throws { app.launch() app.staticTexts["Meal Planner"].tap() let foodCollection = app.collectionViews.firstMatch let measureOptions = XCTMeasureOptions() measureOptions.invocationOptions = [.manuallyStop] measure(metrics: [XCTOSSignpostMetric.scrollDecelerationMetric], options: measureOptions) { foodCollection.swipeUp(velocity: .fast) stopMeasuring() foodCollection.swipeDown(velocity: .fast) } }
-