๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90
๋ฐ˜์‘ํ˜•

ios39

[iOS/UI] ํŠน์ • ๋ถ€๋ถ„๋งŒ ํˆฌ๋ช…ํ•˜๊ฒŒ ๋งŒ๋“ค๊ธฐ (feat. fillRule, evenOdd) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ ํ”„๋กœ์ ํŠธ ์ง„ํ–‰ ์ค‘์— ํŠน์ • ๋ถ€๋ถ„๋งŒ ํˆฌ๋ช…ํ•˜๊ฒŒ ํ•ด์„œ ๊ทธ ๋ถ€๋ถ„๋งŒ ๋ณด์ด๊ฒŒ ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ๋งŒ๋“œ๋Š” ๋ฒ•์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด ๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ Preview Add a label ๋ฐฐ๊ฒฝ์— ๋ ˆ์ด๋ธ”์„ ํ•˜๋‚˜ ๋„ฃ์–ด ํˆฌ๋ช…ํ•œ์ง€ ์•„๋‹Œ์ง€ ํ™•์ธํ•˜๊ธฐ ์‰ฝ๊ฒŒ ๋งŒ๋“ค์–ด ์ฃผ๊ฒ ์Šต๋‹ˆ๋‹ค. let label = UILabel(frame: CGRect(x: view.center.x - 100, y: view.center.y - 100, width: 200, height: 200)) label.backgroundColor = .systemBlue label.textColor = .white label.font = UIFont.boldSystemFont(ofSize: 20) label.text = "Fomagran".. 2022. 7. 31.
[iOS ํ•ด๊ฒฐ๋ฒ• ํฌํ•จ] This operation could not be completed ์•ˆ๋…•ํ•˜์„ธ์š” Foma ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ iOS ํ”„๋กœ์ ํŠธ๋ฅผ ์ž‘์—…ํ•˜๋˜ ์ค‘์— git์œผ๋กœ ์–ด๋–ค ์ž‘์—…์„ ํ–ˆ๋Š”๋ฐ ์•„๋ž˜์™€ ๊ฐ™์ด ์—๋Ÿฌ๊ฐ€ ๋‚˜๋Š”๋ฐ ์™œ ์ด ์˜คํผ๋ ˆ์ด์…˜์„ ์™„์„ฑํ•  ์ˆ˜๊ฐ€ ์—†๋‹ค๋Š”๊ฑด์ง€... ์•„๋ฌด๋ฆฌ ๊ตฌ๊ธ€๋ง ํ•ด๋„ ํ•ด๊ฒฐ๋ฒ•์ด ๋‚˜์˜ค์ง€ ์•Š๋”๋ผ๊ตฌ์š”.. ๊ทธ๋ž˜์„œ ๋ฌด์ˆ˜ํ•œ ์‚ฝ์งˆ ๋์— ํ•ด๊ฒฐํ•œ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด ๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์šฐ์„  xcodeproj ํŒŒ์ผ์„ ์‹คํ–‰ ์‹œํ‚ค๋‹ˆ๊น ์ž˜๋˜๊ณ  ํ•ด๋‹น ์˜ค๋ฅ˜๊ฐ€ xcworkspace ํŒŒ์ผ์„ ์‹คํ–‰ ์‹œํ‚ฌ ๋•Œ๋งŒ ๋ฐœ์ƒํ•˜๋”๋ผ๊ตฌ์š”. ๊ทธ๋ž˜์„œ cocoapod์— ์–ด๋–ค ์˜ค๋ฅ˜๊ฐ€ ์žˆ๊ฒ ๋‹ค ์‹ถ์–ด์„œ pod์„ ์‚ญ์ œํ•˜๊ณ  xcworkspace๋„ ๋ชจ๋‘ ์‚ญ์ œํ•œ ๋’ค ๋‹ค์‹œ ์„ค์น˜ํ•ด ์ฃผ๋‹ˆ๊น ์ •์ƒ์ ์œผ๋กœ ํ•ด๊ฒฐ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. pod ์‚ญ์ œํ•˜๋Š” ๋ฐฉ๋ฒ• ํ•ด๋‹น ํ”„๋กœ์ ํŠธ๊ฐ€ ์žˆ๋Š” ๊ฒฝ๋กœ๋กœ ์ด๋™ pod deintegrate pod clean ์™œ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜์ธ์ง€๋Š” ์•„์ง ๋ชจ๋ฅด๊ฒ ์–ด์š”.. 2022. 7. 25.
[WWDC 2022] Swift๋กœ ํ”„๋กœํ† ์ฝœ ์ธํ„ฐํŽ˜์ด์Šค ์„ค๊ณ„ํ•˜๊ธฐ (Design protocol interface in Swift) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ ์ €๋ฒˆ ๊ธ€์ธ Embrace Swift Generics์—์„œ ๊ณ„์† ์–ธ๊ธ‰ํ•˜๋˜ Design protocol interface in Swift ์„ธ์…˜์— ๋Œ€ํ•ด์„œ ๋‹ค๋ค„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค! (์ €๋ฒˆ ๊ธ€๊ณผ ๋งŽ์ด ์—ฐ๊ด€๋˜์–ด ์žˆ์œผ๋‹ˆ ์•ˆ๋ณด์‹  ๋ถ„๋“ค์€ ๊ผญ ์—ฌ๊ธฐ ์—์„œ ๋ณด๊ณ  ์™€์ฃผ์„ธ์š”!) ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ Understand type erasure ๊ฐ€์žฅ ๋จผ์ € ํƒ€์ž… ์ด๋ ˆ์ด์ ธ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. (erasure๋ฅผ ์ •ํ™•ํžˆ ์–ด๋–ป๊ฒŒ ํ•ด์„ํ•ด์•ผ ํ• ์ง€ ๋ชจ๋ฅด๊ฒ ๋„ค์š”.. ์‚ญ์ œ? ์ง€์›€?) ๊ฐ€์žฅ ๋จผ์ € ๋™๋ฌผ ํ”„๋กœํ† ์ฝœ์„ ์‚ดํŽด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋™๋ฌผ ํ”„๋กœํ† ์ฝœ์€ associatedtype์œผ๋กœ ๋จน์ดํƒ€์ž…๊ณผ ์ƒ์‚ฐํ’ˆํƒ€์ž…์ด ์žˆ๊ณ , ๋ฉ”์„œ๋“œ๋กœ ๋จน์ดํƒ€์ž…์„ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ๋ฐ›๋Š” eat, ์ƒ์‚ฐํ’ˆ ํƒ€์ž…์„ ๋ฐ˜ํ™˜ํ•˜๋Š” produce ๋ฉ”์„œ๋“œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. pro.. 2022. 7. 11.
[WWDC 2022] ์ œ๋„ˆ๋ฆญ๊ณผ ํ”„๋กœํ† ์ฝœ์„ ์‚ฌ์šฉํ•ด ์ฝ”๋“œ ์ถ”์ƒํ™”ํ•˜๊ธฐ (feat. some,any) (Embrace Swift generics) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ WWDC 2022์—์„œ ์ œ๋„ˆ๋ฆญ๊ณผ ํ”„๋กœํ† ์ฝœ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ •์„(?)์œผ๋กœ ์ฝ”๋“œ๋ฅผ ์ถ”์ƒํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ๋‹ค๋ฃฌ Embrace Swift generics ์„ธ์…˜์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด ๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ (์ œ ๋ฐฉ์‹๋Œ€๋กœ ํ•ด์„ํ•˜์—ฌ ์ •๋ฆฌํ•˜๋Š” ๊ฒƒ์ด๋‹ˆ ํ‹€๋ฆฐ ์ ์ด๋‚˜ ๊ถ๊ธˆํ•œ ์ ์ด ์žˆ๋‹ค๋ฉด ์–ธ์ œ๋“  ๋Œ“๊ธ€๋กœ ์•Œ๋ ค์ฃผ์„ธ์š”!) Model with concrete types ๊ฐ€์žฅ ๋จผ์ € ์–ด๋– ํ•œ ๊ฒƒ๋„ ์ถ”์ƒํ™”๋‚˜ ์ œ๋„ˆ๋ฆญ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์žˆ๋Š” ๊ทธ๋Œ€๋กœ ์ฆ‰, ๊ตฌ์ฒด์ ์ธ ํƒ€์ž…์„ ์ด์šฉํ•ด์„œ ๋†์žฅ ์‹œ์Šคํ…œ์„ ๊ตฌํ˜„ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋†์žฅ์— ์†Œ๊ฐ€ ์žˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•˜๊ณ , ๊ทธ ์†Œ๋Š” ๊ฑด์ดˆ(Hay)๋ฅผ ๋จน๋Š” struct๋ฅผ ์ƒ์„ฑํ•ด ์ฃผ๊ฒ ์Šต๋‹ˆ๋‹ค. struct Cow { func eat(_ food:Hay) {...} } ์ด์ œ ์†Œ๊ฐ€ ๋จน๋Š” ๊ฑด์ดˆ๋Š” ์ž๋ผ๋ฉด ์•Œ.. 2022. 7. 10.
[WWDC 2022] ๊ธฐ์กด UIKit ์•ฑ์— SwiftUI ์ ์šฉํ•˜๊ธฐ (Use SwiftUI with UIKit) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ์ž…๋‹ˆ๋‹ค! ์˜ˆ์ „๋ถ€ํ„ฐ WWDC ๋‚ด์šฉ์„ ์ •๋ฆฌํ•˜๊ณ  ์‹ถ์—ˆ๋Š”๋ฐ ๋“œ๋””์–ด ์˜ค๋Š˜ WWDC์— ๋Œ€ํ•ด ๊ธ€์„ ์ž‘์„ฑํ•˜๊ฒŒ ๋˜๋„ค์š”. WWDC 2022์—์„œ ๊ฐ€์žฅ ๊ด€์‹ฌ์„ ๋Œ์—ˆ๋˜ ์„ธ์…˜์€ UIKit ์•ฑ์— SwiftUI๋ฅผ ์ ์šฉํ•˜๋Š” ์„ธ์…˜์ด์—ˆ๋Š”๋ฐ์š”. ํ•ด๋‹น ์„ธ์…˜์„ ์ง์ ‘ ๊ตฌํ˜„ํ•ด ๋ณด๊ณ  ์ •๋ฆฌํ•ด ๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ (Xcode 14 Beta๋กœ ์ง„ํ–‰๋˜๊ธฐ ๋•Œ๋ฌธ์— ํ˜น์‹œ ๋ฏธ๋ฆฌ ๊ฒฝํ—˜ํ•˜๊ณ  ์‹ถ์€ ๋ถ„๋“ค์€ ์—ฌ๊ธฐ ์—์„œ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•„์„œ ์ง„ํ–‰ํ•ด ์ฃผ์„ธ์š”~) Preview UIHostingController UIHostingController๋Š” SwiftUI ๋ทฐ๋ฅผ ํฌํ•จํ•œ UIViewController์ž…๋‹ˆ๋‹ค. UIHostingController๋ฅผ ์ด์šฉํ•˜์—ฌ UIViewController์—์„œ SwiftUI ๋ทฐ๋ฅผ ํŒ์—… ํ˜•์‹์œผ๋กœ ๋„์›Œ๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.. 2022. 7. 9.
[iOS/UI] UIBezierPath ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•˜๊ธฐ (feat. EasierPath) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ ์ง์ ‘ ์›ํ•˜๋Š” ๋ชจ์–‘์„ ๊ทธ๋ฆด ์ˆ˜ ์žˆ๋Š” UIBezierPath๋ฅผ ๋”์šฑ ์‰ฝ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” EasierPath์— ๋Œ€ํ•ด์„œ ์•Œ์•„ ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~! UIBezierPath ํ‰์†Œ์— ์›ํ•˜๋Š” ๋ชจ์–‘์„ ์ง์ ‘ ์ปค์Šคํ…€ํ•ด์„œ ๊ทธ๋ฆด ๋•Œ UIBezierPath๋ฅผ ์ž์ฃผ ์‚ฌ์šฉ ํ–ˆ์—ˆ๋Š”๋ฐ์š”. ๋จผ์ € UIBezierPath๋ฅผ ์ด์šฉํ•ด์„œ ํ•ญ์•„๋ฆฌ ๋ชจ์–‘์„ ๊ทธ๋ฆฌ๋Š” ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. 1. UIBezierPath ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•ด ๊ทธ๋ ค์ค€๋‹ค. let bezierPath:UIBezierPath = UIBezierPath() bezierPath.move(to: CGPoint(x: 100, y: 100)) bezierPath.addLine(to: CGPoint(x: 200, y: 100)) bezier.. 2022. 5. 30.
[iOS/UI] UIBezierPath ์•ˆ์„ Gradient ์ปฌ๋Ÿฌ๋กœ ์ฑ„์šฐ๊ธฐ (Fill a UIBezierPath with Gradient Color) ์•ˆ๋…•ํ•˜์„ธ์š” Foma๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ UIBezierPath ์•ˆ์„ Gradient ์ปฌ๋Ÿฌ๋กœ ์ฑ„์šฐ๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ TestView ๋ทฐ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ์ดˆ๊ธฐํ™” ํ•ด์ค๋‹ˆ๋‹ค. class TestView: UIView { override init(frame: CGRect) { super.init(frame: frame) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func draw(_ rect: CGRect) { } } UIBezierPath ์ด์ œ UIBezierPath๋ฅผ draw ๋ฉ”์„œ๋“œ ์•ˆ์— ๊ทธ๋ ค๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ํƒ€์›ํ˜• ๊ฒฝ๋กœ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ์ƒ์„ฑํ•ด ์ค๋‹ˆ๋‹ค.. 2022. 5. 2.
[iOS/UI] UIBezierPath์˜ ๊ฑฐ์˜ ๋ชจ๋“  ๊ฒƒ (feat. ๋ชจ์–‘,๊ณก์„ ,์ง์„  ๊ทธ๋ฆฌ๊ธฐ) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ ์›ํ•˜๋Š” ๋ชจ์–‘์„ ์ง์ ‘ ๊ทธ๋ฆด ์ˆ˜ ์žˆ๋Š” UIBezierPath์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ์ „๋ถ€ํ„ฐ ๋‹ค๋ฃจ๊ณ  ์‹ถ์€ ์ฃผ์ œ์˜€๋Š”๋ฐ ๋“œ๋””์–ด ์ •๋ฆฌํ•˜๊ฒŒ ๋˜๋„ค์š”..! ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ UIBezierPath๋ž€? UIBezierPath๋Š” UIKit์—์„œ ๊ทธ๋ฆฌ๊ธฐ(Drawing)์— ์†ํ•ด์žˆ๋Š” ํด๋ž˜์Šค์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ ์–ด๋–ค ๊ฒƒ์„ ๊ทธ๋ฆฌ๊ธฐ ์œ„ํ•œ ๊ธฐ๋Šฅ๋“ค์ด ์†ํ•ด์žˆ๊ฒ ์ฃ ? ์• ํ”Œ ๊ณต์‹ ๋ฌธ์„œ์—๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ์ •์˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. A path that consists of straight and curved line segments that you can render in your custom views. ํ•ด์„ํ•˜๋ฉด view์—์„œ ๋ Œ๋”๋ง ํ•  ์ˆ˜ ์žˆ๋Š” ์ง์„ ๊ณผ ๊ณก์„ ์œผ๋กœ ๊ตฌ์„ฑ๋œ ๊ฒฝ๋กœ๋ผ๊ณ  ํ•˜๋„ค์š”. Initializer Bez.. 2022. 3. 21.
[iOS/UI] CALayer๋ž€? (feat. ์• ๋‹ˆ๋ฉ”์ด์…˜ ์›๋ฆฌ) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์ €๋ฒˆ ์‹œ๊ฐ„์— Core Animation์— ๋Œ€ํ•œ ๊ธ€์„ ์ž‘์„ฑํ–ˆ๋Š”๋ฐ์š”. Core Animation์„ ๊ณต๋ถ€ํ•˜๋‹ค ๋ณด๋‹ˆ Layer๊ฐ€ ๊ฑฐ์˜ ์ „๋ถ€๋ผ๊ณ  ํ•ด๋„ ๋˜๊ฒ ๋”๋ผ๊ตฌ์š”.. ๊ทธ๋ž˜์„œ ๋”ฐ๋กœ Layer์— ๋Œ€ํ•ด ์ •๋ฆฌํ•˜๋Š” ๊ธ€์„ ์ž‘์„ฑํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. (ํ˜น์‹œ Core Animation์— ๋Œ€ํ•ด ์ž˜ ๋ชจ๋ฅด์‹œ๋Š” ๋ถ„๋“ค์œผ ์—ฌ๊ธฐ ์—์„œ ํ™•์ธํ•ด์ฃผ์„ธ์š”!) ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ CALayer๋ž€? Layer์˜ ์‚ฌ์ „์  ์˜๋ฏธ๋Š” ๊ฒน,๋ง‰,์ธต,๋‹จ๊ณ„๋ฅผ ๋œปํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์ „์  ์˜๋ฏธ์™€ ๊ฐ™์ด iOS์—์„œ๋„ ์•„๋ž˜์™€ ๊ฐ™์ด ๊ณ„์ธต์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ๋˜๋Š”๋ฐ์š”. ์ •ํ™•ํ•˜๊ฒŒ๋Š” ์ด๋ฏธ์ง€ ๊ธฐ๋ฐ˜ ์ปจํ…์ธ ๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ  ํ•ด๋‹น ์ปจํ…์ธ ์—์„œ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ฐœ์ฒด์ž…๋‹ˆ๋‹ค. ์ฆ‰, ๋ฐฐ๊ฒฝ์ƒ‰,ํ…Œ๋‘๋ฆฌ ๋ฐ ๊ทธ๋ฆผ์ž์™€ ๊ฐ™์ด ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” ํ™”๋ฉด์— ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ์  ์†์„ฑ์„ ๊ด€๋ฆฌํ•˜๋Š”.. 2022. 3. 17.
[iOS/UI] Core Animation์ด๋ž€? (feat. CALayer) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์ž‘๋™๋˜๋Š” ์›๋ฆฌ์— ๋Œ€ํ•ด ๋” ๊นŠ๊ฒŒ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด์„œ iOS์—์„œ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์‹œ์Šคํ…œ์„ ๋‹ด๋‹นํ•˜๋Š” Core Animation์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ Core Animation์ด๋ž€? ๋ทฐ ๋ฐ ๊ธฐํƒ€ ์‹œ๊ฐ์  ์š”์†Œ์— ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋ฒ”์šฉ ์‹œ์Šคํ…œ ๊ทธ๋ž˜ํ”ฝ ๋ Œ๋”๋ง ๋ฐ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ธํ”„๋ผ ๋ทฐ์™€ ํ†ตํ•ฉ๋˜์–ด ์ฝ˜ํ…์ธ  ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์œ„ํ•œ ๋” ๋‚˜์€ ์„ฑ๋Šฅ๊ณผ ์ง€์›์„ ์ œ๊ณตํ•˜๋Š” ๊ธฐ์ˆ  ์•„๋ž˜์™€ ๊ฐ™์ด UIKit ๋ฐ AppKit์˜ ๊ทผ๊ฐ„์ด ๋˜๋Š” ๊ธฐ์ˆ ๋กœ iOS ๋ฐ OS X๋ฅผ ์•ฑ์„ ๊ฐœ๋ฐœํ•˜๊ณ  ์žˆ๋‹ค๋ฉด ๋ฌด์กฐ๊ฑด Core Animation์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. Core Animation์„ ์ง์ ‘ ์‚ฌ์šฉํ•  ํ•„์š”๋Š” ์—†์ง€๋งŒ ์‚ฌ์šฉํ•  ๋•Œ Core Animation์ด ์–ด๋– ํ•œ ์›๋ฆฌ๋กœ ์ˆ˜ํ–‰๋˜๋Š”์ง€ ์ดํ•ดํ•  ํ•„์š”.. 2022. 3. 16.
[SwiftUI] TabView์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ธฐ (feat. UITabBar) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ SwiftUI์—์„œ ํƒญ๋ทฐ๋ฅผ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. (UIKit์—์„  UITabBar๋ฅผ ๋œปํ•ฉ๋‹ˆ๋‹ค.) ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ TabView Contents SwiftUI์—์„œ ํƒญ๋ทฐ๋ฅผ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋„ˆ๋ฌด ๋„ˆ๋ฌด ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด TabView๋กœ ๊ฐ์‹ธ๊ณ  ํƒญ๋ทฐ ์•ˆ์— ๋“ค์–ด๊ฐˆ ๋ทฐ๋“ค์„ ๋„ฃ์œผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. TabView { View1() View2() View3() ... } TabView Item ํ•˜์ง€๋งŒ ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•˜๋ฉด ์•„์ง ํƒญ๋ทฐ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ด๋Š”๋ฐ์š”. TabView { LoginView() HelloView() SettingView() } ์ด์œ ๋Š” ์ด๋ฏธ ํƒญ๋ทฐ๊ฐ€ ์กด์žฌํ•˜์ง€๋งŒ ํƒญ๋ทฐ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์•„์ดํ…œ์„ ์„ธํŒ…ํ•ด์ฃผ์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๊ณ ๋กœ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํƒญ์•„์ดํ…œ.. 2022. 3. 10.
[๐Ÿงฉ Creative Coding] ์ค„์— ๋งค๋‹ฌ๋ ค ํ”๋“ค๋ฆฌ๋Š” ์ƒ์ž ๋งŒ๋“ค๊ธฐ (feat. Interactive Developer) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ ์ค„์— ๋งค๋‹ฌ๋ ค ํ”๋“ค๋ฆฌ๋Š” ์ƒ์ž๋ฅผ ๋งŒ๋“ค์–ด ๋ณผ๊ฑด๋ฐ์š”. ์ด๊ฑด ์ œ๊ฐ€ ์กด๊ฒฝํ•˜๋Š” ๊ฐœ๋ฐœ์ž์ด๊ธฐ๋„ ํ•œ ์ธํ„ฐ๋ž™ํ‹ฐ๋ธŒ ๋””๋ฒจ๋กœํผ ๊น€์ข…๋ฏผ๋‹˜์˜ ์œ ํŠœ๋ธŒ ์ฑ„๋„์— ์˜ฌ๋ผ์˜จ ํŠœํ† ๋ฆฌ์–ผ ์ค‘ ํ•˜๋‚˜์ธ๋ฐ์š”. ์˜ˆ์ „๋ถ€ํ„ฐ ์ด๋Ÿฐ ์ฐฝ์˜์ ์ธ ์ฝ”๋”ฉ, ์˜ˆ์ˆ ์ ์ธ ์ฝ”๋”ฉ์„ ํ•˜๊ณ ์‹ถ์€ ์š•์‹ฌ์ด ๋งŽ์•˜์—ˆ๋Š”๋ฐ ์ด๋ฒˆ ๊ธฐํšŒ์— ๊น€์ข…๋ฏผ๋‹˜์„ ๋”ฐ๋ผ์„œ ๊ตฌํ˜„ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์œ„ ์˜์ƒ์„ ๋ณด๋ฉฐ ๋‚˜๋ฆ„ ์ œ ๋ฐฉ์‹๋Œ€๋กœ Swift๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ตฌํ˜„ํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ View ๋จผ์ € ์ƒ์ž์™€ ๋นจ๊ฐ„ ์ ์„ UIView๋กœ ์„ธํŒ…ํ•ด์ค๋‹ˆ๋‹ค. (์ €๋Š” ์ƒ์ž ๊ฐ€์šด๋ฐ์— ์ œ ์ด๋ฆ„์„ ๋„ฃ์–ด์„œ ๋ณด์—ฌ์ค„ ๊ฑฐ๊ธฐ ๋•Œ๋ฌธ์— label๋„ ๋„ฃ์—ˆ์Šต๋‹ˆ๋‹ค.) let square:UIView = { let view:UIView = UIView() view.backgroundColor = .systemCyan .. 2021. 11. 23.
728x90
๋ฐ˜์‘ํ˜•