ํ๋ก์ ํธ ์งํ ๊ฐ Storyboard๋ฅผ ์ ๊ฑฐํ๊ณ Code๋ก๋ง UI๋ฅผ ๊ตฌ์ฑํด๋ณด๊ฒ ๋์๋๋ฐ,
์ด๋ฅผ ์ํด ํ์ํ ์ธํ ์ ๊ธฐ๋กํด๋๊ณ ์ ํฉ๋๋ค.
โ 1. Main Storyboard ์ญ์
ํ๋ก์ ํธ์์ Storyboard๋ฅผ ์ ๊ฑฐํ๋ ๊ฒ์ด ๋ชฉํ์ด๊ธฐ ๋๋ฌธ์ ์ฐ์ Main Storyboard๋ฅผ ์ญ์ ํด์ค๋๋ค.
โ 2. Project TARGETS
Project TARGETS
-> Build Settings
-> filter์ "main" ๊ฒ์
-> UIKit Main Storyboard File Base Name ์ญ์
โ 3. Info.plist ์์
Info.plist
-> Scene Configuration
-> Application Session Role
-> Item 0
-> Storyboard Name ์ญ์
โ 4. SceneDelegate ์ฝ๋ ์์ฑ
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
}
๊ฐ์ฅ ์ฒซ ํ๋ฉด์ธ Main Storyboard๋ฅผ ์ญ์ ํ๊ธฐ ๋๋ฌธ์, ์ฒซ ViewController๋ฅผ ์ฝ๋๋ก์จ ์ง์ ์ง์ ํด์ฃผ์ด์ผ ํฉ๋๋ค.
๊ทธ๋์ ๋ง์ฝ NavigationController๋ TabBarController๋ฅผ rootViewController๋ก ๊ฐ์ง๊ณ ์ถ๋ค๋ฉด ์ด ๋ถ๋ถ์์ ์ง์ ํด์ฃผ์ด์ผ ํฉ๋๋ค.
โ 5. ์ธํ ํ์ธ
ViewController์ backgroundColor๋ฅผ ๋ณ๊ฒฝํด ํ๋ฉด์ด ์ ๋๋ก ๋์ค๋์ง ํ์ธํด๋ณด๋ฉด ์ ์ ์ฉ๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค!