Class: BasicTableViewCell

Inherits:
UITableViewCell
  • Object
show all
Includes:
ControlVariables
Defined in:
lib/motion-horizontal-scroll/basic_table_view_cell.rb

Direct Known Subclasses

BasicTableViewCellWithTitle

Constant Summary

Constants included from ControlVariables

ControlVariables::CELL_BACKGROUND_COLOR, ControlVariables::CELL_HEIGHT, ControlVariables::CELL_WIDTH, ControlVariables::HORIZONTAL_VIEW_SELECTED_BACKGROUND_COLOR

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#thumbnailObject

Returns the value of attribute thumbnail.



4
5
6
# File 'lib/motion-horizontal-scroll/basic_table_view_cell.rb', line 4

def thumbnail
  @thumbnail
end

Instance Method Details

#after_frame_initializationObject



21
22
23
# File 'lib/motion-horizontal-scroll/basic_table_view_cell.rb', line 21

def after_frame_initialization

end

#initWithFrame(frame) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/motion-horizontal-scroll/basic_table_view_cell.rb', line 6

def initWithFrame(frame)
  if super
    self.thumbnail = ImageViewWithOverlay.alloc.initWithFrame(CGRectMake(15, 23, 115, 145))
    self.thumbnail.userInteractionEnabled = true
    self.thumbnail.opaque = true
    self.contentView.addSubview(thumbnail)
    self.backgroundColor = CELL_BACKGROUND_COLOR
    self.selectedBackgroundView = UIView.alloc.initWithFrame(self.thumbnail.frame)
    self.selectedBackgroundView.backgroundColor = HORIZONTAL_VIEW_SELECTED_BACKGROUND_COLOR
    self.transform = CGAffineTransformMakeRotation(Math::PI * 0.5)
    after_frame_initialization
  end
  self
end

#set_thumbnail_image(image) ⇒ Object



25
26
27
# File 'lib/motion-horizontal-scroll/basic_table_view_cell.rb', line 25

def set_thumbnail_image image
  self.thumbnail.setImage image
end

#set_thumbnail_image_with_url(image_url, placeholder) ⇒ Object



29
30
31
# File 'lib/motion-horizontal-scroll/basic_table_view_cell.rb', line 29

def set_thumbnail_image_with_url image_url, placeholder
  self.thumbnail.setImageWithURL(NSURL.URLWithString(image_url), placeholderImage: UIImage.imageNamed(placeholder))
end