Last active
March 10, 2020 10:45
-
-
Save emrekyv/3343aa40c24d7e54244dc09ba0cd95df 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 | |
class CameraViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
@IBAction func dismiss() { | |
dismiss(animated: true) | |
} | |
} | |
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 | |
class TabBarController: UITabBarController, UITabBarControllerDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.delegate = self | |
} | |
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { | |
if let identifier = viewController.restorationIdentifier, identifier == "cameraVC" { | |
let vc = self.storyboard?.instantiateViewController(withIdentifier: "cameraVC") as! CameraViewController | |
present(vc, animated: true, completion: nil) | |
return false | |
} | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment