BasicApp
<<<<<<< HEAD
//
// SceneDelegate.swift
// TabBar(in code)
//
// Created by 순진이 on 2021/12/09.
//
=======
```swift
>>>>>>> 6f155fc0edb4320569832496d0e2cf55e77c3276
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let scene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: scene.coordinateSpace.bounds)
window?.windowScene = scene
let tabBarVC = UITabBarController()
let fisrtVC = FirstViewController()
let secondVC = SecondViewController()
let nav1 = UINavigationController(rootViewController: fisrtVC)
let nav2 = UINavigationController(rootViewController: secondVC)
nav1.tabBarItem = UITabBarItem(title: "First", image: UIImage(systemName: "pencil"), tag: 0)
nav1.navigationBar.topItem?.title = "First VC"
//nav1.navigationItem.title = "Test"
nav2.tabBarItem = UITabBarItem(title: "Second", image: UIImage(systemName: "folder"), tag: 1)
nav2.navigationBar.topItem?.title = "Second VC"
//tabBarVC.viewControllers = [nav1, nav2]
tabBarVC.setViewControllers([nav1, nav2], animated: true)
window?.rootViewController = tabBarVC
window?.makeKeyAndVisible()
}