Building Subscription Blogging App: Part 1 – Project Set Up (2022, Xcode 12, Swift 5) – iOS
private func setControllers() {
let vc1 = HomeViewController()
vc1.title = "Home"
vc1.navigationItem.largeTitleDisplayMode = .always
let nav1 = UINavigationController(rootViewController: vc1)
nav1.navigationBar.prefersLargeTitles = true
nav1.tabBarItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house"), selectedImage: UIImage(systemName: "house.fill"))
let vc2 = ProfileViewController()
vc2.title = "Profile"
vc2.navigationItem.largeTitleDisplayMode = .always
let nav2 = UINavigationController(rootViewController: vc2)
nav2.navigationBar.prefersLargeTitles = true
nav2.tabBarItem = UITabBarItem(title: "Profile", image: UIImage(systemName: "person.circle"), selectedImage: UIImage(systemName: "person.circle.fill"))
setViewControllers([nav1, nav2], animated: true)
}
인앱 결제를 한 번 사용해보는 강의 영상! 영상의 MVC 스타일을 MVVM 형태로 변환해보면서 한 번 기능도 덧붙여보자. 재미있을 듯.