Skip to content

Commit d57fdbb

Browse files
authored
Merge pull request #41 from SDWebImage/refine_animated_image_api
Refine AnimatedImage Public APIs to make it more scalable
2 parents bbf6d59 + 04fc21a commit d57fdbb

File tree

4 files changed

+161
-114
lines changed

4 files changed

+161
-114
lines changed

Example/SDWebImageSwiftUIDemo/ContentView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ struct ContentView: View {
8585
if self.animated {
8686
#if os(macOS) || os(iOS) || os(tvOS)
8787
AnimatedImage(url: URL(string:url))
88+
/**
89+
.onViewUpdate { view, context in
90+
view.toolTip = "Mouseover Tip"
91+
}
92+
*/
8893
.indicator(SDWebImageActivityIndicator.medium)
8994
/**
9095
.placeholder(UIImage(systemName: "photo"))

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ var body: some View {
133133
// Bundle (not Asset Catalog)
134134
AnimatedImage(name: "animation1", isAnimating: $isAnimating)) // Animation control binding
135135
.maxBufferSize(.max)
136+
.onViewUpdate { view, context in // Advanced native view coordinate
137+
view.toolTip = "Mouseover Tip"
138+
}
136139
}
137140
}
138141
```

0 commit comments

Comments
 (0)