Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kahayash authored and kahayash committed Jul 18, 2017
1 parent 1eb80ff commit 030e8c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PagingKit/PagingContentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public class PagingContentViewController: UIViewController {

override public func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
scrollView.contentSize = CGSize(
width: scrollView.bounds.size.width * CGFloat(numberOfPages),
height: scrollView.bounds.size.height
)

layoutHandler?()
}

Expand Down Expand Up @@ -133,7 +138,6 @@ public class PagingContentViewController: UIViewController {

numberOfPages = dataSource?.numberOfItemForContentViewController(viewController: self) ?? 0
cachedViewControllers = Array(repeating: nil, count: numberOfPages)
scrollView.contentSize = CGSize(width: scrollView.bounds.size.width * CGFloat(numberOfPages), height: scrollView.bounds.size.height)

loadScrollView(with: page - 1)
loadScrollView(with: page)
Expand Down

0 comments on commit 030e8c7

Please sign in to comment.