๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ 93

[ ์งง์€ ] 7 - ์ตœ๊ทผ ๊ทผํ™ฉ๊ณผ ํšŒ๊ณ 

7๏ธโƒฃ ๋ฒˆ ๊ธ€์„ ์‹œ์ž‘ํ•˜๋ฉฐ์•ˆ๋…•ํ•˜์„ธ์š”? 5๊ฐœ์›” ๋งŒ์— 7๋ฒˆ์งธ ์งง์€ ๊ธ€์„ ์“ฐ๋„ค์š”. 5๊ฐœ์›” ๋™์•ˆ ์ €๋Š” ์•„๋ฅด๋ฐ”์ดํŠธ๋„ ํ•˜๊ณ  ์ทจ์—… ์ค€๋น„๋„ ํ•˜๋‹ค๊ฐ€ ์ง€๋‚œ 9์›”์— ์ฝ”ํ…Œ ์Šคํ„ฐ๋””, ์•จ๋Ÿฐ Swift ๋ฌธ๋ฒ• ๋งˆ์Šคํ„ฐ ์Šค์ฟจ๊ณผ ํ•จ๊ป˜ 2๊ฐœ์›” ๋ฐ˜ ์ •๋„ ์ผ๊ฒฝํ—˜ ์ธํ„ด์„ ํ–ˆ์Šต๋‹ˆ๋‹ค. 9์›”์— ๋งŽ์€ ๊ฒƒ๋“ค์„ ์‹œ์ž‘ํ–ˆ๋Š”๋ฐ 11์›”๊ณผ ํ•จ๊ป˜ ๋ชจ๋‘ ๋งˆ๋ฌด๋ฆฌ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ง€๋‚œ 2๊ฐœ์›” ๋™์•ˆ ์ฐธ ๋ฐ”๋น  11์›” ๋งŒ์„ ๊ธฐ๋‹ค๋ ธ๋Š”๋ฐ ๋‹ค ๋๋‚˜๊ณ  ๋‚˜๋‹ˆ ์•„์‰ฌ์›€๋งŒ ๋‚จ๋„ค์š”. 7์›”๋ถ€ํ„ฐ ๋Ÿฐ๋ฐ์ด๋ฅผ ์‹œ์ž‘ํ–ˆ๋Š”๋ฐ ๊ทธ ๋•๋ถ„์— 11์›”๊นŒ์ง€ ์ง€์น˜์ง€ ์•Š๊ณ  ์ž˜ ๋‹ฌ๋ ค์™”๋˜ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๐Ÿ‘” ๋‚˜์˜ ์ฒซ ์ธํ„ด ์ƒํ™œ์ด๋ฒˆ ์ธํ„ด์œผ๋กœ ์ž…์‚ฌํ–ˆ๋˜ ํšŒ์‚ฌ๋Š” ์ €์˜ ์ฒซ ํšŒ์‚ฌ์˜€๋Š”๋ฐ ์ •๋ง ์ƒˆ๋กœ์šด ๊ฒฝํ—˜์ด์—ˆ์Šต๋‹ˆ๋‹ค. ์ฒซ ํšŒ์‚ฌ์ด๊ธฐ์— ์ž…์‚ฌ ์ „ ๊ฑฑ์ •์ด ๋งŽ์•˜๋Š”๋ฐ ์ •๋ง ์ข‹์€ ํšŒ์‚ฌ๋ฅผ ๋งŒ๋‚˜ 2๋‹ฌ ๋ฐ˜๋™์•ˆ ์ฆ๊ฒ๊ฒŒ ํšŒ์‚ฌ๋ฅผ ๋‹ค๋…”์Šต๋‹ˆ๋‹ค. ๋ถ„๋ช… ์ธํ„ด์ด๊ธฐ์— ์ฆ๊ฑฐ์› ๋˜ ๋ถ€๋ถ„..

์งง์€ 2024.11.12

