728x90 ๋ฐ์ํ CGGradient1 [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. ์ด์ 1 ๋ค์ 728x90 ๋ฐ์ํ