platform :ios, '9.0'
target 'YourIosApps' do
use_frameworks!
pod 'MBack'
end
$ pod install
$ touch Cartfile
github "MZC0829/MBack"
$ carthage update
- iOS 9.0+
- swift 3+ and swift 4
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
self.MBackButton(image: "Your custom back image")
}
override func viewWillAppear(_ animated: Bool)
{
super.viewWillAppear(animated)
self.MBackButton(image: "Your custom back image", popMethod: ENUMPopMethod.Root, title: "Back")
}
override func viewDidLoad()
{
super.viewDidLoad()
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool
{
if gestureRecognizer == self.navigationController?.interactivePopGestureRecognizer
{
return self.navigationController!.viewControllers.count > 1
}
return true
}