[ 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

[ ์งง์€ ] 6 - iOS ๊ฐœ๋ฐœ์ž๋Š” ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ์ž๊ฒฉ์ฆ์ด ํ•„์š”ํ• ๊นŒ

6๏ธโƒฃ ๋ฒˆ ๊ธ€์„ ์‹œ์ž‘ํ•˜๋ฉฐ์ง€๋‚œ [ ์งง์€ ] ๊ธ€์„ ๋งˆ์ง€๋ง‰์œผ๋กœ ํ•œ๋™์•ˆ ๋ธ”๋กœ๊ทธ์— ์ƒˆ๋กœ์šด ๊ธ€์„ ์˜ฌ๋ฆฌ์ง€ ๋ชปํ–ˆ๋‹ค. ์–ด์ œ ๊ธ€์„ ํ•˜๋‚˜ ์˜ฌ๋ฆฌ๋ฉฐ ๋‹คํ–‰ํžˆ 3๊ฐœ์›”์„ ๋„˜๊ธฐ์ง„ ์•Š์•˜๋‹ค๐Ÿ˜ฎ‍๐Ÿ’จํ•ญ์ƒ ๊ดœ์ฐฎ์€ ๊ธ€์„ ์˜ฌ๋ฆฌ๊ณ  ์‹ถ์€ ๋งˆ์Œ์— ์กฐ๊ธˆ ๋” ๊ณต๋ถ€๋ฅผ ํ•˜๋ ค๋‹ค ๊ธ€์„ ์ž„์‹œ์ €์žฅํ•˜๊ณ , ๋˜ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•œ ํ›„ ๊ธ€๋กœ ์ •๋ฆฌํ•˜๊ธฐ ๋ณด๋‹ค๋Š” ๋นจ๋ฆฌ ๋‹ค์Œ์œผ๋กœ ๋„˜์–ด๊ฐ€ ์ง€๊ธˆ ๋‹น์žฅ ๋‚ด๊ฐ€ ๊ฒฐ๊ณผ๋ฅผ ๋‚ด์•ผํ•˜์ง€ ์•Š์„๊นŒ ํ•˜๋Š” ๋ถˆ์•ˆํ•จ์œผ๋กœ ๊ธ€์„ ์ž„์‹œ์ €์žฅํ•œ๋‹ค. ๊ทธ๋ ‡๊ฒŒ ์ž„์‹œ์ €์žฅ ๋ชฉ๋ก๋งŒ ๊ฝ‰๊ฝ‰ ์ฐจ๊ณ  ์žˆ๋‹ค..๋‚ด๊ฐ€ ๋ฐฐ์šฐ๊ณ  ๋Š๋‚€ ์ž‘์€ ๊ฒƒ์ด๋ผ๋„ ํŽธํ•˜๊ฒŒ ์ž์ฃผ ๊ธ€์„ ์“ฐ๊ธฐ ์œ„ํ•ด [ ์งง์€ ] ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ๋งŒ๋“ค์—ˆ์ง€๋งŒ, ๊ธ€์„ ์˜ฌ๋ฆฌ๊ธฐ๊นŒ์ง€ ํ•ญ์ƒ ๋งŽ์€ ๊ณ ๋ฏผ์„ ํ•˜๊ฒŒ ๋œ๋‹ค. ํ”„๋กœ์ ํŠธ์™€ ๊ฐœ์ธ ๊ณต๋ถ€, ๊ธ€ ์ •๋ฆฌ ๋“ฑ ์—ฌ๋Ÿฌ ์ผ๋“ค์— ์šฐ์„ ์ˆœ์œ„๋ฅผ ์ •ํ•˜๊ณ  ์ ์ ˆํžˆ ์‹œ๊ฐ„์„ ๋ถ„๋ฐฐํ•˜๋Š”๊ฒƒ์ด ์ค‘์š”ํ•˜๋‹ค๋Š”๊ฑธ ๋งค๋ฒˆ ๋Š๋‚€๋‹ค.ํ•˜๋‚˜์— ๋ชฐ์ž…ํ•˜์—ฌ ๋‹จ๊ธฐ๊ฐ„์— ๊ฒฐ..

์งง์€ 2024.06.19

[ 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

[ ์งง์€ ] 4 - '์•ผ๊ธฐ' ๋ฆฌํŒฉํ† ๋ง ์‹œ์ž‘!

4๏ธโƒฃ ๋ฒˆ์งธ [์งง์€] ์„ ์‹œ์ž‘ํ•˜๋ฉฐ ์ฒ˜์Œ [์งง์€] ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ๋Š” ๊ฐœ๋ฐœ ๊ณต๋ถ€๋ฅผ ์งง๊ฒŒ๋ผ๋„ ๋‚จ๊ธฐ์ž๋Š” ์ƒ๊ฐ์ด์—ˆ๋Š”๋ฐ, ์ ์  ์นดํ…Œ๊ณ ๋ฆฌ ์ฃผ์ œ๊ฐ€ ๋ฐ”๋€Œ๊ณ  ์žˆ๋‹ค. ์ด๋ž˜๋„ ๋˜๋‚˜ ์‹ถ์ง€๋งŒ ์ž˜ ์ƒ๊ฐํ•ด๋ณด๋ฉด ์›๋ž˜์˜ ๋ชฉ์ ์„ ๋ฒ—์–ด๋‚˜์ง„ ์•Š์•˜๋‹ค. [์งง์€]์€ ๋ธ”๋กœ๊ทธ์— ๊ธ€์„ ๋‚จ๊ธฐ๋Š” ๊ฒƒ์— ๋ถ€๋‹ด์„ ๋Š๋ผ์ง€ ๋ง์ž๋Š” ์ทจ์ง€๋กœ ์‹œ์ž‘ํ–ˆ๋˜ ์นดํ…Œ๊ณ ๋ฆฌ๋ผ, ์–ด๋–ค ๋‚ด์šฉ์ด๋“  ๋งˆ์Œ์ด ๊ฐ€๋Š”๋Œ€๋กœ ๊ธ€์„ ์จ์„œ ์˜ฌ๋ ธ๋‹ค๋ฉด ๊ทธ๊ฒƒ์ด ๋ฐ”๋กœ [์งง์€]์˜ ๋ชฉ์ ์„ ์ด๋ฃฌ ๊ฒƒ์ด๋ผ ์ƒ๊ฐํ•œ๋‹ค. ์–ด์ฐจํ”ผ ๋‚ด ๋ธ”๋กœ๊ทธ๋‹ˆ๊น๐Ÿ˜— ๐Ÿ’– ๊ฐ„๋‹จ ๊ธ€ ์ž‘์„ฑ ์„œ๋น„์Šค, ์•ผ๊ธฐ :) '์•ผ๊ธฐ'๋Š” ์ •๋ง ๋‚ด๊ฐ€ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ๋งŒ๋“  ์•ฑ์ธ๋ฐ, ๋งŒ๋“ ์ง€ 1๋…„ ๊ฐ€๊นŒ์ด ๋˜๋ฉด์„œ iOS ๋ฒ„์ „ ์—…์— ์˜ํ•ด ๋ฆฌํŒฉํ† ๋งํ•ด์•ผ ํ•  ๋ถ€๋ถ„๋„ ์ƒ๊ธฐ๊ณ , iOS ๊ณต๋ถ€๋ฅผ ๊พธ์ค€ํžˆ ํ•˜๋ฉด์„œ ๊ฐœ์ธ์ ์œผ๋กœ ๋ฐ”๊พธ๊ณ  ์‹ถ์€ ๋ถ€๋ถ„์ด ๋งŽ์•˜๋‹ค. ๋ฌผ๋ก  ๊ทธ 1๋…„์ด๋ž€ ๊ธฐ๊ฐ„๋™์•ˆ ๊พธ์ค€ํžˆ ์—…๋ฐ์ดํŠธ๋ฅผ ..

์งง์€ 2024.01.29

[ 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
728x90