VLCServerBrowsingTVCell.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2015 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Tobias Conradi <videolan # tobias-conradi.de>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import "VLCServerBrowsingTVCell.h"
  12. NSString *const VLCServerBrowsingTVCellIdentifier = @"VLCServerBrowsingTVCell";
  13. @implementation VLCServerBrowsingTVCell
  14. @synthesize thumbnailURL = _thumbnailURL, isDirectory = _isDirectory;
  15. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  16. return [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
  17. }
  18. - (void)setThumbnailURL:(NSURL *)thumbnailURL {
  19. _thumbnailURL = thumbnailURL;
  20. [self.thumbnailImageView setImageWithURL:thumbnailURL];
  21. }
  22. - (void)setThumbnailImage:(UIImage *)thumbnailImage {
  23. [self.thumbnailImageView setImage:thumbnailImage];
  24. }
  25. -(UIImage *)thumbnailImage {
  26. return self.thumbnailImageView.image;
  27. }
  28. - (void)setTitle:(NSString *)title {
  29. self.titleLabel.text = title;
  30. }
  31. - (NSString *)title {
  32. return self.titleLabel.text;
  33. }
  34. - (void)setSubtitle:(NSString *)subtitle {
  35. self.subtitleLabel.text = subtitle;
  36. }
  37. - (NSString *)subtitle {
  38. return self.subtitleLabel.text;
  39. }
  40. - (void)awakeFromNib {
  41. [super awakeFromNib];
  42. [self prepareForReuse];
  43. }
  44. - (void)prepareForReuse {
  45. [super prepareForReuse];
  46. [self.thumbnailImageView cancelLoading];
  47. self.title = nil;
  48. self.subtitle = nil;
  49. }
  50. @end