Last active
January 7, 2019 12:13
-
-
Save cymtrick/eba8237dc93bb3e52e7112a2af638c6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func viewDidLoad() { | |
| let imageBack = UIImageView(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) | |
| imageBack.frame.origin.x = 0 | |
| imageBack.image = #imageLiteral(resourceName: "back copy") | |
| logoContainer.addSubview(imageBack) | |
| self.navigationItem.titleView = logoContainer | |
| self.navigationController?.navigationBar.tintColor = UIColor.white | |
| self.navigationController?.navigationBar.barStyle = .blackOpaque | |
| self.navigationController?.navigationBar.barTintColor = UIColor.black | |
| let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(back(tapGestureRecognizer:))) | |
| imageBack.isUserInteractionEnabled = true | |
| imageBack.addGestureRecognizer(tapGestureRecognizer) | |
| } | |
| @objc func back(tapGestureRecognizer: UITapGestureRecognizer) | |
| { | |
| //dispatch action again | |
| // Your action | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @objc func oneOfUsAction(sender: UIButton!) | |
| { | |
| DispatchQueue.main.async { | |
| let secondViewController = secondViewController() | |
| let secondController = UINavigationController(rootViewController: secondViewController) | |
| let feedback = UINotificationFeedbackGenerator() | |
| feedback.notificationOccurred(.success) | |
| UIApplication.shared.keyWindow?.setRootViewController(secondController, options: UIWindow.TransitionOptions(direction: .toRight)) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment