Module: ControlGallery

Defined in:
lib/project/libs/control_gallery.rb

Instance Method Summary collapse

Instance Method Details

#pageTurn(pageControl) ⇒ Object



9
10
11
# File 'lib/project/libs/control_gallery.rb', line 9

def pageTurn(pageControl)
  scroll_gallery.setContentOffset( CGPointMake(UIScreen.mainScreen.bounds.size.width * pageControl.currentPage, 0) )
end

#scrollViewDidScroll(sender) ⇒ Object



2
3
4
5
6
7
# File 'lib/project/libs/control_gallery.rb', line 2

def scrollViewDidScroll(sender)
  pageWidth = scroll_gallery.frame.size.width;
  scroll_gallery.setContentOffset( CGPointMake(scroll_gallery.contentOffset.x, 0) )
  page = ((scroll_gallery.contentOffset.x - pageWidth / 2) /pageWidth) + 1
  page_control.currentPage = page;
end