Skip to content

27thONSOPT-iOS/LeeYoonJin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

LeeYoonJin

๐Ÿ ์ด์œค์ง„

๐ŸŽ ์•„์š” ๊ณผ์ œ ๋ ˆํฌ


1๏ธโƒฃ์ฃผ์ฐจ ๊ณผ์ œ

2-1 2-1 2-12-1

  • push, present, dismiss ๋ทฐ ์ „ํ™˜ ์‹ค์Šต

  • (๋„์ „๊ณผ์ œ) AppDelegate ํ™œ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ๋‹ค๋ฅธ ๋ทฐ์— ์ „๋‹ฌํ•˜๊ธฐ

    AppDelegate ํŒŒ์ผ์— ๋ณ€์ˆ˜ ์„ ์–ธ

    class AppDelegate: UIResponder, UIApplicationDelegate {
      
        var partName: String?
        var memberName: String?
    

    SignInVC(๋กœ๊ทธ์ธ)๋‚ด์˜ ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ Action ํ•จ์ˆ˜ ๋‚ด๋ถ€

      @IBAction func loginBtnTouched(_ sender: Any) {
            
            let ad = UIApplication.shared.delegate as? AppDelegate
            ad?.partName = self.partTextField.text
            ad?.memberName = "\(self.nameTextField.text ?? "")๋‹˜ ์•ˆ๋…•ํ•˜์„ธ์š”๐Ÿค—"
            
            self.dismiss(animated: true, completion: nil)
        }

    ๐Ÿ‘‰ ํ…์ŠคํŠธํ•„๋“œ์— ์ž…๋ ฅํ•œ ๋‚ด์šฉ ์ „๋‹ฌํ•ด์ฃผ๊ธฐ

    ๋ฉ”์ธVC์˜ viewWillAppearํ•จ์ˆ˜

    override func viewWillAppear(_ animated: Bool) {
            let ad = UIApplication.shared.delegate as? AppDelegate
            if let part = ad?.partName{
                partLabel.text = part
            }
            if let name = ad?.memberName{
                introLabel.text = name
            }
        }

    ๐Ÿ‘‰ viewDidLoad()๋Š” 1ํšŒ ํ˜ธ์ถœ, ํ™”๋ฉด์— ๋‚˜ํƒ€๋‚˜๊ธฐ ์ง์ „์— ์ƒํƒœ ์—…๋ฐ์ดํŠธ ํ•ด์ฃผ๋Š” viewWillAppear() ์‚ฌ์šฉ

About

๐ŸŽ์ด์œค์ง„๐Ÿ‘ป

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published