Add the comments about how to use native view update helper

This commit is contained in:
DreamPiggy 2019-11-02 16:39:56 +08:00
parent 03982673ca
commit 04fc21a08c
2 changed files with 8 additions and 0 deletions

View File

@ -85,6 +85,11 @@ struct ContentView: View {
if self.animated {
#if os(macOS) || os(iOS) || os(tvOS)
AnimatedImage(url: URL(string:url))
/**
.onViewUpdate { view, context in
view.toolTip = "Mouseover Tip"
}
*/
.indicator(SDWebImageActivityIndicator.medium)
/**
.placeholder(UIImage(systemName: "photo"))

View File

@ -133,6 +133,9 @@ var body: some View {
// Bundle (not Asset Catalog)
AnimatedImage(name: "animation1", isAnimating: $isAnimating)) // Animation control binding
.maxBufferSize(.max)
.onViewUpdate { view, context in // Advanced native view coordinate
view.toolTip = "Mouseover Tip"
}
}
}
```