Swift 47

[ iOS ์‹œํ–‰์ฐฉ์˜ค ] MVC ์•„ํ‚คํ…์ฒ˜ ํŒจํ„ด์„ ์ ์šฉํ•ด๋ณด์ž

๐Ÿค” ๋ฐฐ๊ฒฝ & ๋ฌธ์ œ์— ์—…๋ฐ์ดํŠธ๋ฅผ ์ง„ํ–‰ํ•  ์ˆ˜๋ก ๋ถ„๋ช…ํ•˜์ง€ ์•Š์€ ์ฝ”๋“œ ๊ธฐ์ค€์ด ํ”„๋กœ์ ํŠธ ๊ฐ€๋…์„ฑ ๋‚ฎ์ถ”๊ณ  ์žˆ์Œ์„ ์•Œ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋”๋ถˆ์–ด ์ผ๋ฐ˜ํ™”๋˜์ง€ ์•Š์€ View ๊ตฌํ˜„์œผ๋กœ, ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ผ๊ด€๋˜๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ๋น„ํšจ์œจ์ ์ธ ๋ฐ˜๋ณต ์ž‘์—…์ด ์žˆ์–ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋”๋ถˆ์–ด ๋‚ด์šฉ ๊ฒฐํ•ฉ๋„๋ฅผ ๊ฐ€์ง„ BottomMenuViewController์™€ ๊ฐ™์ด, ๊ฐ์ฒด ๊ฐ„ ๊ฒฐํ•ฉ๋„๊ฐ€ ๋†’์•„ ๊ธฐ๋Šฅ ๋ณ€๊ฒฝ ๋ฐ ๊ฐœ์„  ์‹œ ์ง„ํ–‰์˜ ์–ด๋ ค์›€์ด ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. (๋‚ด์šฉ ๊ฒฐํ•ฉ๋„: ๊ฐœ์ฒด ๊ฐ„ ์ธํ„ฐํŽ˜์ด์Šค ์—†์ด ๋‚ด๋ถ€์— ์ง์ ‘ ์ ‘๊ทผํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋Š” ๊ด€๊ณ„) ๐Ÿ•ต๏ธ ๋ฌธ์ œ ํ•ด๊ฒฐ๋ฒ•์•„ํ‚คํ…์ฒ˜ ํŒจํ„ด์„ ๋„์ž…ํ•ด, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์‹œ์Šคํ…œ ๊ตฌ์กฐ์™€ ์—ญํ• ์„ ๋ช…ํ™•ํžˆ ํ•˜์—ฌ ํ”„๋กœ์ ํŠธ์˜ ๊ฐ€๋…์„ฑ์„ ํ–ฅ์ƒ์‹œํ‚ค๊ณ  ๊ฐœ์ฒด ๊ฐ„ ์ ์ ˆํ•œ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ ์šฉํ•˜์—ฌ ๊ฒฐํ•ฉ๋„๋ฅผ ๋‚ฎ์ถ”๊ธฐ๋กœ ๊ฒฐ์ •ํ–ˆ์Šต๋‹ˆ๋‹ค. ํŠนํžˆ View์˜ ์ผ๋ฐ˜ํ™”์— ์ง‘์ค‘..

[ iOS ์‹œํ–‰์ฐฉ์˜ค ] CollectionView์— Cell์ด ํ•˜๋‚˜๋งŒ ๋ณด์ด๋Š” ์ด์œ 

