Method: MotionPrime::GridSection#index_for_cell_section

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

#index_for_cell_section(section) ⇒ Object

Get index path for cell section

Parameters:

  • section (Prime::Section)

    cell section.



15
16
17
18
19
20
# File 'motion-prime/sections/grid.rb', line 15

def index_for_cell_section(section)
  return unless item = @data.try(:index, section)
  group = item/grid_size
  row = cell_sections_for_group(group).index(section)
  NSIndexPath.indexPathForRow(row, inSection: group)
end