Removed my code formatting and added a code-fix for how visiblePages is calculated in the reloadData method. I check to see if the self.frame.size.width is evenly divisible by the pageSize. If true, then I increment visiblePages by 1 to make sure that the content size of the scrollview is correct.