Skip to content

Commit

Permalink
Merge pull request #134 from quickbirdstudios/bugfix/page-coordinator
Browse files Browse the repository at this point in the history
Bugfix: PageCoordinator
  • Loading branch information
pauljohanneskraft authored Oct 22, 2019
2 parents 3a2c204 + b85f812 commit 0c16cc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Sources/XCoordinator/PageCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ open class PageCoordinator<RouteType: Route>: BaseCoordinator<RouteType, PageTra
set: Presentable? = nil,
direction: UIPageViewController.NavigationDirection = .forward) {
self.dataSource = PageCoordinatorDataSource(pages: pages.map { $0.viewController }, loop: loop)
rootViewController.dataSource = dataSource

guard let firstPage = set ?? pages.first else {
assertionFailure("Please provide a positive number of pages for use in \(String(describing: PageCoordinator<RouteType>.self))")
super.init(rootViewController: rootViewController, initialRoute: nil)
super.init(rootViewController: rootViewController, initialTransition: .initial(pages: pages))
return
}

Expand Down Expand Up @@ -93,7 +94,7 @@ open class PageCoordinator<RouteType: Route>: BaseCoordinator<RouteType, PageTra
set: Presentable,
direction: UIPageViewController.NavigationDirection) {
self.dataSource = dataSource

rootViewController.dataSource = dataSource
super.init(rootViewController: rootViewController,
initialTransition: .set(set, direction: direction))
}
Expand Down
2 changes: 1 addition & 1 deletion XCoordinator.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'XCoordinator'
spec.version = '2.0.3'
spec.version = '2.0.5'
spec.license = { :type => 'MIT' }
spec.homepage = 'https://github.com/quickbirdstudios/XCoordinator'
spec.authors = { 'Stefan Kofler' => '[email protected]', 'Paul Kraft' => '[email protected]' }
Expand Down

0 comments on commit 0c16cc7

Please sign in to comment.