GithubHelp home page GithubHelp logo

flinedev / imperio Goto Github PK

View Code? Open in Web Editor NEW
58.0 7.0 12.0 5.93 MB

Keep the screen flow and data handling logic out of your view controllers – let them handle view-stuff only.

License: MIT License

Ruby 15.77% Swift 84.23%
coordinator screenflow thin-viewcontrollers appdelegate viewcontroller

imperio's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

imperio's Issues

Example app

This repo looks great. I'm going to try to use it for a new project. It would be great if you had a sample app that pulled together all the code snippets in your read me.

Rename start(from viewController: UIViewController)

Issue

When using start(from viewController: UIViewController), in order to present a view controller, one has to e. g. write code like viewController.present(viewControllerToPresent, animated: true) or viewController.navigationController?.push(viewControllerToPresent, animated: true).

While this works seamlessly, the naming of the presenting view controller is a bit misleading.
In larger function bodies, it's not instantly clear what ViewController viewController is.

Suggestion

By renaming start(from viewController: UIViewController), to e. g. start(from presentingViewController: UIViewController), one could easily solve this issue. Describing the semantics more precisely should fit the point of the whole method.

Unnecessary [unowned self] in documentation

In the documentation, it reads

Please don't forget the [unowned self] when using @escaping closures to prevent memory leaks.

... referencing the following example:

func imagePickerStartButtonPressed() {
    let imagePickerFlowCtrl = ImagePickerFlowController { [unowned self] pickedImage in
        // do something with the result
    }

    add(subFlowController: imagePickerFlowCtrl)
    imagePickerFlowCtrl.start(from: mainViewController!)
}

Actually, when the flow controller doesn't hold a strong reference to the child flow controller apart from the one which is created by using add(subFlowController: imagePickerFlowCtrl), there should be no issues.

When removeFromSuperFlowController() gets called as it is supposed to, the flow controller will no longer keep a reference to the sub flow controller. As nothing points to the sub flow controller any longer, it can be cleared, despite not using [unowned self].

Therefore, this declaration is not necessary and should not be proposed in the documentation.

Only case for using `[unowned self] would be when the flow controller keeps a strong reference to the sub flow controller in a variable. Yet, to my understanding, this is not the suggested way to use flow controllers, is only required rarely and doesn't fit the example given in the documentation.

Add multiple sub flow controllers?

Do you support multiple sub flow controllers, for example, maybe useful in the case of a tab bar.

add(subFlowController: FlowController) can be called multiple times, but it releases the previous controller. Therefore, there can only be one sub.

Disable animation

Hello thanks that you make a framework called like my Dorfdisco, but why is there a present-method without setting animation to false?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.