Comments (4)
Keep in mind, that whenever you tap the loginButton, one of the following coordinators is shown: HomeTabBarCoordinator
, HomeSplitCoordinator
and HomePageCoordinator
. To change this behavior, please adapt the prepareTransition
method in the AppCoordinator
to your liking (e.g. always showing a HomePageCoordinator
).
Here are some basics about PageCoordinators starting with the initializers of a PageCoordinator:
Option 1:
public init(rootViewController: RootViewController = .init(),
pages: [Presentable],
loop: Bool = false,
set: Presentable? = nil,
direction: UIPageViewController.NavigationDirection = .forward)
Option 2:
public init(rootViewController: RootViewController = .init(),
dataSource: UIPageViewControllerDataSource,
set: Presentable,
direction: UIPageViewController.NavigationDirection)
Option 1 offers a default UIPageViewControllerDataSource, which gets initialized with an array of presentables (being either coordinator or viewController). You can initialize the PageCoordinator using that initializer for a fixed array of presentables, e.g. in the onboarding case you discussed - however, if you need more control about the presentables you want to use in the UIPageViewController, you may use Option 2.
The Transition.set
can be used to set the currently visible pages, which can either be one Presentable or two, if you set isDoubleSided to true. For further customization, you can access the UIPageViewController using the rootViewController
property in your coordinator.
I hope, I could help you with setting up a PageCoordinator.
from xcoordinator-example.
I actually noticed a problem with the current implementation of PageCoordinator, which should be fixed with QuickBirdEng/XCoordinator#134. Until then, you can override the initializer of your PageCoordinator subclass and call rootViewController.dataSource = self.dataSource
directly after super.init
, which should solve the problem - thanks for catching that one!
from xcoordinator-example.
Thank you for putting out a fix for this! Glad I could help. Thanks for the great library!
from xcoordinator-example.
The fix was part of the 2.0.5 release - so I'm closing this now.
Glad you like it and thanks again for your help.
from xcoordinator-example.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcoordinator-example.