You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-13Lines changed: 50 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ SDWebImageLinkPlugin is a plugin for [SDWebImage](https://github.com/rs/SDWebIma
13
13
14
14
By using this plugin, it allows you to use your familiar View Category method from SDWebImage, to load rich link's poster image, with the URL or `LPMetadata`. And make it easy to use `LPLinkView` with cache support.
15
15
16
+
See more about Link Presentation in [WWDC 262: Embedding and Sharing Visually Rich Links](https://developer.apple.com/videos/play/wwdc2019/262/)
17
+
16
18
## Requirements
17
19
18
20
+ iOS 13+
@@ -59,42 +61,75 @@ To use the LinkPlugin, you should setup the loader firstly. See more here in [Wi
Important note on `LPLinkView`: Current iOS 13.0 contains bug that `LPLinkView` may not compatible with TableView/CollectionView cell-reusing. To workaround this issue, you can choose one of these below (one is OK):
93
+
94
+
1. Cache the loaded `LPMetadata` by yourself, always ensure the `sd_linkMetadata` is not nil (expect first request)
95
+
2. Do not using cache at all. So, always pass `SDWebImageFromLoaderOnly` to load the metadata from network
96
+
3. Using trick code, create `LPLinkView` with nil URL (important)
Note: You can always read and write the `LPMetadata` object on the associated `NSURL` object, to provide an exist metadata from your serialization solution, or update the metadata. If the provided URL have an associated metadata, we don't do extra query with [LPMetadataProvider](https://developer.apple.com/documentation/linkpresentation/lpmetadataprovider?language=objc).
90
112
91
113
+ Objective-C
92
114
93
115
```objective-c
116
+
// Decoding a metadata from your serialization solution
Note: By default, if the image is cached, we do not send request to query new metadata. If you need to query the metadata as well, consider using SDWebImage's `SDWebImageRefreshCached` option. Or using `SDWebImageFromLoaderOnly` to avoid cache during query.
132
+
98
133
Note: By default, we prefer to load the image only, which does not generate the image data. This can increase the loading speed. But however, you can also specify to generate the image data by using `SDWebImageContextLinkRequestImageData` context option.
99
134
100
135
## Demo
@@ -109,6 +144,8 @@ open SDWebImageLinkPlugin.xcworkspace
109
144
110
145
After the Xcode project was opened, click `Run` to build and run the demo.
111
146
147
+
Tips: The iOS demo provide the both of two views' usage. Click `Switch View` to toggle between UIImageView/LPLinkView.
0 commit comments