Skip to content
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

Add conveniences for rapid prototyping #161

Open
marcpalmer opened this issue Jul 16, 2018 · 0 comments
Open

Add conveniences for rapid prototyping #161

marcpalmer opened this issue Jul 16, 2018 · 0 comments

Comments

@marcpalmer
Copy link
Contributor

If you are rapidly building out the structure of a feature set, it would be nice to not have to create everything fully initially. In particular Actions types.

We could provide a NotImplementedAction that you can use which takes no input and no presenter, and will just crash if performed.

Other possibilities are some syntactic sure for platform-specific prototyping, e.g. an action for tvOS and iOS that takes no input but has a function or wrapper type as presenter, which can include a segue ID and a transition(input:) function that the default action would call, so you can quickly write stuff together:

struct WireframingPresenter { 
    let viewController: UIViewController
    let presentFunction: (input: Any, viewController: UIViewController) -> Void
    init(viewController: UIViewController, present: (input: Any, viewController: UIViewController) -> Void)  {
    ...
    }

    func present(input: Any) {
       presentFunction(input, viewController)
    }
}

final class WireframingAction: Action {
   typealias PresenterType = WireframingPresenter

   static func perform( ... ) {
     presenter.present(input: input)
      ....
   }
}
@marcpalmer marcpalmer added this to the 1.1 milestone Jan 26, 2019
@marcpalmer marcpalmer removed this from the 1.1 milestone May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant