Created
September 23, 2022 16:04
-
-
Save scott-lydon/620fa0001b503b39967cf683b3cda1f5 to your computer and use it in GitHub Desktop.
This file contains 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
import UIKit | |
extension UINavigationController { | |
// - MARK: Extracted reusable methods so that implementation changes reflect wherever used. | |
func viewController() { | |
navigationController.pushViewController(ViewController.instantiate(), animated: false) | |
} | |
func buySubscription() { | |
navigationController.pushViewController(BuyViewController.instantiate(), animated: true) | |
} | |
func createAccount() { | |
navigationController.pushViewController(CreateAccountViewController.instantiate(), animated: true) | |
} | |
} | |
class ViewController: UIViewController { | |
@IBAction func buyTapped(_ sender: Any) { | |
navigationController?.buySubscription() | |
} | |
@IBAction func createAccount(_ sender: Any) { | |
navigationController?.createAccount() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment