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

๐ŸŽ iOS138

[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.
[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.
[SwiftUI] GeometryReader๋ž€? (feat. GeometryProxy,CoordinateSpace) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ์˜ค๋Š˜์€ SwitUI๋ฅผ ์ด์šฉํ•ด์„œ Layout์„ ์žก์„ ๋•Œ ์•„์ฃผ ์œ ์šฉํ•˜๊ฒŒ ์‚ฌ์šฉ๋˜๋Š” GeometryReader์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ GeometryReader๋ž€? ์ด๋ฆ„์„ ์ง์—ญํ•˜๋ฉด Geometry๋Š” ๊ธฐํ•˜ํ•™์„ ๋‚˜ํƒ€๋‚ด๋‹ˆ๊น, ๊ธฐํ•˜ํ•™์ ์ธ ๋ฌด์–ธ๊ฐ€๋ฅผ ์ฝ๋Š” ๊ฒƒ์ด๋ผ๊ณ  ํ•ด์„ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ์š”. ๊ณต์‹ ๋ฌธ์„œ์—๋„ ์ด๋ฆ„์„ ์ง์—ญํ•œ ๊ฒƒ๊ณผ ๋น„์Šทํ•˜๊ฒŒ "์ปจํ…์ธ ์˜ ํฌ๊ธฐ์™€ ์œ„์น˜๋ฅผ ํ•จ์ˆ˜๋กœ ๋‚˜ํƒ€๋‚ด๋Š” ์ปจํ…Œ์ด๋„ˆ ๋ทฐ์•ผ!" ๋ผ๊ณ  ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. GeometryReader๋ฅผ ์ดˆ๊ธฐํ™” ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์•„๋ž˜์™€ ๊ฐ™์ด ์ปจํ…์ธ ๋ฅผ ๋งŒ๋“œ๋Š”๋ฐ GeometryProxy๋ฅผ ์ด์šฉํ•ด์„œ ๋งŒ๋“ญ๋‹ˆ๋‹ค. GeometryProxy๋ž€? ๊ทธ๋ ‡๋‹ค๋ฉด GeometryProxy๋Š” ๋ฌด์—‡์ผ๊นŒ์š”? ์šฐ์„  Proxy์˜ ๋œป์€ ๋ฌด์—‡์ธ๊ฐ€๋ฅผ ๋Œ€์‹  ํ•œ๋‹ค๋Š” ์˜๋ฏธ๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. .. 2022. 4. 4.
[SwiftUI] ์ž์—ฐ์Šค๋Ÿฌ์šด ํ™”๋ฉด์ „ํ™˜ ์• ๋‹ˆ๋ฉ”์ด์…˜ ๊ตฌํ˜„ํ•˜๊ธฐ (feat. matchedGeometryEffect,Namespace) ์•ˆ๋…•ํ•˜์„ธ์š” Foma ๐Ÿ’ป ์ž…๋‹ˆ๋‹ค! ํ‰์†Œ์— AppStore๋ฅผ ๋ณด๋ฉด ํ™”๋ฉด ๊ฐ„ ์ „ํ™˜ํ•  ๋•Œ ์ž์—ฐ์Šค๋Ÿฌ์šด ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ๋งŽ์ด ๋ณด์•˜๋Š”๋ฐ, '์ด๊ฑด ์–ด๋–ป๊ฒŒ ๊ตฌํ˜„ํ–ˆ์„๊นŒ' ๋ผ๋Š” ์ƒ๊ฐ์ด ๋งŽ์ด ๋“ค์–ด ๊ธ€์„ ์ •๋ฆฌํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ์‹œ์ž‘ํ• ๊ฒŒ์š”~ Preview @Namespace ํ™”๋ฉด ์ „ํ™˜ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด์„  @Namespace ํ”„๋กœํผํ‹ฐ ๋ž˜ํผ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. @Namespace๋Š” ๊ณต์‹ ๋ฌธ์„œ์—” ์•„๋ž˜์™€ ๊ฐ™์ด ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. ์†์„ฑ์„ ํฌํ•จํ•˜๋Š” ๊ฐœ์ฒด(์˜ˆ: view)์˜ ์˜๊ตฌ ID๋กœ ์ •์˜๋œ ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ๋Œ€ํ•œ ์•ก์„ธ์Šค๋ฅผ ํ—ˆ์šฉํ•˜๋Š” ๋™์  ์†์„ฑ ์œ ํ˜•์ž…๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•˜๊ฒŒ ๋งํ•˜๋ฉด ๊ฐ์ฒด์˜ ์ •๋ณด๋ฅผ ID์™€ ํ•จ๊ป˜ ๊ธฐ์–ตํ•˜๊ณ  ์žˆ๋Š” ๋ž˜ํผ์ž…๋‹ˆ๋‹ค. ์ด ID๋ฅผ ํ†ตํ•ด์„œ ์ •๋ณด๋ฅผ ๋‹ค๋ฅธ ๋ทฐ์™€ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๊ฒƒ์„ ํ†ตํ•ด ์ง€์˜ค๋ฉ”ํŠธ๋ฆฌ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ๊ฐ€๋Šฅํ•ด ์ง‘๋‹ˆ๋‹ค. ์„ ์–ธํ•˜๋Š” ๋ฐฉ์‹์€ ์•„.. 2022. 3. 28.
[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.
728x90
๋ฐ˜์‘ํ˜•