ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Review of Connect the UI to Code (2) - Food Tracker
    iOS/๐Ÿค– App 2021. 1. 19. 00:25

    Define an Action to Perform

    iOS ์•ฑ์€  ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ( event-driven programming ) ๊ธฐ๋ฐ˜์ž…๋‹ˆ๋‹ค.

     

    ์ด๊ฒƒ์€ ์•ฑ์˜ ์‹คํ–‰ ํ๋ฆ„์ด ์ด๋ฒคํŠธ์— ์˜ํ•ด ์ •ํ•ด์ง„๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค.

     

    ์ด๋ฒคํŠธ์—๋Š” ์‹œ์Šคํ…œ์ด ๋ฐœ์ƒ์‹œํ‚ค๋Š” ์ด๋ฒคํŠธ(system events)์™€ ์•ฑ ์‚ฌ์šฉ์ž๊ฐ€ ๋ฐœ์ƒ์‹œํ‚ค๋Š” action ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

     

    ์‚ฌ์šฉ์ž๊ฐ€ UI๋ฅผ ํ†ตํ•ด ์‹คํ–‰์‹œํ‚จ Action์ด ์•ฑ ๋‚ด ์ด๋ฒคํŠธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.

     

    " The user performs actions in the interface that trigger events in the app "

     

    ์ฆ‰, ์•ฑ์˜ ์ฝ”๋“œ ์กฐ๊ฐ์ด ์‹คํ–‰๋˜๋Š” ์‹œ๊ธฐ๋ฅผ ์‚ฌ์šฉ์ž๊ฐ€ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    action ์ฆ‰ action method๋Š” ์•ฑ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์ด๋ฒคํŠธ์™€ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ๋Š” ์ฝ”๋“œ ์กฐ๊ฐ์ž…๋‹ˆ๋‹ค.

     

    ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ์‹œ์Šคํ…œ์€ ์ฝ”๋“œ ์กฐ๊ฐ์„ ์‹คํ–‰์‹œํ‚ต๋‹ˆ๋‹ค.

     

    ์ด๋ฒคํŠธ์™€ ์—ฐ๊ฒฐ๋œ ์ฝ”๋“œ๋ฅผ ์ด์šฉํ•ด์„œ ๊ฐœ๋ฐœ์ž๋Š” ์•ฑ์˜ flow (์‹คํ–‰ ํ๋ฆ„)์„ ๊ฐ„์ ‘์ ์œผ๋กœ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

     

    ์„ค์ • ๋ฐฉ๋ฒ•

     

    ์ด์ „ ๊ธ€์˜ outlet ๊ณผ ๊ฐ™์ด, ์ปจํŠธ๋กค์„ ๋ˆ„๋ฅธ ์ƒํƒœ๋กœ ์›ํ•˜๋Š” ๋ทฐ๋ฅผ View Controller๋ฅผ ๋“œ๋ž˜๊ทธ & ๋“œ๋กญํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

     

    ์ด ๋™์ž‘์„ ํ†ตํ•ด  @IBAction func๋ผ๋Š” ํ‚ค์›Œ๋“œ๋กœ ์‹œ์ž‘ํ•˜๋Š” ๋ฉ”์„œ๋“œ๋ฅผ ์ƒ์„ฑํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

     

     

     Outlet ์—์„œ์™€ ๋‹ค๋ฅธ ๋ถ€๋ถ„์€ Connection ์ด `Outlet` ์ด ์•„๋‹Œ `Action`์œผ๋กœ ์„ ํƒํ•˜์˜€๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค.

     

    ๋˜ํ•œ ์‚ฌ์ง„ ์ƒ์—์„œ Type์„ `Any`๋กœ ํ•˜์˜€์ง€๋งŒ, View Controller ํŒŒ์ผ๋งŒ ๋ณด๊ณ  ์–ด๋–ค ํƒ€์ž…์˜ ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ํ˜ธ์ถœํ•˜๋Š” ๋ฉ”์„œ๋“œ์ธ์ง€ ์•Œ๊ธฐ ์œ„ํ•ด์„œ๋Š” `UIButton`์œผ๋กœ ํŠน์ •ํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋…์„ฑ ์ธก๋ฉด์—์„œ ๋‚ซ๋‹ค๊ณ  ์ƒ๊ฐ๋ฉ๋‹ˆ๋‹ค.

     

    ์ถ”๊ฐ€์ ์œผ๋กœ `Touch Up Inside` ๋Š” ์ด๋ฒคํŠธ์˜ ์ข…๋ฅ˜๋กœ์„œ, ์ผ๋ฐ˜์ ์œผ๋กœ ์ƒ๊ฐํ•˜๋Š” ํƒญ ๋™์ž‘์— ๋ฐœ์ƒํ•˜๋Š” ์ด๋ฒคํŠธ์ž…๋‹ˆ๋‹ค.

     

    ์—„๋ฐ€ํžˆ ์ด์•ผ๊ธฐํ•˜๊ธฐ ์œ„ํ•ด `Touch Up Outside` ์ด๋ฒคํŠธ์™€ ๋น„๊ตํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

     

    ์‚ฌ์šฉ์ž์˜ ๋™์ž‘์„ ์ผ๋‹จ Touch์™€ Up์œผ๋กœ ๋ถ„๋ฆฌํ•ด์„œ ์ƒ๊ฐํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

     

    ๋ง ๊ทธ๋Œ€๋กœ 1. (์†๊ฐ€๋ฝ์œผ๋กœ) ํ„ฐ์น˜ํ•˜๋Š” ๋™์ž‘๊ณผ 2. (์†๊ฐ€๋ฝ์„) ๋–ผ๋Š” ๋™์ž‘์œผ๋กœ ๊ตฌ๋ถ„ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

     

    Touch Up Inside ๋Š” ๋ทฐ๋ฅผ ํ„ฐ์น˜ํ•˜๊ณ  ์žˆ๋Š” ์ƒํƒœ์—์„œ ํ•ด๋‹น ๋ทฐ์˜ ๋ฐ”์šด๋”๋ฆฌ ๋‚ด(Inside)์—์„œ ์†๊ฐ€๋ฝ์„ ๋–ผ๋ฉด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

     

    ์ผ๋ฐ˜์ ์ธ ํƒญ ๋™์ž‘์ด๋ผ๊ณ  ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    Touch Up Outside ๋Š” ๋ทฐ๋ฅผ ํ„ฐ์น˜ํ•˜๊ณ  ์žˆ๋Š” ์ƒํƒœ์—์„œ ๋“œ๋ž˜๊ทธํ•œ ์ฑ„๋กœ ์ด๋™ํ•˜์—ฌ ๋ทฐ์˜ ๋ฐ”์šด๋”๋ฆฌ ๋ฐ”๊นฅ(Outside)์—์„œ ์†๊ฐ€๋ฝ์„ ๋–ผ๋ฉด ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

     

    ์ €๋Š” ๋ณดํ†ต ๋ฒ„ํŠผ์„ ์ž˜๋ชป ๋ˆŒ๋ €์„ ๋•Œ ์ด ๋™์ž‘์„ ํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

    ๋ฒ„ํŠผ์„ ํ„ฐ์น˜ํ•˜๊ณ  ์žˆ๋Š” ์ƒํƒœ์—์„œ ๋–ผ์ง€ ์•Š๊ณ  ์†๊ฐ€๋ฝ์„ ๋Œ์–ด์„œ ๋‹ค๋ฅธ ๊ณณ์—์„œ ๋–ผ๋ฉด, ํ•ด๋‹น ์ด๋ฒคํŠธ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฉ”์„œ๋“œ๋ฅผ ๋ณดํ†ต ๊ตฌํ˜„ํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ` ์ทจ์†Œ` ์™€ ์œ ์‚ฌํ•œ ๊ฒฐ๊ณผ๋ฅผ ๊ธฐ๋Œ€ํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

     

     

    ์™„์„ฑํ•œ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

      @IBAction func setDefaultLabelText(_ sender: UIButton) {
        
        mealNameLabel.text = "Default Text"
      }

     

    UIButton ์˜ค๋ธŒ์ ํŠธ์—์„œ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด, setDefaultLabelText(_:) ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋˜๊ณ , Outlet์œผ๋กœ ์—ฐ๊ฒฐ๋œ mealNameLable์˜ text ์†์„ฑ์ด ๋ฐ”๋€Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

     

    ๋ทฐ์—์„œ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ์‹œ์Šคํ…œ์ด action method๋ฅผ ํ˜ธ์ถœํ•˜๊ณ  sender ์˜ค๋ธŒ์ ํŠธ(์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•œ ๋ทฐ)๋ฅผ ๋ณด๋ƒ„์œผ๋กœ์จ ๋ฉ”์‹œ์ง€๋ฅผ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.

     

    ์ด๊ฒƒ์„  iOS์—์„œ๋Š” target-action pattern์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

     

    " Target-action is a design pattern where one object sends a message to another object when a specific event occurs. "

     

    ์—ฌ๊ธฐ์„œ setDefaultLabelText(_:)์˜ ํŒŒ๋ผ๋ฏธํ„ฐ sender๋Š” ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•œ UIButton ์˜ค๋ธŒ์ ํŠธ์ž…๋‹ˆ๋‹ค.


     

    Process User Input

     

    UITextfield์— ์ž…๋ ฅํ•œ ๋‚ด์šฉ์„ Return ํ‚ค๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ UILabel์— ๋ฐ˜์˜ํ•˜๊ณ  ์‹ถ์€ ์ƒํ™ฉ์ž…๋‹ˆ๋‹ค.

    ์—ฌ๊ธฐ์„œ Text Field์˜ delegate๋ฅผ View Controller๋กœ ์„ค์ •ํ•ด์ค๋‹ˆ๋‹ค.

     

    Delegate๋ž€ ์–ด๋–ค ํ–‰๋™์„ `๋Œ€์‹  ์ˆ˜ํ–‰ํ•ด์ฃผ๋Š”` ๊ฐ์ฒด์ž…๋‹ˆ๋‹ค.

     

    ์šฉ์–ด ์ •๋ฆฌ๋ฅผ ํ•˜๋ฉด ์—ฌ๊ธฐ์„œ Text Field๋Š” `delegating object` ๊ฐ€ ๋˜๊ณ , View Controller๋Š” `delegate` ์ด ๋ฉ๋‹ˆ๋‹ค.

     

    Delegating object๋Š” delegate์˜ ์ฐธ์กฐ๋ฅผ ๊ณ„์† ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉด์„œ, ํ•„์š”ํ•œ ๋•Œ์— delegate์—๊ฒŒ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋ƒ…๋‹ˆ๋‹ค.

     

    ๋ฉ”์‹œ์ง€์—๋Š” delegating object๊ฐ€ ๋‹ค๋ฃจ๊ฑฐ๋‚˜ ๋‹ค๋ฃจ๋ ค๊ณ  ํ•˜๋Š” ์ด๋ฒคํŠธ์— ๋Œ€ํ•œ ๋‚ด์šฉ์ด ๋“ค์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

     

    Delagate๋Š” ์ด ๋ฉ”์‹œ์ง€์— ๋งž๊ฒŒ ๋ฐ˜์‘ํ•ฉ๋‹ˆ๋‹ค. 

     

    ์˜ˆ๋ฅผ ๋“ค๋ฉด 1. ์ž์‹ ์ด๋‚˜ ๋‹ค๋ฅธ ๋ทฐ์˜ ์ƒํƒœ๋ฅผ ๋ฐ”๊พผ๋‹ค๋˜๊ฐ€, 2. ์ด๋ฒคํŠธ๋ฅผ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ–ˆ๋Š”์ง€์— ๋Œ€ํ•œ ๊ฐ’์„ ๋ฆฌํ„ดํ•ฉ๋‹ˆ๋‹ค.

     

    Text Field์˜ delegate ๋Š” Text Field ๊ฐ€ text๋ฅผ ์ˆ˜์ •ํ•˜๊ณ  ์žˆ๋Š” ๋™์•ˆ  Text Field์™€ ์†Œํ†ตํ•˜๊ณ , ์ค‘์š”ํ•œ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ์•Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

     

    ์—ฌ๊ธฐ์„œ๋Š” ์‚ฌ์šฉ์ž๊ฐ€ text ์ˆ˜์ •์„ ์‹œ์ž‘ํ•˜๊ฑฐ๋‚˜ ๋งˆ์ณค์„ ๋•Œ ๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

     

    ์–ด๋–ค ๊ฐ์ฒด์˜ Delegate๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ ์ ˆํ•œ protocol์„ ์ฑ„ํƒํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

     

    ๊ด€๋ จ ๊ธ€: Protocol Overview, Delegate Pattern

     

    text field์˜ delegate ์ด ๋˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ ํ”„๋กœํ† ์ฝœ์€ UITextFieldDelegate์ž…๋‹ˆ๋‹ค.

     

     ๋ณดํ†ต ์ž์‹ ์„ ๊ด€๋ฆฌํ•˜๊ณ  ์žˆ๋Š” View Controller๋ฅผ delegate๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

     

    ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ํฌ๊ฒŒ 2๊ฐ€์ง€๊ฐ€ ์žˆ๋Š”๋ฐ, ์œ„์˜ ๊ด€๋ จ ๊ธ€์— ์ ์—ˆ์œผ๋ฏ€๋กœ ์ƒ๋žตํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

     

    extension ViewController: UITextFieldDelegate {
      
      func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        // code
      }
      
      func textFieldDidEndEditing(_ textField: UITextField) {
        // code
      }
      
    }
    

     

    Delegate Protocol์„  extension ๋ฌธ๋ฒ•์„ ํ†ตํ•ด adopt ํ•œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.

     

    ์ด ํ”„๋กœํ† ์ฝœ์€ ํ•„์ˆ˜์ ์œผ๋กœ ๊ตฌํ˜„ํ•ด์•ผ ๋ฉ”์„œ๋“œ๊ฐ€ ๋”ฐ๋กœ ์—†์œผ๋ฏ€๋กœ, ์šฉ๋„์— ๋งž๋Š” ๋ฉ”์„œ๋“œ ๋‘ ๊ฐ€์ง€๋งŒ ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

     

    ๊ด€๋ จ ๊ธ€: UITextFieldDelegate - Apple Developer Documentation

     

    UIKit์˜ API ์ž‘๋ช… ๋ฐฉ์‹์€ ์ผ์ฒด๊ฐ์ด ์žˆ์–ด์„œ ์ฐธ ์ข‹์Šต๋‹ˆ๋‹ค.

     

    Should, Did, Will๊ณผ ๊ฐ™์€ ๋™์‚ฌ๋ฅผ ๋ฉ”์„œ๋“œ ๋ช…์— ๋„ฃ์–ด์„œ ํ˜ธ์ถœ ์‹œ์ ์„ ์œ ์ถ”ํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

    ๋ฌผ๋ก  ์ •ํ™•ํ•œ ํ˜ธ์ถœ ์‹œ์ ์˜ ํ™•์ธ์€ Documentation์ด๋‚˜ Xcode ๊ฐ€ ์ œ๊ณตํ•˜๋Š” Quick help๋ฅผ ํ†ตํ•˜์—ฌ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

     

    ๋”ฐ๋ผ์„œ textFieldShouldReturn(_:) ๋ฉ”์„œ๋“œ๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์ด๋ฏธ Return ํ‚ค๋ฅผ ํƒญ ํ–ˆ๊ณ , ์ด๊ฒƒ์„ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์ง์ „์— ํ˜ธ์ถœ๋˜๋Š” ๋ฉ”์„œ๋“œ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

     

    First Responder

    ์‚ฌ์šฉ์ž๊ฐ€ Text Field๋ฅผ ํƒญ ํ•  ๋•Œ, ์ด๊ฒƒ์ด first responder ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. 

     

    ์•ฑ์—์„œ first responder๋Š” ์ตœ์ผ์„ ์—์„œ ์•ฑ ์ด๋ฒคํŠธ๋ฅผ ๋ฐ›๋Š” ๊ฐ์ฒด์ž…๋‹ˆ๋‹ค. (ํ‚ค ์ด๋ฒคํŠธ, ๋ชจ์…˜ ์ด๋ฒคํŠธ, action ๋ฉ”์‹œ์ง€ ๋“ฑ)

     

    ์ฆ‰, ์‚ฌ์šฉ์ž์— ์˜ํ•ด ์„ฑ์„ฑ๋œ ์ด๋ฒคํŠธ๋“ค์€ first responder๊ฐ€ ์ฒซ ๋ฒˆ์งธ๋กœ ๋ฐ›๋„๋ก routing ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

     

     Text Field๊ฐ€ first responder๊ฐ€ ๋˜๋ฉด, iOS๋Š” ํ™”๋ฉด์— ํ‚ค๋ณด๋“œ๋ฅผ ๋„์›Œ์ฃผ๊ณ , Text Field๋ฅผ ์œ„ํ•œ ์ˆ˜์ • ์„ธ์…˜ (editing session)์„ ์—ฝ๋‹ˆ๋‹ค.

     

    ์‚ฌ์šฉ์ž๊ฐ€ ํ‚ค๋ณด๋“œ๋กœ ์ž…๋ ฅํ•˜๋Š” ๊ฒƒ๋“ค์ด Text Field์— ์ฑ„์›Œ์ง€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

     

    ์‚ฌ์šฉ์ž๊ฐ€ Text Field ์ˆ˜์ •์„ ๋๋‚ด๊ณ  ์‹ถ์„ ๋•Œ, Text Field๋Š” first responder๋ฅผ ๊ทธ๋งŒ๋‘์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

     

    ์ˆ˜์ •์„ ๋๋‚ด๋ฉด Text Field๋Š” ๋” ์ด์ƒ active ๊ฐ์ฒด๊ฐ€ ๋  ํ•„์š”๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. (๋” ์ด์ƒ ์ด๋ฒคํŠธ๋ฅผ ๋ฐ›์•„์„œ ์ฒ˜๋ฆฌํ•  ํ•„์š”๊ฐ€)

     

    ์ด๋•Œ๋Š” ๋‹ค๋ฅธ ์ ์ ˆํ•œ ๊ฐ์ฒด๊ฐ€ first responder๊ฐ€ ๋˜๋Š” ๊ฒƒ์ด ๋งž์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

     

     

    extension ViewController: UITextFieldDelegate {
      
      func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        
        // Hide the keyboard.
        textField.resignFirstResponder()
        return true
      }
      
      func textFieldDidEndEditing(_ textField: UITextField) {
        mealNameLabel.text = textField.text
      }
      
    }

     

    Text Field ๊ฐ€  ๋” ์ด์ƒ fisrt responder๊ฐ€ ์•„๋‹ˆ๊ฒŒ ๋˜๋ฉด, textFieldDidEndEditing(_:) ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค.

     

    ๊ด€๋ จ ๊ธ€: Bool ์„ ๋ฐ˜ํ™˜ํ•˜๋Š” Delegate Method

     

     

    //MARK: ์˜ ์‚ฌ์šฉ

    ์ฃผ์„์œผ๋กœ //MARK: Properties์™€ ๊ฐ™์€ ๋ฌธ๊ตฌ๋ฅผ ์ถ”๊ฐ€ํ•ด๋‘๋ฉด, ์ฝ”๋“œ๊ฐ€ ๊ธธ์–ด์ง€๋Š” ์ƒํ™ฉ์—์„œ ์‰ฝ๊ฒŒ ํ•ด๋‹น ์œ„์น˜๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

     

    XCode๊ฐ€ Functions menu์—์„œ // MARK: ์ฃผ์„์„ ์ธ์‹ํ•ด์„œ ๋ณด์—ฌ์ฃผ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

     

     

     

    ๋!


     

    ๋‹ค์Œ ๊ธ€: Review of Work with View Controllers (1) - Food Tracker

     

    Review of Work with View Controllers (1) - Food Tracker

    Understand the View Controller Lifecycle ํ•˜๋‚˜์˜ ์”ฌ๋ณด๋‹ค ๋” ๋งŽ์€ ์”ฌ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋ณต์žกํ•œ ์•ฑ์—์„œ, ์šฐ๋ฆฌ๋Š” ํ™”๋ฉด์ด ์ด๋™ํ•จ์— ๋”ฐ๋ผ view๋ฅผ ๋„์šฐ๊ณ  ๋‚ด๋ฆฌ๋Š” ( loading and unloading ) ์ž‘์—…์„ ๋‹ค๋ฃจ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. UIVi..

    woozzang.tistory.com

     

    ๋Œ“๊ธ€

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