๐Ÿ‘ฉ‍๐Ÿ’ป๋ฐฐ๊ฒฝ๐Ÿ‘ฉ‍๐Ÿ’ปChapterList๋ฅผ ๊ฐœ๋ฐœํ•˜๋˜ ์ค‘, ๋ถ„๋ช… item์ด 3๊ฐœ๊ฐ€ ์žˆ๋Š”๋ฐ cell์ด 1๊ฐœ๋งŒ ๋ณด์ด๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค! ๊ทธ๋ž˜์„œ ์ด์ „์— ์ž‘์—…ํ–ˆ๋˜ BookList์—์„œ๋„ ํ™•์ธํ•ด ๋ณด๋‹ˆ ๋˜‘๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.. BookList์—์„œ๋Š” item์ด ํ•˜๋‚˜๋งŒ ์žˆ์—ˆ๋˜์ง€๋ผ ๋ฐœ๊ฒฌํ•˜์ง€ ๋ชปํ–ˆ๋˜ ๊ฒƒ ๊ฐ™๋‹ค. ๋ถ„๋ช… BookList์— ๊ฐ์ฒด๊ฐ€ 3๊ฐœ๊ฐ€ ๋‹ด๊ธด ์ƒ˜ํ”Œ ๋ฐ์ดํ„ฐ๋ฅผ ์ ์šฉํ•  ๋•Œ๋งŒ ํ•ด๋„ ํ™”๋ฉด์— item๋“ค์ด ์ž˜ ๋‚˜ํƒ€๋‚ฌ๋Š”๋ฐ, ์‹ค์ œ ๋ฐ์ดํ„ฐ๋ฅผ ์ ์šฉํ•œ ๋’ค ์ž‘์—…ํ–ˆ๋˜ Section๋ณ„ UI ์ž‘์—…์—์„œ ๋กœ์ง์ด ๋ฐ”๋€Œ๋ฉด ๋ฐœ์ƒํ•œ ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค. CollectionViewLayout๋ถ€ํ„ฐ DiffableDataSource๋ฅผ ๊ฑฐ์ณ Snapshot๊นŒ์ง€ ๋ฌธ์ œ๋ฅผ ์ฐพ์•„๋ณด๋Š” ๊ณผ์ •์„ ๊ธฐ๋กํ•ด๋ณด์ž~      ๐Ÿ–ผ๏ธ CollectionViewCompositionalLa..

[ iOS ] CompositionLayout ๋ฐฉํ–ฅ ์ดํ•ดํ•˜๊ธฐ

๐Ÿ“– CompositionalLayoutCollectionView์˜ CompositionalLayout์€ Section, Group, Item์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ๋‹ค. ์—ฌ๊ธฐ์—์„œ Group์€ NSCollectionLayoutItem ์˜ ํ•˜์œ„ ํด๋ž˜์Šค์ด๊ธฐ ๋•Œ๋ฌธ์— Group ์•ˆ์— Group์ด ๋“ค์–ด๊ฐˆ ์ˆ˜๋„ ์žˆ๋‹ค.       ๐Ÿšฅ Section๊ณผ Group์˜ ๋ฐฉํ–ฅCompositionalLayout์—์„œ๋Š” Section์˜ ๋ฐฉํ–ฅ๊ณผ Group์˜ ๋ฐฉํ–ฅ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. Group์˜ item ๋ฐฐ์น˜ ๋ฐฉํ–ฅ์€ .vertical๊ณผ .horizontal ๋ฉ”์„œ๋“œ๋กœ ์ง€์ •ํ•ด์ค„ ์ˆ˜ ์žˆ๊ณ , Section์˜ scroll ๋ฐฉํ–ฅ์€ UICollectionViewCompositionalLayoutConfiguration์„ ํ†ตํ•ด ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.  ์œ„ ๊ทธ๋ฆผ์„..

iOS 2024.06.27

[ iOS ] ๋ฐ์ดํ„ฐ ์œ ๋ฌด์— ๋”ฐ๋ผ CollectionView UI ๋ณ€๊ฒฝํ•˜๊ธฐ with DiffableDataSource, Snapshot

๊ธ€์„ ๊ฒŒ์‹œํ•œ ์ดํ›„ ์ฝ”๋“œ์— ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค๋Š” ๊ฑธ ๋ฐœ๊ฒฌํ•ด ์ด๋ฅผ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ๊นŒ์ง€ ์‹œํ–‰์ฐฉ์˜ค๊ฐ€ ๊ถ๊ธˆํ•˜์‹œ๋‹ค๋ฉด ์ด ๊ธ€ ๋ด์ฃผ์„ธ์š”~ [ iOS ์‹œํ–‰์ฐฉ์˜ค ] CollectionView์— Cell์ด ํ•˜๋‚˜๋งŒ ๋ณด์ด๋Š” ์ด์œ ๐Ÿ‘ฉ‍๐Ÿ’ป๋ฐฐ๊ฒฝ๐Ÿ‘ฉ‍๐Ÿ’ปChapterList๋ฅผ ๊ฐœ๋ฐœํ•˜๋˜ ์ค‘, ๋ถ„๋ช… item์ด 3๊ฐœ๊ฐ€ ์žˆ๋Š”๋ฐ cell์ด 1๊ฐœ๋งŒ ๋ณด์ด๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค! ๊ทธ๋ž˜์„œ ์ด์ „์— ์ž‘์—…ํ–ˆ๋˜ BookList์—์„œ๋„ ํ™•์ธํ•ด ๋ณด๋‹ˆ ๋˜‘๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.. BookList88yhtserof.tistory.com         1๏ธโƒฃ ๊ตฌํ˜„ํ•˜๊ธฐ ์ „์— ๋จผ์ € ์•Œ์•„๋ณด๊ธฐ โ˜๏ธ ๊ตฌํ˜„ ๊ฐ„๋žต ์š”์•ฝCell๊ณผ Section, Item์„ BookList์™€ Empty ๋‘ ๊ฒฝ์šฐ๋กœ ๊ตฌ๋ถ„ํ•˜์—ฌ, ๋ฐ์ดํ„ฐ ์œ ๋ฌด๋ฅผ ํ™•์ธํ•œ ํ›„ DiffableDataSource์— Cell์„ ๋“ฑ..

iOS 2024.06.17

[ ์งง์€ ] 5 - ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ ํ•˜๋‚˜ ์ดํ•ด ํ•˜๋ ค๋‹ค

5๏ธโƒฃ ๋ฒˆ ๊ธ€์„ ์‹œ์ž‘ํ•˜๋ฉฐ ๊ตฌ๊ธ€๋ง์„ ํ•˜๋‹ค ๋ณด๋ฉด ์ •๋ง ๋งŽ์€ ๋ธ”๋กœ๊ทธ ๊ธ€์„ ๋ณด๊ฒŒ ๋˜๋Š”๋ฐ, ํŽธํ•˜๊ฒŒ ์ ์€ ๋“ฏ ํ•˜๋ฉด์„œ๋„ ๋‚ด์šฉ ์ „๋‹ฌ์ด ์ž˜ ๋˜๋Š” ๊ธ€์„ ๋ณด๋ฉด '์ด ๊ธ€์„ ์“ธ ๋•Œ ์–ผ๋งˆ๋‚˜ ๋งŽ์€ ์‹œ๊ฐ„์„ ๋“ค์˜€์„๊นŒ' ์ƒ๊ฐ์ด ๋“ค์–ด ์ข‹์•„์š”๋ฅผ ๊ผญ ๋ˆ„๋ฅด๊ณ  ๋‚˜์˜จ๋‹ค. ์ด๋Ÿฐ ์ƒ๊ฐ์ด ๋“œ๋Š” ๋งŒํผ ๋‚˜๋Š” ๋ธ”๋กœ๊ทธ ๊ธ€์„ ์“ธ ๋•Œ ์˜ค๋ž˜ ๊ฑธ๋ฆฌ๋Š”๋ฐ, ๊ทธ๋ž˜๋„ ํ•ญ์ƒ ์•„์‰ฌ์›€์ด ๋‚จ๋Š”๋‹ค. ๊ทธ๋ž˜์„œ ํ•ญ์ƒ '๊ณต๋ถ€๋ฅผ ๊ธฐ๋กํ•œ๋‹ค' ์— ์ƒ๊ฐํ•˜๋ฉฐ ๊ธ€์„ ๊ณ„์† ์จ ์™”๋Š”๋ฐ ์ง€๊ธˆ๊นŒ์ง€ ๊ธ€์ด ๊ฝค ์Œ“์—ฌ ๋ฟŒ๋“ฏํ•˜๋‹ค! ์งง์€ ์นดํ…Œ๊ณ ๋ฆฌ๋Š” ๋” ๋ถ€๋‹ด์„ ๋‚ด๋ ค๋†“๊ณ  ๊ธ€์„ ์“ฐ๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์—ˆ๋Š”๋ฐ, ํŽธํ•˜๊ฒŒ ์“ฐ๋ ค๋‹ค ๋ณด๋‹ˆ ๋” ์–ด๋ ค์šด ๊ฒƒ ๊ฐ™์•„ ๊ธ€์ด ์ž˜ ์•ˆ ์จ์ง„๋‹ค. ๊ทธ๋Ÿด ์ˆ˜๋ก ๋” ๋ถ€๋‹ด์„ ๋‚ด๋ ค ๋†“๊ณ  ํŽธํ•˜๊ฒŒ ์“ฐ๋ ค ํ•œ๋‹ค. ๐Ÿ” ํ–„๋ฒ„๊ฑฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ ์ž‘๋…„ ๋ง๋ถ€ํ„ฐ ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค 0 ๋ ˆ๋ฒจ๋ถ€ํ„ฐ ์ฐจ๊ทผ์ฐจ๊ทผ ํ’€์–ด๊ฐ€๊ณ  ์žˆ๋Š”๋ฐ ์˜ฌํ•ด ์ดˆ๋ถ€ํ„ฐ 1 ๋ ˆ๋ฒจ์— ..

