์ „์ฒด ๊ธ€

UIKit์œผ๋กœ ๊ฐœ๋ฐœํ•˜๋‹ค๊ฐ€ ํ˜„์žฌ๋Š” SwiftUI๋กœ ์„œ๋น„์Šค ๊ฐœ๋ฐœํ•˜๊ณ  ์žˆ๋Š” Fram์ž…๋‹ˆ๋‹ค SwiftUI์™€ Combine์— ๋Œ€ํ•ด ์•Œ๊ฒŒ ๋œ ๊ฒƒ๊ณผ ๊ธฐ์ˆ ์„ ๊ณต์œ ํ•˜๋Š” ๋ธ”๋กœ๊ทธ ์ž…๋‹ˆ๋‹ค. ์ฃผ์˜ : ์ ์—ˆ๋˜๊ฑฐ ๋˜ ์ ์„ ์ˆ˜ ์žˆ์Œ
์ถœ์ฒ˜ ๋ฐ ์ฐธ๊ณ  ์‚ฌ์ดํŠธ https://axiomatic-fuschia-666.notion.site/Chapter-3-TCA-2-c56b24efb2154dad9ed8e54139247024 Chapter 3. TCA์˜ ๊ธฐ๋ณธ๊ฐœ๋…(2) ์•ž์„  ์žฅ์—์„œ ์šฐ๋ฆฌ๋Š” ์•ฑ์˜ ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” State์™€ ์ด๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜๋‹จ์ธ Action, ๊ทธ Action์˜ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๊ณ  ์ƒํƒœ์˜ ๋ณ€๊ฒฝ์„ ์ฒ˜๋ฆฌํ•˜๋Š” Reducer์„ ์•Œ์•„๋ณด๋ฉฐ, TCA์—์„œ์˜ ๋ฐ์ดํ„ฐํ๋ฆ„์— ๋Œ€ํ•ด์„œ ์‚ดํŽด๋ณด์•˜์Šต๋‹ˆ axiomatic-fuschia-666.notion.site Effect๋ž€? Action์ด ๋ฐ˜ํ™˜ํ•˜๋Š” ํƒ€์ž…์„ ๋œปํ•˜๋ฉฐ Action์„ ๊ฑฐ์นœ ๋ชจ๋“  ๊ฒฐ๊ณผ๋ฌผ์„ ์˜๋ฏธํ•œ๋‹ค. ๋น„๋™๊ธฐ ์ž‘์—…์ด๋‚˜ ์™ธ๋ถ€ ์ž‘์šฉ์— ์˜ํ•ด ๋ฐœ์ƒํ•˜๋Š” Side Effect๋Š” ์–ด๋–ค ์ฒ˜๋ฆฌ ์ดํ›„ ์˜ˆ์ƒ์น˜ ๋ชปํ•˜๊ฒŒ ์–ป์€ ๊ฒฐ๊ณผ๋ฌผ์„..
ํ”„๋ฆฌ๋ทฐ์—์„œ not building -Onone๋กœ ๋กœ๋“œ๊ฐ€ ์•ˆ๋˜๋ฉด Edit Scheme ๋ˆ„๋ฅด๊ณ  Build Configuration ์—์„œ Debug๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š” ํ…Œ์ŠคํŠธ ํ•œ๋‹ค๊ณ  ์ž ์‹œ ๋ฐ”๊ฟจ๋‹ค๊ฐ€ ๊นŒ๋จน๊ณ  ํ”„๋ฆฌ๋ทฐ ์ผœ๋‹ˆ ์•ˆ๋˜์„œ ๋‹นํ™ฉ;; ํ”„๋ฆฌ๋ทฐ ๋„๋Œ€์ฒด ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„๋˜์–ด ์žˆ๋Š”๊ฑด์ง€ ์‹ ๊ธฐ
.overlay( Rectangle() .stroke(PWColor.gray100, lineWidth: 1) ) // .border(PWColor.gray100, width: 1) ์•„๋ž˜border์„ ์‚ฌ์šฉํ•˜๋ฉด frame์œผ๋กœ ์ธ์‹ํ•˜๊ฒŒ ๋จ. ํ•ด๋‹น ์˜์—ญ ๊นŒ์ง€ ์žกํ˜€์„œ VStack์œผ๋กœ ์Œ“์œผ๋ฉด ์ค‘๊ฐ„์€ 2๊ฐ€ ๋จ
TCA๋ฅผ ๊ณต๋ถ€ํ•˜๋‹ค๊ฐ€ Timer ์˜ˆ์‹œ๋กœ ๋ฌด์—‡์„ ๊ตฌํ˜„ํ•˜๋ฉด ์ข‹์„๊นŒ ์ƒ๊ฐํ•ด ๋ดค๋”๋‹ˆ ์‡ผํ•‘๋ชฐ ์•ฑ์ด ๋– ์˜ค๋ฅด๋”๋ผ๊ตฌ์š”! ์˜ค๋Š˜ ์ž์ •๊นŒ์ง€์˜ ๋‚จ์€ ์‹œ๊ฐ„์„ ๊ณ„์‚ฐํ•ด์„œ ์˜ค๋Š˜์ด ์ง€๋‚˜๋ฉด ๊ตฌ๋งคํ•  ์ˆ˜ ์—†๋„๋ก ๋ฒ„ํŠผ์„ ๋น„ํ™œ์„ฑํ™” ์‹œํ‚ฌ๊ฑฐ์—์š”. ํƒ€์ด๋จธ๋ฅผ ํ‘œ์‹œํ•˜๋Š” ์ € ๋ถ€๋ถ„์ด ๊ตฌ๋งค ๋ฒ„ํŠผ์ž…๋‹ˆ๋‹ค. ๊ตฌํ˜„ํ•ด ๋†“๊ณ  ๋ณด๋‹ˆ ํƒ€์ด๋จธ UI์™€ ๊ตฌ๋งคํ•˜๊ธฐ ๋ฒ„ํŠผ์„ ๋ณ„๋„๋กœ ๋ถ„๋ฆฌํ•  ๊ฑธ ๊ทธ๋žฌ์–ด์š” ๐Ÿฅฒ State struct State: Equatable { var isTimerOn = false var leftTime = "00:00:00" var isBuyButtonDisabled = true } isTimerOn์ด true๊ฐ€ ๋˜๋ฉด ํƒ€์ด๋จธ๋ฅผ ์‹œ์ž‘ํ•˜๊ณ  false๊ฐ€ ๋˜๋ฉด ํƒ€์ด๋จธ๋ฅผ cancel ์‹œ์ผœ์ค๋‹ˆ๋‹ค. leftTime์€ ๋ฒ„ํŠผ ์˜์—ญ์˜ ์‹œ๊ฐ„ ๋ถ€๋ถ„์— ํ‘œ์‹œ๋  ์ŠคํŠธ๋ง ๊ฐ’์ด์—์š”. isBuy..
์ฐธ๊ณ  ์‚ฌ์ดํŠธ https://axiomatic-fuschia-666.notion.site/Chapter-1-Hello-TCA-70c56437681547d4b85cd1363a157356 Chapter 1. Hello, TCA ์•ˆ๋…•ํ•˜์„ธ์š”. Swift๋กœ Apple ์ƒํƒœ๊ณ„ ๊ฐœ๋ฐœ์— ์ผ์กฐํ•ด ์ฃผ์‹œ๋Š” ๊ฐœ๋ฐœ์ž ์—ฌ๋Ÿฌ๋ถ„, ๋ชจ๋‘ ๋ฐ˜๊ฐ‘์Šต๋‹ˆ๋‹ค! axiomatic-fuschia-666.notion.site https://www.pointfree.co/collections/tours/composable-architecture-1-0/ep243-tour-of-the-composable-architecture-1-0-the-basics Episode #243: Tour of the Composable Architecture: The Ba..
์ด์ „์— ์–ด๋Š ์„œ๋น„์Šค์—์„œ๋„ ๊ทธ๋žฌ์ง€๋งŒ ๊ฐ€์ž…์‹œ ๋ฐ›์•„์•ผ ํ•˜๋Š” ์„œ๋ฅ˜ ์ค‘ ์ˆ˜๊ธฐ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ์ด๋ฒˆ ์„œ๋น„์Šค ๋˜ํ•œ ์ตœ๋Œ€ 5๊ฐœ์˜ ์„œ๋ฅ˜๋ฅผ ๋ฐ›์•„์•ผ ํ•˜๊ณ , ๊ทธ ์„œ๋ฅ˜๊ฐ€ ์œ ํšจํ•œ์ง€ ์ˆ˜๊ธฐ๋กœ ๊ฒ€์ฆ ํ›„์— ๊ฐ€์ž…์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค. ์ฒจ๋ถ€ ํ›„ ์‚ฌ์šฉ์ž๊ฐ€ ๋ณ„๋„๋กœ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ ์ฒจ๋ถ€๋จ- ์ƒํƒœ ํ‘œ์‹œ ํ›„ ๋์ด๊ธฐ ๋•Œ๋ฌธ์—, ์‚ฌ์šฉ์ž๊ฐ€ ๊ฐค๋Ÿฌ๋ฆฌ์—์„œ ํ„ฐ์น˜ ํ•œ๋ฒˆ ์ž˜ ๋ชป ํ•ด์„œ ์ด์ƒํ•œ ์‚ฌ์ง„์ด ๋“ค์–ด๊ฐ€๋ฉด ์•Œ ๋ฐฉ๋ฒ•์ด ์—†๋‹ค. ์ด ํ›„ CS์—์„œ๋Š” ์‚ฌ์šฉ์ž์™€ ์—ฐ๋ฝํ•˜๊ณ  ์ˆ˜์ •ํ•˜๋Š” ๊ณผ์ •์„ ๊ฑฐ์ณ์•ผ ํ•œ๋‹ค. ์™„์ „ํžˆ VisionKit์—๊ฒŒ ๋งก๊ธฐ๋Š” ๊ฒƒ์€ ๋ฌด๋ฆฌ์ด๊ฒ ์ง€๋งŒ, ๊ธ€์ž๋ฅผ ์ถ”์ถœํ•ด์„œ ์˜์‹ฌ์Šค๋Ÿฌ์šด ์„œ๋ฅ˜๋Š” ์–ผ๋Ÿฟ ์ฐฝ ํ•œ๋ฒˆ ๋„์›Œ์„œ ์ธ์‹ ์‹œ์ผœ์ฃผ๋Š” ๊ฒƒ๋„ ๋‚˜์˜์ง€ ์•Š๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ๋‹ค. CS ํŒ€ ์—…๋ฌด๋ฅผ ์กฐ๊ธˆ ์ค„์—ฌ๋“ค์ผ ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ?! ์• ํ”Œ์—์„œ ์ง€์›ํ•˜๋Š” VisionKit์œผ๋กœ ํ…์ŠคํŠธ๋ฅผ ์ธ์‹..
์•„๋ฌด๋ฆฌ ๋ด๋„ ํƒญ ๋ฐ”๊ฐ€ ๋งž๋Š”๊ฑฐ ๊ฐ™์€๋ฐ ๋””์ž์ธํŒ€์ด ํ† ๊ธ€์ด๋ผ ํ•˜๋‹ˆ ์šฐ์„  ํ† ๊ธ€์ธ๊ฑธ๋กœ..!! ๋ญ 2๊ฐœ๋ฉด ํ† ๊ธ€ ๋งž์ง€! ์„œ๋ฒ„๋กœ ๋ถ€ํ„ฐ ๋ช‡ ๊ฐœ๊ฐ€ ์˜ฌ์ง€ ๋ชจ๋ฅด๊ณ , ํ•ด๋‹น ์˜์—ญ์„ ํƒญํ–ˆ์„ ๋•Œ ํ† ๊ธ€ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์‹คํ–‰๋˜์•ผ ํ•œ๋‹ค. Namespace๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ž์—ฐ์Šค๋Ÿฌ์šด ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฌผ๋ก  animation ์„ ์‚ฌ์šฉํ•ด๋„ ๋œ๋‹ค! ์ฒ˜์Œ์— GeometryReader๋กœ ์œ„์น˜๋ฅผ ๊ณ„์‚ฐ ํ•œ ๋’ค ํ•˜๋‚˜์˜ View์˜ ์œ„์น˜๋ฅผ ๋ณ€๊ฒฝํ•ด ์ฃผ์—ˆ๋”๋‹ˆ offset๊ณผ padding ์œผ๋กœ ๋ทฐ ๊ณ„์ธต์„ ๋ฐ”๊ฟจ์„ ๋•Œ ์ด์Šˆ๊ฐ€ ์žˆ์—ˆ๋‹ค. GeometryReader๋กœ ๊ณ„์‚ฐ ํ•œ ์œ„์น˜๊ฐ€ ๋‹ฌ๋ผ์ ธ์„œ ์—‰๋šฑํ•œ ๊ณณ์—์„œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ๊ฐ€ ์‹œ์ž‘๋˜๊ณ  ์›€์ง์˜€๋‹ค. struct CustomToggle: View { let priceList = ["on", "off", "test"] /// ํ† ๊ธ€ ..
struct TipBubbleShape: Shape, InsettableShape { private var insetValue = 0.0 func inset(by amount: CGFloat) -> some InsettableShape { var bubble = self bubble.insetValue = amount return bubble } func path(in rect: CGRect) -> Path { let width = rect.width let height = rect.height let radius = rect.height / 2.0 let midpoint = radius * 0.42 let path = Path { p in p.move(to: CGPoint(x: 25, y: height..
fram
FramiOS ๐Ÿฎ