class BaseCell

Attributes

key[RW]

Public Class Methods

has_value?() click to toggle source
# File lib/project/cells/base_cell.rb, line 5
def has_value?
  false
end

Public Instance Methods

dealloc() click to toggle source
# File lib/project/cells/base_cell.rb, line 35
def dealloc
  notification_center.removeObserver(self)
end
initWithStyle(style, reuseIdentifier: reuse_identifier) click to toggle source
Calls superclass method
# File lib/project/cells/base_cell.rb, line 10
def initWithStyle(style, reuseIdentifier: reuse_identifier)
  super.tap do |cell|
    cell.selectionStyle         = UITableViewCellSelectionStyleNone
    cell.selectedBackgroundView = selected_background_view
  end
end
notification_center() click to toggle source
# File lib/project/cells/base_cell.rb, line 23
def notification_center
  NSNotificationCenter.defaultCenter
end
observe(notification_name, selector) click to toggle source
# File lib/project/cells/base_cell.rb, line 31
def observe(notification_name, selector)
  notification_center.addObserver(self, selector: selector, name: notification_name, object: nil)
end
post(notification, payload = nil) click to toggle source
# File lib/project/cells/base_cell.rb, line 27
def post(notification, payload = nil)
  notification_center.postNotificationName(notification, object: self, userInfo: payload)
end
selected_background_view() click to toggle source
# File lib/project/cells/base_cell.rb, line 17
def selected_background_view
  UIView.alloc.initWithFrame(bounds).tap do |view|
    view.backgroundColor = 'FFCDCB'.to_color
  end
end