Pārlūkot izejas kodu

VLCLocalNetworkListCell: add delegate protocol to trigger a download if the button is touched

Felix Paul Kühne 12 gadi atpakaļ
vecāks
revīzija
ce90810053

+ 8 - 0
AspenProject/VLCLocalNetworkListCell.h

@@ -12,6 +12,8 @@
 
 @interface VLCLocalNetworkListCell : UITableViewCell
 
+@property (nonatomic, weak) id delegate;
+
 @property (nonatomic, strong) IBOutlet UILabel *titleLabel;
 @property (nonatomic, strong) IBOutlet UILabel *folderTitleLabel;
 @property (nonatomic, strong) IBOutlet UILabel *subtitleLabel;
@@ -31,3 +33,9 @@
 - (IBAction)triggerDownload:(id)sender;
 
 @end
+
+@protocol VLCLocalNetworkListCell <NSObject>
+
+- (void)triggerDownloadForCell:(VLCLocalNetworkListCell *)cell;
+
+@end

+ 2 - 1
AspenProject/VLCLocalNetworkListCell.m

@@ -66,7 +66,8 @@
 
 - (void)triggerDownload:(id)sender
 {
-    NSLog(@"Download requires adaptation of VLCHTTPDownloadViewController");
+    if ([self.delegate respondsToSelector:@selector(triggerDownloadForCell:)])
+        [self.delegate triggerDownloadForCell:self];
 }
 
 + (CGFloat)heightOfCell