Skip to content

Instantly share code, notes, and snippets.

@wleii
Created June 20, 2016 08:06
Show Gist options
  • Save wleii/5ea6b11f040d47d507f114d6c35756aa to your computer and use it in GitHub Desktop.
Save wleii/5ea6b11f040d47d507f114d6c35756aa to your computer and use it in GitHub Desktop.
计算 ScrollView Page
let page = Int(floor(($0.x - itemWidth / 2) / itemWidth) + 1)
pageControl.currentPage = page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment