๋ชฉ๋ก๐Ÿ“ฑ๐ŸŽ iOS/๐Ÿ Apple Developer Documentation (19)

Bibi's DevLog ๐Ÿค“๐ŸŽ

[๐ŸŽ / UIKit] UINavigationController

[UIKit] UINavigationController Apple Developer Documentation UINavigtaionController ํด๋ž˜์Šค ๊ณ„์ธต์ ์ธ ๋‚ด์šฉ์„ ํƒ์ƒ‰ํ•˜๊ธฐ ์œ„ํ•œ ์Šคํƒ ๊ธฐ๋ฐ˜์˜ scheme์„ ์ •์˜ํ•œ ์ปจํ…Œ์ด๋„ˆ ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ. ์„ ์–ธ @MainActor class UINavigationController : UIViewController ๊ฐœ์š” navigation controller๋Š” ํ•˜๋‚˜ ์ด์ƒ์˜ ์ž์‹ ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ๋“ค์„ ๋‚ด๋น„๊ฒŒ์ด์…˜ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ๊ด€๋ฆฌํ•˜๋Š” ์ปจํ…Œ์ด๋„ˆ ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ์ž…๋‹ˆ๋‹ค. ์ด ์œ ํ˜•์˜ ์ธํ„ฐํŽ˜์ด์Šค์—์„œ๋Š”, ํ•œ ๋ฒˆ์— ์˜ค์ง ํ•˜๋‚˜์˜ ์ž์‹ ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ๋งŒ ๋ณด์ด๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ์š”์†Œ๋ฅผ ์„ ํƒํ•˜๋ฉด ์ƒˆ๋กœ์šด ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ๊ฐ€ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์‚ฌ์šฉํ•ด ์Šคํฌ๋ฆฐ์— ๋“ค์–ด์˜ค๋ฉฐ(push), ์ด์ „์˜ ๋ทฐ ์ปจํŠธ๋กค..

About the App Launch Sequence ์•ฑ ์‹คํ–‰ ์‹œํ€€์Šค์— ๋Œ€ํ•˜์—ฌ

Learn the order in which the system executes your code at app launch time. Apple Developer Documentation ์•ฑ ์‹คํ–‰ ์‹œํ€€์Šค์— ๋Œ€ํ•˜์—ฌ ์•ฑ์˜ ์‹คํ–‰ ์‹œ์ ์— ์‹œ์Šคํ…œ์ด ๋‹น์‹ ์˜ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ์ˆœ์„œ์— ๋Œ€ํ•ด ๋ฐฐ์›๋‹ˆ๋‹ค. ๊ฐœ์š” ์•ฑ์˜ ์‹คํ–‰์€ ๋ณต์žกํ•œ ๋‹จ๊ณ„์˜ ์ˆœ์„œ(์‹œํ€€์Šค)๋ฅผ ํฌํ•จํ•˜๋ฉฐ, ๊ทธ ๋Œ€๋ถ€๋ถ„์€ ์‹œ์Šคํ…œ์ด ์ž๋™์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์‹คํ–‰ ์‹œํ€€์Šค ์ค‘์—๋Š”, UIKit์€ ์•ฑ์˜ app delegate์˜ ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ๋‹น์‹ ์ด ์‚ฌ์šฉ์ž ์ƒํ˜ธ์ž‘์šฉ์„ ์ค€๋น„ํ•˜๊ณ , ์•ฑ์ด ์š”๊ตฌํ•˜๋Š” ํŠน์ • ์ž‘์—…๋“ค์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์˜ ๊ทธ๋ฆผ์€ ์•ฑ์ด ์‹คํ–‰๋  ๋•Œ ๋ถ€ํ„ฐ ์‹œํ€€์Šค๊ฐ€ ์™„๋ฃŒ๋  ๋•Œ ๊นŒ์ง€, ์‹คํ–‰ ์‹œํ€€์Šค์˜ ๊ฐœ๋ณ„์ ์ธ ๋‹จ๊ณ„๋ฅผ ์„ค๋ช…ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค: ์‚ฌ์šฉ์ž ๋˜๋Š” ์‹œ์Šคํ…œ์ด ๋‹น์‹ ์˜ ์•ฑ์„ ์‹ค..

Dictionary - subscript(_: default:)

