Latest 0.6.2
Homepage https://github.com/DevAndArtist/RxContainer
License MIT
Platforms ios 10.0
Dependencies RxSwift
Frameworks UIKit
Authors


The API is future oriented, which means the following description is already using nested open protocols or default implementation in protocols even if these features are not currently possibble. However the module itself is written so that it already behaves like written below.

ContainerViewController:
open class ContainerViewController : UIViewController {

    open protocol Delegate : AnyObject {
        func animator(for transition: Transition) -> Animator?
    }

    public struct Event {
        public enum Position { case start, end }

        public let operation: Operation
        public var position: Position { get }
        public let containerViewController: ContainerViewController
    }

    public struct Operation {

        public enum Kind {
            case push(UIViewController)
            case pop(UIViewController)
            case set([UIViewController])
        }

        public let kind: Kind
        public let isAnimated: Bool
    }

    open var viewControllers: [UIViewController]
    open var rootViewController: UIViewController? { get }
    open var topViewController: UIViewController? { get }
    open var events: RxSwift.Observable<ContainerViewController.Event> { get }
    open weak var delegate: Delegate?

    public init()
    public convenience init(_ viewControllers: UIViewController...)
    public required init?(coder aDecoder: NSCoder)

    open func push(_ viewController: UIViewController, animated: Bool = default)

    @discardableResult
    open func pop(animated: Bool = default) -> UIViewController?

    @discardableResult
    open func pop(to viewController: UIViewController, animated: Bool = default) -> [UIViewController]?

    @discardableResult
    open func popToRootViewController(animated: Bool = default) -> [UIViewController]?

    open func setViewControllers(_ viewControllers: [UIViewController], animated: Bool = default)
}
Transition:
public final class Transition {

    public struct Context {
        public enum Key { case from, to }
        public enum Kind { case push, pop }

        public let kind: Kind
        public let containerView: UIView
        public let isAnimated: Bool
        public func viewController(forKey key: Key) -> UIViewController
        public func view(forKey key: Key) -> UIView
    }

    public var animation: ((Context) -> Void)? { get }
    public var completion: ((Context) -> Void)? { get }

    public let context: Context

    public func animateAlongside(_ animation: ((Context) -> Void)?, 
                                 completion: ((Context) -> Void)? = default)
    public func complete(_ didComplete: Bool)
}
Animator:
open protocol Animator : AnyObject {
    var transition: Transition { get }
    func animate()

    // Default implementation
    func transition(completed: Bool) { /* no-op */}
}
DefaultAnimator:
public final class DefaultAnimator : Animator {

    public enum Direction { case left, right, up, down }

    public let transition: Transition
    public let direction: Direction
    public init(for transition: Transition, withDirection direction: Direction)
    public func animate()
}

Latest podspec

{
    "name": "RxContainer",
    "version": "0.6.2",
    "summary": "RxContainer provides the missing part between `UINavigationController` and `UIViewController`.",
    "description": "This CocoaPod provides a custom implementation for a `ContainerViewController`. `ContainerViewController`nprovides a very clean API and removes all unnecessary pieces that a `UINavigationController` would have nadded when driving the app flow without the `UINavigationBar`.",
    "homepage": "https://github.com/DevAndArtist/RxContainer",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Adrian Zubarev": "[email protected]"
    },
    "social_media_url": "https://twitter.com/DevAndArtist",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/DevAndArtist/RxContainer.git",
        "tag": "0.6.2"
    },
    "source_files": "Sources/*.swift",
    "frameworks": "UIKit",
    "dependencies": {
        "RxSwift": [
            "~> 4.0.0-alpha.1"
        ]
    },
    "pushed_with_swift_version": "4.0-DEVELOPMENT-SNAPSHOT-2017-08-04-a"
}

Pin It on Pinterest

Share This