ViewCoordinator

Elegant way to manipulate your UIViews presentation and dismissal from any given Controller.


Keywords
swift-3, swift-library, swift4, uiview, uiviewcontroller
License
MIT
Install
pod try ViewCoordinator

Documentation

ViewCoordinator

CI Status Version License Platform

We're hoping to ease the way that we present multiples UIViews (keep in mind that views should be light) onto any Controllers. Instead of hiding views that you'd need to present at a certain time, you would just need to drop all your views into a container, then use the ViewCoordinator mechanism to bring them back into screen.

OverView

No need to manually adding views to the parent's view, No need need to create repeated code to present or dismiss your views. Just wrap your views with a ViewWrapper and drop that single or array of ViewWrappers into the ViewCoordinator's container.

private func singleViewManipulation() {
let _view = UIView(frame: view.frame) // create your view
_view.backgroundColor = .red
let firstViewWrapper = ViewWrapper(view: _view, uid: "SingleViewTag") // wrap your view
viewCoordinator?.addMultipleViewsToStack([firstViewWrapper]) // drop into our container
}

viewCoordinator?.presentTopView() // it would present that single view onto your controller

viewCoordinator?.dismissTopView() // it would dismiss that single view from your controller

Run Example Project

To run the example project to explore and see more examples, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

ViewCoordinator is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ViewCoordinator'

Questions, Issues or Suggestions

Feel free to open any issues.

Author

lamour

License

ViewCoordinator is available under the MIT license. See the LICENSE file for more info.