์งง์€ 2024.03.29

[ iOS ] ์ž๋™ ์ฐธ์กฐ ์นด์šดํŒ…, ARC (Automatic Reference Counting)

์ž๋™ ์ฐธ์กฐ ์นด์šดํŒ… Automatic Reference Counting Swift๋Š” ์•ฑ์˜ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์„ ์ถ”์ ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์ž๋™ ์ฐธ์กฐ ์นด์šดํŒ…(ARC)๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ๋”ฐ๋ผ์„œ ๊ฐœ๋ฐœ์ž๋Š” ๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ์— ์‹ ๊ฒฝ ์“ฐ์ง€ ์•Š์•„๋„ ๋œ๋‹ค. ARC์— ์˜ํ•ด ๋” ์ด์ƒ ํ•„์š”ํ•˜์ง€ ์•Š๋Š” ์ธ์Šคํ„ด์Šค๋Š” ์ž๋™์œผ๋กœ ๋ฉ”๋ชจ๋ฆฌ์—์„œ ํ• ๋‹น ํ•ด์ œ๋˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ํ•˜์ง€๋งŒ ํด๋ž˜์Šค ๋“ฑ๊ณผ ๊ฐ™์ด ์ฐธ์กฐํƒ€์ž…์˜ ๊ฒฝ์šฐ ์ฐธ์กฐ ๊ด€๊ณ„์— ์˜ํ•ด ์ž๋™ ๋ฉ”๋ชจ๋ฆฌ๊ด€๋ฆฌ๊ฐ€ ๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ์ด๋Ÿฌํ•œ ๊ฒฝ์šฐ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋‚ญ๋น„๋˜๋Š”๋ฐ, ์ด๋ฅผ ๋ฉ”๋ชจ๋ฆฌ ๋ˆ„์ˆ˜(memory leak)๋ผ๊ณ  ํ•œ๋‹ค. ๊ฐ„๋‹จํ•˜๊ฒŒ ์ƒ๊ฐํ•˜๋ฉด, ์‚ฌ์šฉํ•˜์ง€๋„ ์•Š๊ณ  ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์—†๋Š” ์ง์ด ๋ฐฉ ํ•œ ์ผ ์— ๊ณ„์† ์กด์žฌํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ARC ์˜ ์ž‘๋™์›๋ฆฌ ํด๋ž˜์Šค์˜ ์ƒˆ๋กœ์šด ์ธ์Šคํ„ด์Šค๊ฐ€ ์ƒ์„ฑ๋  ๋•Œ, ARC๋Š” ํ•ด๋‹น ์ธ์Šคํ„ด์Šค์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๋ฉ”๋ชจ๋ฆฌ ์ฒญํฌ์— ํ• ๋‹น..

iOS 2024.03.27

[ iOS ] ํ™”๋ฉด ์บก์ณํ•˜๊ธฐ - UIGraphicsRenderer

