Skip to content

Commit 0417eab

Browse files
committed
Update the example with fade transition and title
1 parent 7fd7cdf commit 0417eab

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Example/SDWebImageLinkPlugin/SDViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,21 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
148148
if (![cell isKindOfClass:LinkTableViewCell.class]) {
149149
cell = [[LinkTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
150150
}
151+
((LinkTableViewCell *)cell).linkView.sd_imageTransition = SDWebImageTransition.fadeTransition;
151152
[((LinkTableViewCell *)cell).linkView sd_setImageWithURL:url];
152153
} else {
153154
if (![cell isKindOfClass:ImageTableViewCell.class]) {
154155
cell = [[ImageTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
155156
}
156157
((ImageTableViewCell *)cell).hostLabel.text = url.host;
158+
((ImageTableViewCell *)cell).titleLabel.text = nil;
159+
((ImageTableViewCell *)cell).customImageView.sd_imageTransition = SDWebImageTransition.fadeTransition;
157160
[((ImageTableViewCell *)cell).customImageView sd_setImageWithURL:url completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
158161
if (image) {
159162
if ([image.sd_extendedObject isKindOfClass:LPLinkMetadata.class]) {
160163
LPLinkMetadata *metadata = (LPLinkMetadata *)image.sd_extendedObject;
161164
((ImageTableViewCell *)cell).titleLabel.text = metadata.title;
165+
((ImageTableViewCell *)cell).hostLabel.text = metadata.URL.host;
162166
}
163167
}
164168
}];

0 commit comments

Comments
 (0)