subscript(_: default:) (Dictionary) https://developer.apple.com/documentation/swift/dictionary/subscript(_:default:) ๋”•์…”๋„ˆ๋ฆฌ์—์„œ ์ฃผ์–ด์ง„ ํ‚ค์— ํ•ด๋‹นํ•˜๋Š” ๊ฐ’์„ ๋ฆฌํ„ดํ•˜๊ณ , ๋งŒ์•ฝ ํ•ด๋‹นํ•˜๋Š” ํ‚ค๊ฐ€ ์—†์œผ๋ฉด default๋กœ ์ง€์ •๋œ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. key : ๋”•์…”๋„ˆ๋ฆฌ์—์„œ ์ฐพ์„ ํ‚ค key๊ฐ€ Hashable ์„ ์ค€์ˆ˜ํ•ด์•ผ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•จ defaultValue : ๋”•์…”๋„ˆ๋ฆฌ์— ํ•ด๋‹น ํ‚ค๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์„ ๋•Œ ์‚ฌ์šฉํ•  ๊ธฐ๋ณธ๊ฐ’ ๋”•์…”๋„ˆ๋ฆฌ์— ํŠน์ • ํ‚ค๊ฐ€ ์กด์žฌํ•  ๋•Œ๋Š” ๊ทธ ๊ฐ’์„ ๋ฆฌํ„ดํ•˜๊ณ , ์กด์žฌํ•˜์ง€ ์•Š์„ ๋•Œ๋Š” default value๋ฅผ ๋ฆฌํ„ดํ•˜๋Š” ์„œ๋ธŒ์Šคํฌ๋ฆฝํŠธ. ์•„๋ž˜ ์˜ˆ์‹œ๋Š” HTTP ์‘๋‹ต ์ฝ”๋“œ๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ์‚ฌ์šฉํ•  ๋ฉ”์‹œ์ง€๋กœ ์„œ๋ธŒ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค: var..

[Foundation] UserDefaults

UserDefaults ๊ณต์‹ ๋ฌธ์„œ https://developer.apple.com/documentation/foundation/userdefaults/ : ์•ฑ ์‹คํ–‰ ๋™์•ˆ ์ง€์†์ ์œผ๋กœ ํ‚ค-๊ฐ’ ์Œ์„ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋Š” ์‚ฌ์šฉ์ž์˜ ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋Œ€ํ•œ ์ธํ„ฐํŽ˜์ด์Šค. class UserDefaults : NSObject UserDefaults๋Š” ๊ธฐ๋ณธ ์‹œ์Šคํ…œ๊ณผ ์ƒํ˜ธ์ž‘์šฉํ•˜๊ธฐ ์œ„ํ•œ ํ”„๋กœ๊ทธ๋žจ์ ์ธ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ์‹œ์Šคํ…œ์€ ์•ฑ์ด ์‚ฌ์šฉ์ž๊ฐ€ ์„ ํ˜ธํ•˜๋Š” ๋™์ž‘์„ ์ปค์Šคํ„ฐ๋งˆ์ด์ฆˆํ•˜๋„๋ก ํ•ด ์ค๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋‹น์‹ ์€ ์‚ฌ์šฉ์ž๊ฐ€ ๊ทธ๋“ค์ด ์„ ํ˜ธํ•˜๋Š” ์ธก์ • ๋‹จ์œ„๋‚˜ ๋ฏธ๋””์–ด ์žฌ์ƒ ์†๋„๋ฅผ ๊ตฌ์ฒดํ™”ํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•ฑ์€ ์‚ฌ์šฉ์ž์˜ ๊ธฐ๋ณธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์žˆ๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ์ง‘ํ•ฉ์— ๊ฐ’๋“ค์„ ํ• ๋‹นํ•จ์œผ๋กœ์จ ์ด๋Ÿฌํ•œ ์„ ํ˜ธ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์ด ํŒŒ๋ผ๋ฏธํ„ฐ๋“ค์€ ๊ธฐ๋ณธ..

๋น„๋™๊ธฐ์ ์œผ๋กœ ํ…Œ์ด๋ธ”๋ทฐ, ์ปฌ๋ ‰์…˜๋ทฐ์˜ ์ด๋ฏธ์ง€ ๋กœ๋“œํ•˜๊ธฐ Asynchronously Loading Images into Table and Collection Views

Asynchronously Loading Images into Table and Collection Views ์›๋ฌธ ํ™•์ธ (์ƒ˜ํ”Œ ํ”„๋กœ์ ํŠธ ๋‹ค์šด๋กœ๋“œ ๋งํฌ ํฌํ•จ) https://developer.apple.com/documentation/uikit/views_and_controls/table_views/asynchronously_loading_images_into_table_and_collection_views ๊ฐœ์š” ์ด๋ฏธ์ง€ ์บ์‹ฑ์€ ๋‹น์‹ ์˜ ์•ฑ์˜ ํ…Œ์ด๋ธ”๋ทฐ์™€ ์ปฌ๋ ‰์…˜๋ทฐ๊ฐ€ ์ธ์Šคํ„ด์Šค๋ฅผ ๋น ๋ฅด๊ฒŒ ๋งŒ๋“ค๊ณ  ์Šคํฌ๋กค์— ๋น ๋ฅด๊ฒŒ ์‘๋‹ตํ•˜๋„๋ก ๋„์™€์ค๋‹ˆ๋‹ค. ์ƒ˜ํ”Œ ํ”„๋กœ์ ํŠธ์˜ ์•ฑ์€ URL์„ ํ†ตํ•ด ์ด๋ฏธ์ง€๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์„ ์‹œ์—ฐํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฏธ์ง€๋“ค์€ assets catalog์˜ ์ผ๋ถ€๊ฐ€ ์•„๋‹Œ, URL์„ ํ†ตํ•ด ๋น„๋™๊ธฐ์ ์œผ๋กœ ๊ฐ๊ฐ ๋กœ๋”ฉ์„ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ํ•˜๊ธฐ ์œ„ํ•œ..