Class: RMXTableViewCell

Inherits:
UITableViewCell
  • Object
show all
Includes:
RMXCommonMethods
Defined in:
lib/motion/RMXTableViewCell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RMXCommonMethods

#dealloc, #description, #inspect, #rmx_dealloc

Instance Attribute Details

#indexPathObject

Returns the value of attribute indexPath.



7
8
9
# File 'lib/motion/RMXTableViewCell.rb', line 7

def indexPath
  @indexPath
end

#innerContentViewObject

Returns the value of attribute innerContentView.



7
8
9
# File 'lib/motion/RMXTableViewCell.rb', line 7

def innerContentView
  @innerContentView
end

Instance Method Details

#context=(context) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/motion/RMXTableViewCell.rb', line 30

def context=(context)
  self.tableHandler = context[:tableHandler]
  self.tableView = context[:tableView]
  self.indexPath = context[:indexPath]
  self.data = context[:data]
  self.view = context[:view]
  if context[:transform] && transform != context[:transform]
    self.transform = context[:transform]
  end
end

#dataObject



44
45
46
# File 'lib/motion/RMXTableViewCell.rb', line 44

def data
  @data
end

#data=(data) ⇒ Object



48
49
50
# File 'lib/motion/RMXTableViewCell.rb', line 48

def data=(data)
  @data = data
end

#initWithStyle(style, reuseIdentifier: reuseIdentifier) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/motion/RMXTableViewCell.rb', line 9

def initWithStyle(style, reuseIdentifier:reuseIdentifier)
  reuseIdentifier = reuseIdentifier.to_s
  s = super(style, reuseIdentifier)
  @innerContentView = RMXTableViewCellInnerContentView.new
  @innerContentView.cell = self
  RMX::Layout.new do |layout|
    layout.view = contentView
    layout.subviews = {
      "innerContentView" => @innerContentView
    }
    layout.eqs %Q{
      innerContentView.top == 0
      innerContentView.left == 0
      innerContentView.right == 0
      innerContentView.bottom == 0 @ med
    }
  end
  setup
  s
end

#setupObject



41
42
# File 'lib/motion/RMXTableViewCell.rb', line 41

def setup
end

#updateHeight!Object



75
76
77
78
79
80
81
82
83
# File 'lib/motion/RMXTableViewCell.rb', line 75

def updateHeight!
  if (d = data) && (h = tableHandler)
    height = contentView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize).height
    # p "height", height
    if h.updateHeight(height, data:d, reuseIdentifier:reuseIdentifier)
      h.reloadData
    end
  end
end

#viewObject



52
53
54
# File 'lib/motion/RMXTableViewCell.rb', line 52

def view
  @view
end

#view=(view) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/motion/RMXTableViewCell.rb', line 56

def view=(view)
  @view.removeFromSuperview if @view
  if @view = view
    RMX::Layout.new do |layout|
      layout.view = innerContentView
      layout.subviews = {
        "tile" => view
      }
      layout.eqs %Q{
        tile.top == 0
        tile.left == 0
        tile.right == 0
        tile.bottom == 0 @ 500
      }
    end
  end
  view
end