SAHistoryNavigationViewController 0,0,0,1,1,0,3 travis-ci CocoaPods

SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller. Support 3D Touch!

2 years after MIT

SAHistoryNavigationViewController

Platform Language Version License

Support 3D Touch for iOS9!!

SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller.

ManiacDev.com referred.
https://maniacdev.com/2015/03/open-source-component-enhancing-the-back-button-with-view-history-navigation

Features

  • [x] iOS task manager like UI
  • [x] Launch Navigation History with Long tap action of Back Bar Button
  • [x] Support Swift2.0
  • [x] Support 3D Touch (If device is not supported 3D Touch, automatically replacing to long tap gesture.)
  • [x] Support Swift2.3
  • [x] Sipport Swift3

Installation

CocoaPods

SAHistoryNavigationViewController is available through CocoaPods. If you have cocoapods 0.38.0 or greater, you can install it, simply add the following line to your Podfile:

pod "SAHistoryNavigationViewController"

Manually

Add the SAHistoryNavigationViewController directory to your project.

Usage

If you install from cocoapods, You have to write import SAHistoryNavigationViewController.

Storyboard or Xib

Set custom class of UINavigationController to SAHistoryNavigationViewController. In addition, set module to SAHistoryNavigationViewController.

Code

You can use SAHistoryNavigationViewController as self.sah.navigationController in any ViewController, bacause implemented extension SAHistoryExtension as below codes.

public protocol SAHistoryCompatible {
    associatedtype CompatibleType
    var sah: CompatibleType { get }
}

public extension SAHistoryCompatible {
    public var sah: SAHistoryExtension<Self> {
        return SAHistoryExtension(self)
    }
}

public final class SAHistoryExtension<Base> {
    public let base: Base
    public init(_ base: Base) {
        self.base = base
    }
}

extension UIViewController: SAHistoryCompatible {}

extension SAHistoryExtension where Base: UIViewController {
    public var navigationController: SAHistoryNavigationViewController? {
        return base.navigationController as? SAHistoryNavigationViewController
    }
}

And you have to initialize like this.

let ViewController = UIViewController()
let navigationController = SAHistoryNavigationViewController()
navigationController.setViewControllers([ViewController], animated: true)
presentViewController(navigationController, animated: true, completion: nil)

If you want to launch Navigation History without long tap action, use this code.

//In any UIViewController
self.sah.navigationController?.showHistory()

Customize

If you want to customize background of Navigation History, you can use those methods.

//In any UIViewController
self.sah.navigationController?.contentView
self.sah.navigationController?.historyBackgroundColor

This is delegate methods.

@objc public protocol SAHistoryNavigationViewControllerDelegate: NSObjectProtocol {
    optional func historyControllerDidShowHistory(controller: SAHistoryNavigationViewController, viewController: UIViewController)
}

Requirements

Author

Taiki Suzuki, [email protected]

License

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

Related Repositories

awesome-ios-ui

awesome-ios-ui

A curated list of awesome iOS UI/UX libraries ...

awesome-swift

awesome-swift

A curated list of awesome Swift frameworks, libraries and software. ...

awesome-ios-cn

awesome-ios-cn

iOS 资源大全中文版,内容包括:框架、组件、测试、Apple Store、SDK、XCode、网站、书籍等 ...

Awesome-Mobile-UI

Awesome-Mobile-UI

A curated list of awesome mobile UI/UX libraries.Both Android and iOS. ...

awesome-ios

awesome-ios

A curated list of awesome iOS ecosystem, including Objective-C and Swift Project ...


Top Contributors

marty-suzuki ayushgoel jakemarsh syky27 apouche

Releases

-   3.0.1 zip tar
-   3.0.0 zip tar
-   2.4.0 zip tar
-   2.3.0 zip tar
-   2.2.2 zip tar
-   2.2.1 zip tar
-   2.2.0 zip tar
-   2.1.0 zip tar
-   2.0.0 zip tar
-   1.3.0 zip tar
-   1.2.2 zip tar
-   1.2.1 zip tar
-   1.2.0 zip tar
-   1.1.1 zip tar
-   1.1.0 zip tar
-   1.0.3 zip tar
-   1.0.2 zip tar
-   1.0.1 zip tar
-   1.0.0 zip tar