File tree Expand file tree Collapse file tree
Example/SDWebImageLinkPlugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99#import " SDViewController.h"
1010#import < SDWebImage/SDWebImage.h>
1111#import < SDWebImageLinkPlugin/SDWebImageLinkPlugin.h>
12+ #import < SafariServices/SafariServices.h>
1213
1314@interface LinkTableViewCell : UITableViewCell
1415
@@ -85,7 +86,7 @@ - (void)viewDidLoad {
8586 style: UIBarButtonItemStylePlain
8687 target: self
8788 action: @selector (switchView )];
88- self.useLinkView = YES ;
89+ self.useLinkView = NO ;
8990 self.objects = [NSArray arrayWithObjects:
9091 @" https://www.apple.com/" ,
9192 @" https://www.apple.com/music/" ,
@@ -147,4 +148,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
147148 return cell;
148149}
149150
151+ - (void )tableView : (UITableView *)tableView didSelectRowAtIndexPath : (NSIndexPath *)indexPath {
152+ [tableView deselectRowAtIndexPath: indexPath animated: YES ];
153+ NSURL *url = [NSURL URLWithString: self .objects[indexPath.row]];
154+
155+ SFSafariViewController *safariVC = [[SFSafariViewController alloc ] initWithURL: url];
156+ [self presentViewController: safariVC animated: YES completion: nil ];
157+ }
158+
150159@end
You can’t perform that action at this time.
0 commit comments