728x90

๐Ÿ“ฑ App Development Study/iOS๐ŸŽ 57

[Udemy iOS & Swift Bootcamp] UITextField, UITextFieldDelegate

* UITextField ์ƒ์„ฑ/๊ธฐ๋ณธ ์†์„ฑ - UITextField ์—๋„ Dark/LIght Mode๊ฐ€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ ์šฉ๋œ๋‹ค. - Text Input Type์„ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ๋‹ค. - Return Key ๋Š” ํ‚ค๋ณด๋“œ์—์„œ ํ™•์ธ?๋ฒ„ํŠผ์„ Enter๋‚˜ Go ๋“ฑ ์–ด๋–ป๊ฒŒ ๋ณด์ด๊ฒŒ ํ• ์ง€ ์„ค์ •ํ•˜๋Š” ๊ฑฐ๋‹ค. Default๋Š” Return. - Sezure Text Entry๋Š” ์•”ํ˜ธํ•„๋“œ์—์„œ ์ž…๋ ฅ๋œ ๊ธ€์ž๊ฐ€ ์•ˆ๋ณด์ด๊ฒŒ ํ•œ๋‹ค. * ์‚ฌ์šฉ ViewController ์Šคํฌ๋ฆฝํŠธ์— UITextField ์—ฐ๊ฒฐํ•ด์„œ IBOutlet, IBAction ๋งŒ๋“ค์–ด์ฃผ๊ธฐ ํ‚ค๋ณด๋“œ ์•ˆ๋‚˜์˜ค๋ฉด Command + k ๋ˆ„๋ฅด๋ฉด Keyboard ํ† ๊ธ€๋ผ์„œ ์˜ฌ๋ผ์˜จ๋‹ค. * Return Key ๋ˆŒ๋ €์„ ๋•Œ ๋ฐ˜์‘ํ•˜๊ฒŒ ํ•˜๊ธฐ 1. UITextFieldDelegate ํด๋ž˜์Šค ์ถ”๊ฐ€ํ•˜๊ณ  UIText..

[Udemy iOS & Swift Bootcamp] Protocol

*ํ”„๋กœํ† ์ฝœ: ์†์„ฑ์ด๋‚˜ ๋ฉ”์†Œ๋“œ์˜ ํ˜•ํƒœ๋ฅผ ๋ฏธ๋ฆฌ ๋งŒ๋“ค์–ด๋†“๋Š” ๊ฒƒ. ์ƒ์†์„ ์ข€๋” ๊ตฌ์กฐ์ ์œผ๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋„๋ก. ์ด ๋•Œ, ํ”„๋กœํ† ์ฝœ์€ ์ •์˜๋งŒ ํ•  ๋ฟ ์„ธ๋ถ€ ๋‚ด์šฉ์€ ๊ตฌํ˜„ํ•˜์ง€ ์•Š๋Š”๋‹ค. ๊ป๋ฐ๊ธฐ๋งŒ ์žˆ๋‹ค๊ณ  ๋ณด๋ฉด ๋จ. ํ”„๋กœํ† ์ฝœ์€ ํด๋ž˜์Šค์™€ ๊ตฌ์กฐ์ฒด์— ์ ์šฉ๋  ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ์‹œ ์ฝ”๋“œ) protocol CanFly{ func fly() } class Bird { var isFemale = true func layEgg(){ if isFemale { print("The bird makes a new bird in a shell.") } } } class Egle: Bird, CanFly{ func fly() { print("The elgle flpas its wings and lifts off into the sky.") } func soar..

[Udemy iOS & Swift Bootcamp] Supporting Dark Mode

Dark Mode ? ์ตœ๊ทผ Dark Mode๋ฅผ ์ง€์›ํ•˜๋Š” ์•ฑ์ด ๋งŽ์•„์ง€๊ณ  ์žˆ๋‹ค. Dark Mode๋ž€ System Mode์˜ Light, Dark ์„ค์ •์— ๋”ฐ๋ผ ์•ฑ๋„ ๋ฐ๊ณ , ์–ด๋‘์šด ํ™”๋ฉด์„ ์ง€์›ํ•˜๋Š” ๊ธฐ๋Šฅ์ด๋‹ค. ๊ทธ๋ฆฌ๊ณ  Xcode ์—์„œ๋Š” ์ด๋ฅผ ์‰ฝ๊ฒŒ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋งจ ์•„๋ž˜ Appearance ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด Light, Dark ๋ชจ๋“œ ํ™•์ธ ๊ฐ€๋Šฅ 1. Label Color ์ด์šฉํ•˜๊ธฐ Label ์ปฌ๋Ÿฌ๋กœ ์ง€์ •ํ•ด์ฃผ๋ฉด ์ž๋™์œผ๋กœ System ๋ชจ๋“œ์— ๋งž์ถฐ์„œ ํ•˜์–€์ƒ‰, ๊ฒ€์€์ƒ‰์œผ๋กœ ๋ณ€๊ฒฝ๋œ๋‹ค. 2. Label Color ์ปฌ๋Ÿฌ ๋ง๊ณ  Custom ์ปฌ๋Ÿฌ๋ฅผ Light, Dark Color๋กœ ์ €์žฅํ•˜๋Š” ๋ฒ• 1) Custom ์ปฌ๋Ÿฌ๋ฅผ ํŒ”๋ ›ํŠธ์— ์ €์žฅํ•˜๊ธฐ ์ž„์˜์˜ Light, Dark์ปฌ๋Ÿฌ๋ฅผ ์ง€์ •ํ•˜๋ ค๋ฉด ์›ํ•˜๋Š” ์ปฌ๋Ÿฌ๋ฅผ ํŒ”๋ ˆํŠธ์— ์ €์žฅํ•ด๋‘๋ฉด ์ ์šฉํ•˜๊ธฐ ํŽธํ•˜๋‹ค. ์›ํ•˜..