๐Ÿ”ซ ๋ฌธ์ œ ๋ฐœ์ƒ iOS 17๊ฐ€ ๋ฐœํ‘œ๋˜๋ฉฐ, ์•ฑ์Šคํ† ์–ด์— ๋ฐฐํฌํ•œ ์„œ๋น„์Šค์— ํ˜น์‹œ deprecated๋œ ํด๋ž˜์Šค๋‚˜ ๋ฉ”์„œ๋“œ๊ฐ€ ์žˆ์„๊นŒ ์‹ถ์–ด ์ฐพ์•„๋ดค๋‹ค. ์ •๋ง ์•ˆํƒ€๊น๊ฒŒ๋„ '์ด๋ฏธ์ง€ ๊ณต์œ ํ•˜๊ธฐ' ๊ธฐ๋Šฅ์—์„œ ์‚ฌ์šฉํ–ˆ๋˜ UIGraphicsBeginImageContextWithOptions(_:_:_:)๊ฐ€ iOS 17.0 ๋ฒ„์ „๊นŒ์ง€๋งŒ ์ œ๊ณต๋œ๋‹ค๊ณ  ํ•œ๋‹ค... ๊ทธ๋ž˜์„œ ์–ด๋–ป๊ฒŒ ๋ฒ„์ „ ์—…์„ ํ• ๊นŒ ๊ฑฑ์ •ํ•˜๋ฉฐ ๊ณต์‹ ๋ฌธ์„œ์—์„œ Graphic, Image, Render๋ฅผ ํ‚ค์›Œ๋“œ๋กœ ๋น„์Šทํ•œ ๊ธฐ๋Šฅ์„ ํ•˜๋Š” ํด๋ž˜์Šค ๋˜๋Š” ๋ฉ”์„œ๋“œ๋ฅผ ์ฐพ์•„๋ดค๋‹ค. ๋‹คํ–‰ํžˆ ๋ฉ€์ง€ ์•Š๊ฒŒ Drawing ์นดํ…Œ๊ณ ๋ฆฌ์—์„œ UIGraphicsRenderer ํด๋ž˜์Šค๋ฅผ ๋ฐœ๊ฒฌํ–ˆ๋‹ค! ์ด์ œ ์ด ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ iOS 17 ์ดํ›„๋ฅผ ๋Œ€์‘ํ•˜๋Š” ๋ฆฌํŒฉํ† ๋ง์„ ์‹œ์ž‘ํ•ด๋ณด์ž. ๐ŸŽจ UIGraphicsRenderer UIGraphics..

iOS 2023.12.22

[ iOS ] ์—ด๊ฑฐํ˜•์˜ ์›์‹œ๊ฐ’์œผ๋กœ ํŠœํ”Œ ์‚ฌ์šฉํ•˜๊ธฐ

enum Direction: String { case up = "์ƒ" case down = "ํ•˜" case left = "์ขŒ" case right = "์šฐ" } let direction: Direction = .right print(direction.right) /// print "์šฐ" ์—ด๊ฑฐํ˜•์—๋Š” ์›์‹œ๊ฐ’(rawValue)์ด ์žˆ์–ด ์œ„์˜ ์˜ˆ์‹œ์ฒ˜๋Ÿผ ๊ฐ’์„ case๋ณ„๋กœ ๊ฐ’์„ ํ• ๋‹นํ•ด ํ•„์š”ํ•  ๋•Œ ๊บผ๋‚ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•˜์ง€๋งŒ ํ•œ ๊ฐ€์ง€ ์œ ์˜ํ•  ์ ์€, ์ด ์›์‹œ๊ฐ’์€ Literal ํƒ€์ž…๋งŒ ๊ฐ€๋Šฅํ•˜๋‹ค. Literal์€ ๊ณต์‹๋ฌธ์„œ์—์„œ "์ˆซ์ž๋‚˜ ๋ฌธ์ž์—ด ๊ฐ™์€ ํƒ€์ž…์˜ ๊ฐ’ ํ‘œํ˜„"์ด๋ผ ์„ค๋ช…๋˜์–ด ์žˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๊ณ  ํƒ€์ž…์„ ๊ฐ–๊ณ  ์žˆ์ง€๋Š” ์•Š๋‹ค. ํ•˜์ง€๋งŒ literal์€ ์•„์ฃผ์•„์ฃผ ์ •ํ™•ํ•˜์—ฌ Swift์˜ ํƒ€์ž… ์ถ”๋ก  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•ด ํƒ€์ž…์ด ์ถ”๋ก ๋œ๋‹ค. ๋”ฐ๋ผ์„œ ..

iOS 2023.12.01

[ iOS ] MVC - 3 ) Controller ๊ฐ์ฒด

Controller object๋ฅผ ์ฝ๊ณ  ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. Controller object Retired Document Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid. Controller object A controller object acts as a coordinator or as an intermediary between one developer.apple.com Controller object Controller ๊ฐ์ฒด๋Š” ํ•˜๋‚˜ ์ด์ƒ์˜ ๋ทฐ ๊ฐ์ฒด์™€ ๋ชจ๋ธ ๊ฐ์ฒด ์‚ฌ์ด์˜ ์กฐ์ •์ž ๋˜๋Š” ์ค‘์žฌ์ž๋กœ์„œ ๋™์ž‘..

iOS 2023.11.18

[ iOS ] MVC - 2 ) Model ๊ฐ์ฒด

