Skip to content

Instantly share code, notes, and snippets.

@emrekyv
Last active March 10, 2020 10:45
Show Gist options
  • Save emrekyv/3343aa40c24d7e54244dc09ba0cd95df to your computer and use it in GitHub Desktop.
Save emrekyv/3343aa40c24d7e54244dc09ba0cd95df to your computer and use it in GitHub Desktop.
import UIKit
class CameraViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func dismiss() {
dismiss(animated: true)
}
}
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