-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for API design #9
Comments
I'm not sure exactly what the semantics are...
|
Here are 2 other examples: // NavigationController module
let navController = NavigationController.root(screen1)
let flow = navController
>>> navController.push(screen2)
>>> navController.push(screen3) // SplitViewController module
let splitViewController = SplitViewController.root(NavigationController.root(screen1), screen2)
let flow = splitViewController
>>> splitViewController.leftController.push(screen3)
>>> splitViewController.replaceDetailOnRight(screen4) The idea is to have mondules with their own semantics, and make them In the example I provided in the first post, let modalFlow = root(screen10)
>>> push(screen11)
>>> push(screen12)
let flow = root(screen1)
>>> presentModally(modalFlow) // dismiss remains implicit and occurs at the end of the modal flow
>>> push(screen2) You agree that the idea behind all of this is : view controllers act as (pure) functions and navigation is just functions composition. |
Cool! I'm currently on a long trip, but will look at this when I'm back in On Fri, Jun 26, 2015 at 9:26 AM, Nicolas VERINAUD [email protected]
Chris Eidhof |
First of all, thanks for your work, it's very promising !
I thought about this earlier this week and I came up with an API I'd like to see in the future, so, seeing your enthusiasm on the subject, here it is.
The idea is to asbtract the act of pushing, presenting, dismissing, etc. into functions. Navigation Controller could be one provider of these functions. The functions
root
,push
, etc. acts as adapters like what you see inmap
orfilter
.What do you think ?
The text was updated successfully, but these errors were encountered: