Skip to content

Instantly share code, notes, and snippets.

@aryasurya21
Last active June 21, 2020 11:50
Show Gist options
  • Save aryasurya21/0dc14df8dcc00b73482febd1811e4b2b to your computer and use it in GitHub Desktop.
Save aryasurya21/0dc14df8dcc00b73482febd1811e4b2b to your computer and use it in GitHub Desktop.
Adding child ViewControllers as attributes.
import UIKit
class HomeViewController: UIViewController {
@IBOutlet weak var containerView: UIView!
private let checkInController: CheckInViewController
private let checkOutController: CheckOutViewController
init(){
self.checkInController = CheckInViewController()
self.checkOutController = CheckOutViewController()
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func tappedCheckIn(_ sender: Any){
}
@IBAction func tappedCheckOut(_ sender: Any){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment