๋ชฉ๋ก๐Ÿ“ฑ๐ŸŽ iOS (62)

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

[iOS] DIContainer : ์˜์กด์„ฑ ์ฃผ์ž…์„ ์œ„ํ•œ ๊ฐ์ฒด ๊ด€๋ฆฌํ•˜๊ธฐ

์ฐธ๊ณ  ๋ฌธ์„œ : [DI] DI Container, IOC Container ๊ฐœ๋…๊ณผ ์˜ˆ์ œ DIContainer๋ž€? DI = Dependency Injection ์˜์กด์„ฑ ์ฃผ์ž… ๋ฐ–์—์„œ ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ฃผ์ž…ํ•ด์ฃผ๋Š” ๊ฒƒ Container : ๋ชจ๋“  ์ธ์Šคํ„ด์Šค๋ฅผ ๊ฐ€์ง€๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ์ฒด. register : ๋‚ด๊ฐ€ ์‚ฌ์šฉํ•  ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“ค์–ด ๋“ฑ๋ก resolve : ํ•„์š”ํ•œ ์ธ์Šคํ„ด์Šค๋ฅผ ๋‹ฌ๋ผ๊ณ  ์š”์ฒญ ์ฆ‰ DIContainer๋Š” ์˜์กด์„ฑ ์ฃผ์ž…์— ํ•„์š”ํ•œ ๊ฐ์ฒด๋“ค์„ ์ €์žฅํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ์—ญํ• ์„ ํ•œ๋‹ค. ์™œ ํ•„์š”ํ•œ๊ฐ€? ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๋Š” ์ค‘๋ณต์ฝ”๋“œ๊ฐ€ ๋งŽ์•„์งˆ ๋•Œ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•  ๋•Œ ํ•„์š”ํ•œ ํŒŒ๋ผ๋ฏธํ„ฐ๊ฐ€ ๋งŽ์„ ๋•Œ ์‚ฌ์šฉ๋ฐฐ๊ฒฝ ํ”„๋กœ์ ํŠธ๋ฅผ ํ•˜๋ฉฐ ์–ด๋–ค ๊ฐ์ฒด๊ฐ€ ํ•„์š”ํ•  ๋•Œ, ์ƒ์„ฑ์ž๋กœ ์•ฑ์˜ ์—ฌ๊ธฐ์ €๊ธฐ์—์„œ ๋ฌด๋ถ„๋ณ„ํ•˜๊ฒŒ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์žˆ์—ˆ๋‹ค. ๋˜, ์ด๋ฏธ ์ƒ์„ฑํ–ˆ๋˜ ์‹œ์ ๊ณผ ์œ„์น˜๋ฅผ ๋ชจ๋ฅด๊ณ ..

๐Ÿ“ฑ๐ŸŽ iOS 2022. 12. 5. 15:28
[iOS] Coordinator (2) - ์ฝ”๋””๋„ค์ดํ„ฐ ํŒจํ„ด, ์˜ˆ์ œ์™€ ํ•จ๊ป˜ ๊ตฌํ˜„ํ•˜๊ธฐ

โœ”๏ธ ์ด ๊ธ€์˜ ์‹œ๋ฆฌ์ฆˆ๋Š” ์•„๋ž˜์˜ ์„ธ ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•ด ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. Coordinator Pattern How to use the coordinator pattern in iOS apps Advanced coordinators in iOS โœ”๏ธ ์•„๋ž˜์˜ ๋‘ ๋ฌธ์„œ๋Š” ์กฐ์•…ํ•˜๊ฒŒ๋‚˜๋งˆ ๋ฒˆ์—ญ์„ ํ•ด ๋‘์—ˆ์œผ๋‹ˆ ํ˜น์‹œ ํ•„์š”ํ•˜์‹  ๋ถ„ ์ฐธ๊ณ ํ•˜์„ธ์š”. How to use the coordinator pattern in iOS apps ํ•ด์„ ๋ฐ ์ •๋ฆฌ Advanced coordinators in iOS ํ•ด์„ ๋ฐ ์ •๋ฆฌ โœ”๏ธ ์ด์ „ ํŽธ์ธ (1) - ์ฝ”๋””๋„ค์ดํ„ฐ ๊ฐœ๋… ์ดํ•ดํ•˜๊ธฐ๋Š” ์—ฌ๊ธฐ์— ์žˆ์Šต๋‹ˆ๋‹ค. โœ”๏ธ ๋…ธ์…˜์ด ๋” ํŽธํ•˜์‹œ๋‹ค๋ฉด ์—ฌ๊ธฐ์˜ 1,2ํŽธ ํ†ตํ•ฉ๋ณธ ๋ฅผ ํ™•์ธํ•ด ์ฃผ์„ธ์š”. Coordinator ๊ตฌํ˜„ ์ด์ œ ์„ค๋ช…์€ ๋งˆ์น˜๊ณ  ์‹ค์ œ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉฐ ๊ตฌํ˜„ํ•ด ๋ด…์‹œ๋‹ค. ์˜ˆ์ œ..

๐Ÿ“ฑ๐ŸŽ iOS 2022. 11. 25. 01:13
[iOS] Advanced coordinators in iOS ํ•ด์„ ๋ฐ ์ •๋ฆฌ

Advanced coordinators in iOS iOS ์•ฑ์—์„œ ์ฝ”๋””๋„ค์ดํ„ฐ ํŒจํ„ด์„ ์ ์šฉํ•  ๋•Œ ๋งˆ์ฃผ์น˜๋Š” 6๊ฐ€์ง€ ๋ฌธ์ œ๋“ค์— ๋Œ€ํ•œ ํ•ด๋‹ต์„ ์ฐพ๋Š”๋‹ค. 1. child coordinators๋ฅผ ์–ธ์ œ, ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š”๊ฐ€? ์•ฑ์ด ์ปค์ง€๋ฉด ๋ถ€๋ชจ ์ฝ”๋””๋„ค์ดํ„ฐ์™€ ์ž์‹ ์ฝ”๋””๋„ค์ดํ„ฐ๋ฅผ ๋‘˜ ํ•„์š”๊ฐ€ ์žˆ๋‹ค. ์ž์‹ ์ฝ”๋””๋„ค์ดํ„ฐ๋Š” ๊ฐ๊ฐ ๋‹ค๋ฅธ ๊ธฐ๋Šฅ(์ฑ…์ž„)์„ ๋งก๋Š”๋‹ค ์ž์‹ ์ฝ”๋””๋„ค์ดํ„ฐ ํ•˜๋‚˜์˜ ํ๋ฆ„์ด ๋๋‚ฌ์„ ๋•Œ, ๋ถ€๋ชจ ์ฝ”๋””๋„ค์ดํ„ฐ์—๊ฒŒ ์ด๋ฅผ ์•Œ๋ฆฌ๊ณ , ๋‹ค๋ฅธ ๊ณณ์œผ๋กœ ํ๋ฆ„์„ ์ด์–ด์ค€๋‹ค. ๋ณต์žกํ•œ ์•ฑ์˜ ๊ธฐ๋Šฅ์„ ์ž‘๊ฒŒ ๋‚˜๋ˆ„์–ด ์žฌ์‚ฌ์šฉ์ด ์‰ฝ๊ฒŒ ํ•จ child coordinator ์˜ˆ์‹œ class BuyCoordinator: Coordinator { var childCoordinators = [Coordinator]() var navigationController: UI..

๐Ÿ“ฑ๐ŸŽ iOS 2022. 11. 25. 01:08
[iOS] How to use the coordinator pattern in iOS apps ํ•ด์„ ๋ฐ ์ •๋ฆฌ

How to use the coordinator pattern in iOS apps VC๊ฐ€ ์ฝ”๋””๋„ค์ดํ„ฐ๋ฅผ ์†Œ์œ ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์กฐ๊ธˆ ๋” ๊ฐ„๋‹จํ•˜๋‹ค. ์˜์–ด ํ•ด์„๊ณผ ์ฝ”๋“œ ์˜ˆ์ œ ์œ„์ฃผ๋กœ ์ •๋ฆฌ. iOS์•ฑ์—์„œ ์ฝ”๋””๋„ค์ดํ„ฐ ํŒจํ„ด์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• view controller์™€ navigation controller๋ฅผ ๋‹จ์ˆœํ™”ํ•˜๊ธฐ. ์—ฌ๊ธฐ์„œ๋Š” child coordinator ์‚ฌ์šฉ ์ง์ „๊นŒ์ง€ ๋ฐฐ์šด๋‹ค. child coordinator ์‚ฌ์šฉ๋ฒ•์€ ๋‹ค์Œ ๋ฌธ์„œ์—์„œ ๋ฐฐ์šด๋‹ค. iOS ์•ฑ์—์„œ ์ฝ”๋””๋„ค์ดํ„ฐ ํŒจํ„ด์„ ์‚ฌ์šฉํ•˜๋ฉด… View Controller์—์„œ ์•ฑ ํƒ์ƒ‰(app navigation) ์ž‘์—…์„ ์ œ๊ฑฐํ•  ์ˆ˜ ์žˆ๋‹ค. ์šฐ๋ฆฌ๊ฐ€ ํ•„์š”ํ•  ๋•Œ ์•ฑ์˜ ํ๋ฆ„์„ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ViewController๋“ค์„ ๊ด€๋ฆฌํ•˜๊ณ  ์žฌ์‚ฌ์šฉํ•˜๊ธฐ ๋” ์‰ฌ์›Œ์ง„๋‹ค. massive view c..

๐Ÿ“ฑ๐ŸŽ iOS 2022. 11. 25. 01:06