Update the watchOS demo without the force-touch

This commit is contained in:
DreamPiggy 2023-09-21 22:38:58 +08:00
parent a94221fba0
commit 69c6f008dc
3 changed files with 13 additions and 14 deletions

View File

@ -191,15 +191,16 @@ struct ContentView: View {
}
#endif
#if os(watchOS)
return contentView()
.contextMenu {
Button(action: { self.reloadCache() }) {
Text("Reload")
return NavigationView {
contentView()
.navigationTitle("WebImage")
.toolbar {
Button(action: { self.reloadCache() }) {
Text("Reload")
}
}
Button(action: { self.switchView() }) {
Text("Switch")
}
}
}
#endif
}

View File

@ -52,10 +52,8 @@ struct DetailView: View {
#endif
#if os(macOS) || os(watchOS)
zoomView()
.contextMenu {
Button(isAnimating ? "Stop" : "Start") {
self.isAnimating.toggle()
}
.onTapGesture {
self.isAnimating.toggle()
}
#endif
}

View File

@ -622,8 +622,8 @@ Since SwiftUI is aimed to support all Apple platforms, our demo does this as wel
Demo Tips:
1. Use `Switch` (right-click on macOS/force press on watchOS) to switch between `WebImage` and `AnimatedImage`.
2. Use `Reload` (right-click on macOS/force press on watchOS) to clear cache.
1. Use `Switch` (right-click on macOS/tap on watchOS) to switch between `WebImage` and `AnimatedImage`.
2. Use `Reload` (right-click on macOS/button on watchOS) to clear cache.
3. Use `Swipe Left` (menu button on tvOS) to delete one image url from list.
4. Pinch gesture (Digital Crown on watchOS, play button on tvOS) to zoom-in detail page image.
5. Clear cache and go to detail page to see progressive loading.