Method: MotionPrime::GridSection#render_cell

Defined in:
motion-prime/sections/grid.rb

#render_cell(index) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'motion-prime/sections/grid.rb', line 40

def render_cell(index)
  collection_view.registerClass(MPCollectionCellWithSection, forCellWithReuseIdentifier: cell_name(index))
  view = collection_view.dequeueReusableCellWithReuseIdentifier(cell_name(index), forIndexPath: index)

  section = cell_section_by_index(index)
  element = section.container_element || section.init_container_element(container_element_options_for(index))
  unless view.section
    element.view = view
    screen.set_options_for view, element.computed_options.except(:parent_view) do
      section.render
    end

    on_cell_render(view, index)
  end
  view
end