Model Object๋ฅผ ์ฝ๊ณ  ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. Model object Retired Document Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid. Model object A model object is a type of object that contains the data of an application, pro developer.apple.com Model object ๋ชจ๋ธ ๊ฐ์ฒด๋Š” MVC ๋””์ž์ธ ํŒจํ„ด ์ค‘ Model์— ํ•ด๋‹นํ•˜๋Š” ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•˜๋ฉฐ, ๋ชจ๋ธ ๊ฐ์ฒด์˜ ์ฃผ์š” ์—ญํ• ์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค: ๋ฐ์ดํ„ฐ ..

iOS 2023.11.18

[ iOS ] MVC - 1) MVC๋ž€?

Model - View - Controller ์•„ํ‹ฐํด์„ ์ฝ๊ณ  ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. Model-View-Controller Retired Document Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid. Model-View-Controller The Model-View-Controller (MVC) design pattern assigns objects in an ap developer.apple.com MVC๋ž€? MVC๋Š” Model - View - Controller ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋Š” ๋””์ž์ธ ํŒจํ„ด์œผ๋กœ..

iOS 2023.10.17

[ ์งง์€ ] 3 - MVC ๊ณต๋ถ€๋ฅผ ์‹œ์ž‘ํ•˜๋ฉฐ

3๏ธโƒฃ ์„ธ ๋ฒˆ์งธ '์งง์€'์„ ์‹œ์ž‘ํ•˜๋ฉฐ '์งง์€' ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์‹œ์ž‘ํ•œ ์ด์œ ๊ฐ€ ์ƒˆ๋กœ ๋ฐฐ์šด ๋‚ด์šฉ์ด ์žˆ์ง€๋งŒ ์‹œ๊ฐ„ ์ƒ์˜ ์ด์œ ๋กœ ์ •๋ฆฌํ•˜์ง€ ๋ชปํ•˜๋Š” ์ƒํ™ฉ์ด ์•„์‰ฌ์›Œ์„œ ์ธ๋ฐ, ๋‘ ๋ฒˆ์งธ ๊ธ€ ์ดํ›„ ๋ฐ”๋น ์„œ ๋˜๋Š” ๋‹ค๋ฅธ ๊ธ€์„ ์“ฐ๋Š๋ผ ๋‘ ๋‹ฌ์ด ์ง€๋‚˜๋„๋ก ์„ธ ๋ฒˆ์งธ ๊ธ€์„ ์“ฐ์ง€ ๋ชปํ–ˆ๋‹ค๐Ÿ˜ฉ ๊ทธ๋ž˜์„œ '์งง์€' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ์˜์—ญ์„ ํ™•์žฅํ•ด, ์•ž์œผ๋กœ ์ •๋ฆฌํ•  ์ฃผ์ œ์— ๋Œ€ํ•œ ๊ณ„๊ธฐ์™€ ์˜์ง€๋ฅผ ์ ์–ด๋ณด๊ณ ์ž ํ•œ๋‹ค! ๐Ÿ’ญ MVC์™€์˜ ๊ธฐ์–ต ์•„ํ‚คํ…์ฒ˜ ํŒจํ„ด์€ ์œ ์ง€๋ณด์ˆ˜, ๋ฌธ์ œ ๋ฐœ์ƒ ๋ฐฉ์ง€, ๋†’์€ ์žฌ์‚ฌ์šฉ์„ฑ ๋“ฑ์˜ ์ด์œ ๋กœ ํ”„๋กœ์ ํŠธ์— ์ ์šฉ๋˜๋ฉฐ, ์œ ๋ช…ํ•œ ํŒจํ„ด์œผ๋กœ๋Š” MVC, MVVM์ด ์žˆ๋‹ค. ์•„ํ‚คํ…์ณ์™€ ๊ด€๋ จํ•ด ๊ฐœ๋ฐœ์ž๋ผ๋ฉด ํ•œ ๋ฒˆ์ฏค ๋“ค์–ด๋ณธ ์–˜๊ธฐ๊ฐ€ ์žˆ๋‹ค. MVC์˜ M์€ 'masive'๋ผ๋Š” ์˜๋ฏธ๊ฐ€ ์•„๋‹๊นŒ ํ•˜๋Š” ์ •๋„๋กœ view controller๋งŒ ๋น„๋Œ€ํ•ด์ง€๋ฉฐ ์ด๋Š” ๋น„ํšจ์œจ์ ์ธ ํŒจํ„ด์ด๋‹ค. ๊ทธ๋Ÿฌ๋‹ˆ ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜..

์งง์€ 2023.10.11
728x90