func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
let navigationContoller = UINavigationController(rootViewController: ViewController())
window?.rootViewController = navigationContoller
window?.makeKeyAndVisible()
}
SceneDelegate
에 scene
함수를 이거로 수정하면 끝!
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
title = "text"
navigationController?.navigationBar.titleTextAttributes = [
NSAttributedString.Key.font : UIFont.systemFont(ofSize: 30, weight: .bold),
NSAttributedString.Key.foregroundColor : UIColor.white
]
}
}
viewDidLoad
에서 간단하게 navigationController
설정해주고
짜잔 잘 나온다.