[iOS] SF Symbols ? ๋‹ค์šด๋กœ๋“œ ๋งํฌ

SF Symbols: iOS 13 ์ด์ƒ์˜ OS๋ถ€ํ„ฐ ์ง€์›ํ•˜๋Š” apple ๋””์ž์ด๋„ˆ๋“ค์ด ๋งŒ๋“  1500์—ฌ๊ฐœ์˜ ๊ธฐํ˜ธ์™€ ์ด๋ฏธ์ง€ - SF Symbols ์„ค๋ช… https://developer.apple.com/design/human-interface-guidelines/foundations/sf-symbols SF Symbols - Foundations - Human Interface Guidelines - Design - Apple Developer SF Symbols SF Symbols provides thousands of consistent, highly configurable symbols that integrate seamlessly with the San Francisco system font, autom..

[Udemy iOS & Swift Bootcamp] ๋‘๋ฒˆ์งธ ํŽ˜์ด์ง€ ๋งŒ๋“ค์–ด์„œ ๊ฐ’ ๋„˜๊ธฐ๊ธฐ

์—ฌ๋Ÿฌ ๊ฐœ์˜ View ๋ฅผ ๋งŒ๋“ค๊ณ  ๊ฐ’์„ ๋„˜๊ฒจ๋ณด์ž 1. segue ์—ฐ๊ฒฐ๋ฒ• 1) UI๋กœ ์—ฐ๊ฒฐํ•˜๊ธฐ ์™ผ์ชฝ View์—์„œ Ctrlํ‚ค๋ฅผ ๋ˆ„๋ฅด๊ณ  ์˜ค๋ฅธ์ชฝ View์— ๋†“์œผ๋ฉด action์„ ์„ค์ •ํ•˜๋Š” ํŒ์—…์ด ๋œฌ๋‹ค. Show๋Š” ํ™”๋ฉด์ด ์™ผ์ชฝ์œผ๋กœ ๋ฐ€๋ฆฌ๋ฉฐ ๋‚˜ํƒ€๋‚˜๊ณ  ์™ผ์ชฝ ์ƒ๋‹จ์— ๋’ค๋กœ๊ฐ€๊ธฐ ๋ฒ„ํŠผ์ด ์ƒ๊ธด๋‹ค. Present Modally๋Š” ์•„๋ž˜์—์„œ ์œ„๋กœ ์ƒˆ๋กœ์šด ํ™”๋ฉด์ด ๋‚˜ํƒ€๋‚œ๋‹ค. ๋‚œ Present Modally ์„ ํด๋ฆญํ–ˆ๋‹ค. 2) Segue์— Identifier ์ •์˜ํ•˜๊ธฐ ์—ฐ๊ฒฐ๋ถ€๋ถ„์ด ๋งŽ์„ ์ˆ˜ ์žˆ์œผ๋‹ˆ, ์—ฐ๊ฒฐ๋ถ€๋ถ„์— Identifier๋ฅผ ์ฃผ์ž. 3) ์—ฐ๊ฒฐ ์‹œ ํ•„์š”ํ•œ ํ•จ์ˆ˜ ๊ตฌํ˜„ํ•˜๊ธฐ @IBAction func onClickButton(_ sender: UIButton) { self.performSegue(withIdentifier: "goToResult",..

[Udemy iOS & Swift Bootcamp] Class vs Struct

struct vs class struct MyStruct { } class MyClass: SuperClass { } Immutable Passed by Value Passed by Reference Inheritance : ๊ธฐ๋ณธ์œผ๋ก  struct๋กœ ๋งŒ๋“œ๋Š”๊ฒŒ ๋งž๋‹ค. ์ƒ์†์„ ์›ํ•˜๋ฉด class ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ . * swift ๊ณต์‹๋ฌธ์„œ ์ฐธ๊ณ : https://docs.swift.org/swift-book/documentation/the-swift-programming-language/classesandstructures/ Documentation docs.swift.org

[Udemy iOS & Swift Bootcamp] Design Patterns - MVC ํŒจํ„ด

MVC(Model - View Controller) : ์ฝ”๋“œ๋ฅผ ์žฌ์‚ฌ์šฉํ•˜๊ณ  ์š”์†Œ๋ฅผ ๋ถ„๋ฆฌํ•ด์„œ ๋ชจ๋“ˆ๋กœ ๋งŒ๋“œ๋Š”๋ฐ ์œ ์šฉํ•œ ๋ฐฉ๋ฒ•์ด๋‹ค. Model: data & Logic View: User Interface Controller: Mediator View ๋Š” Controller์™€๋งŒ ๋Œ€ํ™”ํ•œ๋‹ค. Controller๋Š” Model์—์„œ ๊ฐ’๋งŒ ๋ฐ›์•„์™€์„œ ๋ณด์—ฌ์ฃผ๊ธฐ๋งŒ ํ•œ๋‹ค. Model ์ด ๋ฐ์ดํ„ฐ์™€ ๋กœ์ง ๋ชจ๋‘๋ฅผ ๊ฐ–๊ณ  ์žˆ๋‹ค. ์–ด๋ ค์šด๊ฑด ๋‹ค ๋ชจ๋ธ์ด ํ•œ๋‹ค. Quizzler ์•ฑ ์ฝ”๋“œ๋ฅผ ์˜ˆ์‹œ๋กœ ๋“ค์–ด๋ณด์ž. ์™ผ์ชฝ์ƒ๋‹จ ์ ์ˆ˜, ๊ฐ€์˜จ๋ฐ ํ€ด์ฆˆ ๋ฌธ์ œ, ์•„๋ž˜ ๋ณด๊ธฐ 3๊ฐœ, ๋งจ ์•„๋ž˜ ํ”„๋กœ๊ทธ๋ ˆ์Šค๋ฐ”๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค. ๊ฐ€์˜จ๋ฐ Text์—์„œ ๋ฌธ์ œ๊ฐ€ ๋‚˜์˜ค๊ณ  ์•„๋ž˜์— ๋ณด๊ธฐ 3๊ฐœ๊ฐ€ ๋‚˜์˜จ๋‹ค. ๋ณด๊ธฐ๋Š” ์ •๋‹ต์„ ํด๋ฆญํ•˜๋ฉด ์ดˆ๋ก์ƒ‰, ์˜ค๋‹ต์„ ํด๋ฆญํ•˜๋ฉด ๋นจ๊ฐ„์ƒ‰์œผ๋กœ ๋ณ€ํ•œ๋‹ค. ๋ฌธ์ œ๊ฐ€ ์ง„ํ–‰๋  ๋•Œ๋งˆ๋‹ค..

[Udemy iOS & Swift Bootcamp] Egg Timer ๋งŒ๋“ค๊ธฐ (feat. Timer, UIProgressView)

Udemy iOS & Swift Bootcamp 8๊ฐ• Egg Timer ๋งŒ๋“ค๊ธฐ์ด๋‹ค. soft, medium, hard ๊ณ„๋ž€์„ ๋งŒ๋“œ๋Š”๋ฐ ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„์„ ํ™”๋ฉด์— ๋ณด์—ฌ์ฃผ๊ณ , 1์ดˆ๊ฐ€ ํ๋ฅผ ๋•Œ๋งˆ๋‹ค progress bar์— ์ง„ํ–‰์ƒํ™ฉ์„ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ด ๋ฉ”์ธ ๊ธฐ๋Šฅ์ด๋‹ค. ์‹ค๋กœํฐ ์•ฑ ๋งŒ๋“ค๊ธฐ์—์„œ ๋ฐฐ์› ๋˜ ๋งˆ์ง€๋ง‰ ์ข…๋ฃŒ ํšจ๊ณผ์Œ๋„! if/else๋ฌธ switch๋ฌธ, Dictionary, !? ํ‚ค์›Œ๋“œ, @objc ํ‚ค์›Œ๋“œ, Countdown Timer, UIProgressView ๋ฅผ ๋ฐฐ์› ๋‹ค. ๊ธฐ์–ตํ•˜๊ณ  ์‹ถ์€ ๋ถ€๋ถ„์€ Timer์ฝ”๋“œ์™€ UIProgressView์ด๋‹ค. 1. Timer ๊ธฐ๋Šฅ ๋งŒ๋“ค๊ธฐ //Timer ๊ธฐ๋Šฅ ํ•ต์‹ฌ์ฝ”๋“œ var countdownTimer: Timer! countdownTimer = Timer.scheduledTimer(time..

[Udemy iOS & Swift Bootcamp] Text Size ์ž๋™์กฐ์ ˆ, View Controller Scene Hierarchy

1. Text Size๋ฅผ ์งค๋ฆฌ์ง€ ์•Š๊ณ  ๋‹ค ๋‚˜์˜ค๋„๋ก ์ž๋™์กฐ์ ˆํ•˜๋Š” ๋ฒ• 2๊ฐ€์ง€. 1) Lines์˜ ์ˆ˜๋ฅผ 0์œผ๋กœ ๋งž์ถฐ์„œ ๋ฌด์ œํ•œ ๋ผ์ธ์ด ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜์ž Lines์˜ ์ˆ˜๋ฅผ ์ž„์˜์˜ ์ˆ˜๋กœ ์ฃผ๋ฉด ๋ผ์ธ ์ˆ˜๋ฅผ ์ œํ•œํ•ด์„œ ๊ธ€์ž๊ฐ€ ์ž˜๋ ค๋ณด์ผ ์ˆ˜ ์žˆ๋‹ค. Lines์˜ ์ˆ˜๋ฅผ 0์œผ๋กœ ์ฃผ๋ฉด ๋ฌธ์ž ๊ธธ์ด๊ฐ€ ๊ธธ์–ด์ง€๋ฉด ๊ธ€๊ผด ํฌ๊ธฐ๋ฅผ ์œ ์ง€ํ•˜๋ฉด์„œ ๋ผ์ธ ์ˆ˜๋ฅผ ๋Š˜๋ ค์„œ ๋‹ค ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ๋‹ค. 2) Autoshrink = Minimum Font Size Autoshrink ์†์„ฑ์„ Minimum Font Size ๋กœ ์ง€์ •ํ•ด์ฃผ์ž. ๊ณต๊ฐ„์— ๋งž์ถฐ ์ตœ์†Œ ํฐํŠธ ์‚ฌ์ด์ฆˆ๊นŒ์ง€ ํฐํŠธ ํฌ๊ธฐ๋ฅผ ์ตœ์†Œ ์‚ฌ์ด์ฆˆ๊นŒ์ง€ ์ž๋™์œผ๋กœ ์ค„์ธ๋‹ค๋Š” ๋œป์ด๋‹ค. 2. View Controller Scene Hierarchy ๊ธฐ์–ตํ•˜๊ธฐ. View Controller Scene์˜ ๋ˆˆ์€ ์•„๋ž˜์ชฝ์— ๋‹ฌ๋ ค์žˆ๋‹ค. ์ฆ‰ ์•„๋ž˜๊ฐ€..

[Udemy iOS & Swift Bootcamp] Button UIControl Event

๋ฒ„ํŠผ ๊ธฐ๋Šฅ ๊ตฌํ˜„์‹œ ํ•„์š”ํ•œ Event ํ•จ์ˆ˜๋“ค์„ ์ •๋ฆฌํ•ด๋ณด์ž. [UIControl.Event] ํ•จ์ˆ˜ ์ฝ”๋“œ ํ•˜๋Š” ์ผ static var touchDown: UIControl.Event A touch-down event in the control. ํด๋ฆญํ–ˆ์„ ๋•Œ static var touchDownRepeat: UIControl.Event A repeated touch-down event in the control; for this event the value of the UITouch tapCount method is greater than one. ๋ฐ˜๋ณตํด๋ฆญํ•  ๋•Œ static var touchDragInside: UIControl.Event An event where a finger is dragged insid..

728x90