ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Review of Build a Basic UI - Food Tracker
    iOS/๐Ÿค– App 2021. 1. 18. 17:01

    ์‚ฌ์†Œํ•˜๋”๋ผ๋„ ์ƒˆ๋กœ ์•Œ๊ฒŒ ๋œ ์ ์„ ์ ๊ณ , ๋ณต์Šต ์ฐจ์›์—์„œ ์ค‘์š”ํ•œ ์ ์„ ๋˜์งš์–ด ๋ณด๊ณ  ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค.

     

    ํŠนํžˆ ์šฉ์–ด๋“ค๊ณผ ๊ทธ ์šฉ์–ด๋“ค์— ๋Œ€ํ•œ ๊ฐœ๋…์„ ๋†“์น˜์ง€ ์•Š๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

     

    ๊ณต์‹ ๋ฌธ์„œ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์šฉ์–ด๋ฅผ ์•„๋Š” ๊ฒƒ์€ ์†Œํ†ต์— ์žˆ์–ด์„œ ์•„์ฃผ์•„์ฃผ critical ํ•œ factor๋ผ๊ณ  ์ƒ๊ฐํ•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.


     

    Project navigator

    Navigator selector bar ์ค‘์— ๊ฐ€์žฅ ์™ผ์ชฝ์— ์œ„์น˜ํ•œ navigator๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ํŒŒ์ผ ์ „์ฒด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

     


     

    The App Delegate Source File

    #์•ฑ ์ƒํƒœ๋ณ€ํ™” ์ฒ˜๋ฆฌ #์•ฑ ๋ ˆ๋ฒจ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ #์•ฑ ์ƒ๋ช…์ฃผ๊ธฐ ๊ด€๋ฆฌ

     

    `system`์ด๋ผ๋Š” ์šฉ์–ด๊ฐ€ ๋“ฑ์žฅํ•ฉ๋‹ˆ๋‹ค.

    ์•ฑ์„ ๊ตฌ๋™ํ•˜๋Š” OS ๋ผ๊ณ  ์ƒ๊ฐํ•˜๊ณ  ๊ธ€์„ ์ž‘์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.

     

    AppDelegate.swift ํŒŒ์ผ์€ ๋‘ ๊ฐ€์ง€ ์ฃผ์š” ๊ธฐ๋Šฅ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

     

    1. AppDelegate ํด๋ž˜์Šค๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. App Delegate๋Š” window๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. Window๋Š” ์•ฑ์˜ ์ฝ˜ํ…์ธ ๊ฐ€ ๊ทธ๋ ค์ง€๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค. App Delegate๋Š” ๋˜ํ•œ ์•ฑ์˜ ์ƒํƒœ๋ณ€ํ™”์— ๋Œ€์‘ํ•  ๊ณต๊ฐ„์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

     

    2. ์•ฑ์˜ entry point ๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ์•ฑ์— ์ด๋ฒคํŠธ๋ฅผ ์ „๋‹ฌํ•ด์ฃผ๋Š” run loop์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ด ๋™์ž‘์€ UIApplicationMain ์†์„ฑ (@main)์— ์˜ํ•ด ํ–‰ํ•ด์ง‘๋‹ˆ๋‹ค.

     

    @main attribute

     

    @๊ฐ€ ์•ž์— ๋ถ™์€ ํ‚ค์›Œ๋“œ๋“ค์„ attribute๋ผ๊ณ  ๋ถ€๋ฆ…๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋”ฐ๋กœ ๊ธ€์„ ๋‹ค๋ฃจ์–ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

     

    " Using the UIApplicationMainattribute is equivalent to calling the UIApplicationMain function and passing your AppDelegateclass’s name as the name of the delegate class. " - developer.apple.com

    UIApplication์ด๋ผ๋Š” ํ•จ์ˆ˜๊ฐ€ ์žˆ๊ณ  ์ด ํ•จ์ˆ˜๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์•ฑ์˜ delegate๋ฅผ ๋ฐ›๋Š”๋ฐ, @main์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์€ delegate ๋กœ AppDelegate๋ฅผ ์ „๋‹ฌํ•˜๋ฉด์„œ UiApplication ์ด๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™๋‹ค๊ณ  ๋งํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ๊ทธ ํ˜ธ์ถœ์— ๋Œ€ํ•œ ๋Œ€๋‹ต์œผ๋กœ ์‹œ์Šคํ…œ์€ application object๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

     

    ์ด Application object๋Š” ์•ฑ์˜ ์ƒ๋ช… ์ฃผ๊ธฐ ๊ด€๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค.

     

    ์‹œ์Šคํ…œ์€ ๋˜ํ•œ AppDelegate ํด๋ž˜์Šค์˜ ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•˜๋Š”๋ฐ, ์ด๊ฒƒ์„ Application object์— ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„ ์‹œ์Šคํ…œ์ด ์•ฑ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

     

    AppDelegate ํด๋ž˜์Šค๋Š” ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒˆ๋กœ์ƒ์„ฑํ•˜๋ฉด ์ž๋™์ ์œผ๋กœ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

     

    ์ผ๋ฐ˜์ ์ด์ง€ ์•Š์€ ์ž‘์—…์„ ํ• ๋•Œ๋„, ์šฐ๋ฆฌ๋Š” ๋ฐ˜๋“œ์‹œ Xcode๊ฐ€ ์ œ๊ณตํ•œ ์ด ํด๋ž˜์Šค๋ฅผ ์ด์šฉํ•˜์—ฌ ์•ฑ์„ ์ดˆ๊ธฐํ™”ํ•˜๊ณ  app-level ์ด๋ฒคํŠธ๋ฅผ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

     

    AppDelegate ํด๋ž˜์Šค๋Š” UIApplicationDelegate ํ”„๋กœํ† ์ฝœ์„ ์ฑ„์šฉํ•ฉ๋‹ˆ๋‹ค.

     

    ๊ทธ๋Ÿฌ๋ฏ€๋กœ ์•ฑ (Application Object)์˜  Delegate๋Š”  AppDelegate ํด๋ž˜์Šค์ž…๋‹ˆ๋‹ค.

     

    ์ด ํ”„๋กœํ† ์ฝœ์—๋Š” ์•ฑ์„ set up ํ•˜๊ณ , ์•ฑ์˜ ์ƒํƒœ์˜ ๋ณ€ํ™”์— ๋Œ€์‘ํ•˜๊ณ , ๋‹ค๋ฅธ app-level ์ด๋ฒคํŠธ๋ฅผ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋Š” ๋‹ค์–‘ํ•œ ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

     

    AppDelegate ํด๋ž˜์Šค๋Š” `window`๋ผ๋Š” ์ด๋ฆ„์˜ ํ”„๋กœํผํ‹ฐ๋ฅผ ํ•˜๋‚˜ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

    App Deleagate๋Š” window๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. Window๋Š” ์•ฑ์˜ ์ฝ˜ํ…์ธ ๊ฐ€ ๊ทธ๋ ค์ง€๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค.

    ์ด ์†์„ฑ์— ์•ฑ์˜ window์˜ ์ฐธ์กฐ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์ด window๋Š” ์•ฑ์˜ ๋ทฐ ๊ณ„์ธต์˜ ๋ฃจํŠธ์ž…๋‹ˆ๋‹ค.

     

    ์ด๊ณณ์ด ์•ฑ ๋‚ด์˜ ๋ชจ๋“  ์ฝ˜ํ…์ธ ๊ฐ€ ๊ทธ๋ ค์ง€๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค.

     

    ๊ทธ๋Ÿฐ๋ฐ ์ด ๊ธ€์„ ์ž‘์„ฑํ•˜๋Š” ์‹œ์ ์—์„œ๋Š” SceneDelgate๊ฐ€ window๋ผ๋Š” ํ”„๋กœํผํ‹ฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

    ์ผ๋‹จ ์ด ๋ถ€๋ถ„์€ ๋„˜์–ด๊ฐ€๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

     

    ์˜ต์…”๋„ ํƒ€์ž…์˜ window. ํŠน์ • ์‹œ์ ์—๋Š” nil์ด ๋“ค์–ด์žˆ๋‹ค.

     

    AppDelegate ํด๋ž˜์Šค๊ฐ€ ์ œ๊ณตํ•˜๋Š” (์—„๋ฐ€ํžˆ ๋งํ•˜๋ฉด ๊ทธ๊ฒƒ์ด ์ฑ„์šฉํ•œ ํ”„๋กœํ† ์ฝœ์˜ ์š”๊ตฌ์‚ฌํ•ญ์„ ๊ตฌํ˜„ํ•œ) ๋ฉ”์„œ๋“œ๋“ค์€ ์—ฌ๋Ÿฌ ๊ฐ€์ง€์ด๊ณ ,

     

    Documentation์— ๋ฉ”์„œ๋“œ๋“ค์˜ ์‚ฌ์šฉ๋ฐฉ๋ฒ•์ด ์ ํ˜€ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ์ด  Food Tracker ์•ฑ์˜ ๊ธฐ๋Šฅ์ƒ  AppDelegate.swift ํŒŒ์ผ์„ ์ˆ˜์ •ํ•  ์ผ์€ ์—†์Šต๋‹ˆ๋‹ค.

     

    ์ดํ›„์— Note ์•ฑ์—์„œ ์ˆ˜์ •ํ•ด๋ณผ ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.


     

    The View Controller Source File

    ํ”„๋กœ์ ํŠธ๋ฅผ ์ฒ˜์Œ ์ƒ์„ฑํ•˜์˜€์„ ๋•Œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ƒ์„ฑ๋˜๋Š” ํŒŒ์ผ์ž…๋‹ˆ๋‹ค.

     

    ์•„๋ฌด ์ž‘์—…๋„ ํ•˜์ง€ ์•Š๊ณ  ๋นŒ๋“œ ์•ค ๋Ÿฐ ํ•˜์˜€์„ ๋•Œ ๋ณด์ด๋Š” ๋น„์–ด์žˆ๋Š” ํฐ์ƒ‰ ์”ฌ(Scene)๊ณผ ์—ฐ๊ฒฐ๋˜์–ด์žˆ๋Š” View controller์ž…๋‹ˆ๋‹ค.

     

    ์ดํ›„์— ์Šคํ† ๋ฆฌ๋ณด๋“œ์— ์ถ”๊ฐ€ํ•˜๋Š” ์”ฌ ๋“ค์— ์—ฐ๊ฒฐํ•  VC๋“ค์€ ๋ชจ๋‘ UIViewController ํด๋ž˜์Šค๋ฅผ ์„œ๋ธŒ ํด๋ž˜์‹ฑ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ์ด ํด๋ž˜์Šค๋“ค์˜ ๊ตฌํ˜„์—์„œ custom ํ•œ ๋™์ž‘๋“ค๊ณผ ์ž๋ฃŒ๊ตฌ์กฐ๋“ค์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.


     

    Open Your Storyboard

     

    ์Šคํ† ๋ฆฌ๋ณด๋“œ๋Š” `. storyboard`๋ผ๋Š” ํ™•์žฅ์ž๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ์Šคํ† ๋ฆฌ๋ณด๋“œ๋ฅผ ํ†ตํ•ด์„œ UI element๋ฅผ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ถ”๊ฐ€ํ•˜๊ณ  ์›ํ•˜๋Š” ์œ„์น˜์— ๋ฐฐ์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    Xcode๋Š” ์Šคํ† ๋ฆฌ๋ณด๋“œ ํŒŒ์ผ์„  Interface Builder๋ผ๋Š” ์—๋””ํ„ฐ๋กœ ์—ฝ๋‹ˆ๋‹ค.

     

    ์”ฌ (Scene) ์ด๋ž€, ์•ฑ์—์„œ ์ฝ˜ํ…์ธ ๋ฅผ ๋‹ด๊ณ  ์žˆ๋Š” ํ•˜๋‚˜์˜ ํ™”๋ฉด์„ ์Šคํ† ๋ฆฌ๋ณด๋“œ ๋ฐฉ์‹์œผ๋กœ ํ‘œํ˜„ํ•œ ์šฉ์–ด ์ž…๋‹ˆ๋‹ค.

     

    ํ•˜๋‚˜์˜ ์”ฌ์€ ํ•˜๋‚˜์˜ UIViewcontroller ์ปค์Šคํ…€ ํด๋ž˜์Šค์™€ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ์ด ์บ”๋ฒ„์Šค์—์„œ ๋ณด์—ฌ์ฃผ๋Š” ํ™”๋ฉด์€ ํŠน์ • ๊ธฐ๊ธฐ์—์„œ ๋ณด์ด๋Š” ํ™”๋ฉด์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

     

    ๊ธฐ๊ธฐ์— ๋”ฐ๋ผ ๋ณด์ด๋Š” ํ™”๋ฉด์ด ๋ฐ”๋€” ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์—, Adaptive ํ•œ interface๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.

     

    " an interface that automatically adjusts so that it looks good on any device and in any orientation. "
    ๋‹ค๋ฅธ ๋ฌธ์„œ๋“ค์—์„œ๋„ ์• ํ”Œ์€ ๋‹ค๋ฅธ ํ™”๋ฉด ํฌ๊ธฐ๋ฅผ ๊ฐ€์ง„ ๊ธฐ๊ธฐ๋“ค์„ ๋ชจ๋‘ ์ง€์›ํ•œ๋‹ค๋Š” ์˜๋ฏธ์—์„œ Adaptive๋ผ๋Š” ์šฉ์–ด๋ฅผ ์ž์ฃผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

     

    ํ•˜๋‚˜์˜ ์”ฌ ๊ณผ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š” Custom Class (ViewController)

    ์‚ฌ์ง„์— ๋Œ€ํ•œ ์„ค๋ช…

    ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์–ด๋– ํ•œ ์ฝ”๋“œ ์ž‘์—…์„ ํ•˜์ง€ ์•Š๊ณ  Main.storyboard๋ฅผ ์—ด๋ฉด ์™ผ์ชฝ ์‚ฌ์ง„๊ณผ ๊ฐ™์ด canvas ์œ„์— ํ•˜๋‚˜์˜ ์”ฌ์ด ๋‚˜์˜ต๋‹ˆ๋‹ค.

     

    ์ด ์”ฌ์˜ file's owner๋ฅผ ํด๋ฆญํ•˜๋ฉด ํ™”๋ฉด์˜ ์˜ค๋ฅธ์ชฝ์— attribute inspector๊ฐ€ ๋‚˜์˜ค๋Š”๋ฐ, ์ด๊ณณ์—์„œ ์—ฐ๊ฒฐ๋œ Custom Class๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    file's owner๋Š” ํฐ์ƒ‰ ํ™”๋ฉด ์ƒ๋‹จ ์ง™์€ ํšŒ์ƒ‰์˜ ๋‘๊บผ์šด ๊ฐ€๋กœ ์ค„์„ ํด๋ฆญํ•˜๋ฉด ํŒŒ๋ž€์ƒ‰ ์‹ค์„ ์œผ๋กœ ํ•˜์ด๋ผ์ดํŒ… ๋˜๋Š” ๋ถ€๋ถ„์„ ๊ฐ€๋ฆฌํ‚ต๋‹ˆ๋‹ค. 

     

    ์—ฌ๊ธฐ์„œ ViewController ํด๋ž˜์Šค๋Š” UIViewController๋ฅผ ์„œ๋ธŒ ํด๋ž˜์‹ฑ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.


     

    Build the Basic UI

    ์ด ๋ถ€๋ถ„์€ ๋ณด๊ณ  ๋”ฐ๋ผ ํ•˜๋ฉด ๋˜๋Š” ๊ฐ„๋‹จํ•œ ๋‚ด์šฉ๋“ค์ž…๋‹ˆ๋‹ค. ๋”ฐ๋กœ ๋ฆฌ๋ทฐํ•  ๊ฒŒ ์—†๋‹ค๊ณ  ์ƒ๊ฐ๋ฉ๋‹ˆ๋‹ค.

     

    ์šฉ์–ด ์œ„์ฃผ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.

     

    ์”ฌ์— ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋Š” View ๋ชฉ๋ก๋“ค์„ ์ด๊ฒƒ์„ Object Library ๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

     

    ๋‹จ์ถ•ํ‚ค๋Š” ` shift + cmd + L ` ์ž…๋‹ˆ๋‹ค.

     

    Object Library

     

     

    View (ํ˜น์€ Control) ๋“ค์„ ๋“œ๋ž˜๊ทธํ•˜์—ฌ ์”ฌ๋‚ด์—์„œ ์ด๋ฆฌ์ €๋ฆฌ ์›€์ง์ด๋ฉด ๋ณด์ด๊ฒŒ ๋˜๋Š” ํŒŒ๋ž€์ƒ‰ ์ ์„ ๋“ค์„

    Layout Guides ๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

     

    The blue layout guides

     

    ์•„๋ž˜ ์‚ฌ์ง„์—์„œ ๋“ฑ์žฅํ•˜๋Š” ์„ธ ์ข…๋ฅ˜์˜ vertical layout guides์˜ ์ด๋ฆ„์€

    ์™ผ์ชฝ๋ถ€ํ„ฐ ๊ฐ๊ฐ the left margin alignment, the horizontal center alignment, the right margin alignment ์ž…๋‹ˆ๋‹ค.

     

     

     

     

    ์•„๋ž˜ ์‚ฌ์ง„์—์„œ ์™ผ์ชฝ์˜ Document outline์—์„œ๋Š” ์Šคํ† ๋ฆฌ๋ณด๋“œ ๋‚ด์˜ ์„ ํƒ๋œ ์”ฌ์—์„œ ๋ทฐ๋“ค์˜ ๊ณ„์ธต ๊ตฌ์กฐ์™€ Layout Constraints ๋“ฑ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ๊ด€๋ จ ๊ธ€: View Controller ์˜ ์—ญํ• 

     

    ๋˜ํ•œ ํ•˜์ด๋ผ์ดํŒ…๋œ ๋ถ€๋ถ„์ด ์„ ํƒ๋œ ์š”์†Œ์ž„์„ ๋‚˜ํƒ€๋‚ด๋Š”๋ฐ, ํ˜„์žฌ๋Š” View Controller์˜ Content view (ํ˜น์€ Root view) ์ธ `View` ๊ฐ€ ์„ ํƒ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ์„ ํƒ๋œ ๋ทฐ์˜ Configuration ์€ ํ™”๋ฉด ์˜ค๋ฅธ์ชฝ์˜ Inspector selector bar๋ฅผ ํ†ตํ•ด ์กฐ์ž‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ํ˜„์žฌ๋Š” Attributes inspector๊ฐ€ ์„ ํƒ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

    Main.storyboard ์„ ํƒ์‹œ ๋‚˜์˜ค๊ฒŒ ๋˜๋Š” ํ™”๋ฉด

     

    ์”ฌ์— UITextField View๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ํ•ด๋‹น View๋ฅผ ์„ ํƒํ• ์‹œ Attribute Inspector ์—์„œ ๋ณผ ์ˆ˜ ์žˆ๊ฒŒ ๋˜๋Š” ํ™”๋ฉด์ž…๋‹ˆ๋‹ค.

    Storyboard๋ฅผ ํ†ตํ•œ ์ž‘์—…์€ ์ฝ”๋“œ๋กœ์˜ ์ž‘์—…์„ ์ผ์ • ๋ถ€๋ถ„ ๋Œ€์ฒดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    Storyboard๋ฅผ ํ†ตํ•œ VIew Configuration

     

    ์ƒ๋žต๋œ ๋ถ€๋ถ„์€ ๊ด€๋ จ ๊ธ€๋กœ ๋”ฐ๋กœ ๊ฒŒ์‹œํ•˜์˜€์Šต๋‹ˆ๋‹ค.

    ๊ด€๋ จ ๊ธ€: UITextField ์˜ Return Key ์™€ Auto-enable Return Key

     

     

     

    ๋!


     

    ๋‹ค์Œ ๊ธ€: Connect the UI to the Code (1) - Food Tracker

     

    Connect the UI to the Code (1) - Food Tracker

    Connect the UI to Source Code ์Šคํ† ๋ฆฌ ๋ณด๋“œ์˜ ์š”์†Œ๋“ค ( Views ) ์€ ์†Œ์Šค ์ฝ”๋“œ์™€ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์Šคํ† ๋ฆฌ๋ณด๋“œ์—์„œ ํ•˜๋‚˜์˜ ์”ฌ (scene)์€ ์ฝ˜ํ…์ธ ๋กœ ์ด๋ฃจ์–ด์ง„ ํ•˜๋‚˜์˜ ํ™”๋ฉด์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ ๋ณดํ†ต ํ•˜๋‚˜์˜ View Controller

    woozzang.tistory.com

     

    ๋Œ“๊ธ€

์–ด์ œ๋ณด๋‹ค ๋ฐœ์ „ํ•œ ๋‚˜