Module: MotionPrime::TableSectionRefreshMixin

Included in:
TableSection
Defined in:
motion-prime/sections/table/refresh_mixin.rb

Instance Method Summary collapse

Instance Method Details

#add_pull_to_refresh(options = {}, &block) ⇒ Object



3
4
5
6
7
8
# File 'motion-prime/sections/table/refresh_mixin.rb', line 3

def add_pull_to_refresh(options = {}, &block)
  screen.automaticallyAdjustsScrollViewInsets = false

  table_view.addPullToRefreshWithActionHandler(block) # block must be a variable
  screen.setup table_view.pullToRefreshView, styles: [:base_pull_to_refresh]
end

#finish_pull_to_refreshObject



10
11
12
13
# File 'motion-prime/sections/table/refresh_mixin.rb', line 10

def finish_pull_to_refresh
  reload_data
  table_view.pullToRefreshView.stopAnimating
end