SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller.
- iOS task manager like UI
- Launch Navigation History with Long tap action of Back Bar Button
SAHistoryNavigationViewController is available through CocoaPods. If you have cocoapods 0.36.0 or greater, you can install it, simply add the following line to your Podfile:
pod "SAHistoryNavigationViewController"
Add the SAHistoryNavigationViewController directory to your project.
If you install from cocoapods, You have to write import SAHistoryNavigationViewController
.
Set custom class of UINavigationController to SAHistoryNavigationViewController. In addition, set module to SAHistoryNavigationViewController.
You can use SAHistoryNavigationViewController as self.navigationController
in ViewController, bacause implemented extension UINavigationController
as below codes and override those methods in SAHistoryNavigationViewController.
extension UINavigationController {
public func showHistory() {}
public func setHistoryBackgroundColor(color: UIColor) {}
public func contentView() -> UIView? { return nil }
}
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.
navigationController?.showHistory()
If you want to customize background of Navigation History, you can use those methods.
navigationController?.contentView()
navigationController?.setHistoryBackgroundColor(color: UIColor)
- Xcode 6.1 or greater
- iOS7.0(manually only) or greater
Taiki Suzuki, s1180183@gmail.com
SAHistoryNavigationViewController is available under the MIT license. See the LICENSE file for more info.