본문 바로가기

iOS/예제12

[iOS 예제] Roulette 만들기 Fortune wheel in Swift A while ago i got a requirement to develop a spin wheel or fortune wheel (like the one in wheel of fortune TV show). The only difference is… medium.com 기본적인 원리는 위의 블로그를 참고해서 만들었다. 디테일은 내가 임의로 수정하고 추가했다. Github: https://github.com/Sky-Titan/RouletteExample GitHub - Sky-Titan/RouletteExample Contribute to Sky-Titan/RouletteExample development by creating an account on GitHub.. 2022. 6. 25.
[iOS 예제] Ripple Effect Material Design Build beautiful, usable products faster. Material Design is an adaptable system—backed by open-source code—that helps teams build high quality digital experiences. material.io Ripple Effect 아래의 이미지와 같이 버튼이나 뷰를 클릭했을 때 마치 물결이 퍼지듯 원형 모향의 애니메이션이 퍼져나가면서 사용자에게 클릭을 인지시키는 효과 위의 구글 material에서 pod으로 다운받아 사용해도 된다. Code UIView을 상속받은 protocol을 만들어서, 최대한 재사용이 가능하게끔 만듬 원리는 아래와 같다. UIView의 touch.. 2022. 6. 19.
[iOS 예제] CircleProgressView 만들기 만들고자 하는 View는 위와 같은 형태로 현재까지 어떤 특정한 작업의 진행 정도를 시각적으로 보여주는 뷰이다. CirlcleLayer class CircleLayer: CALayer { public var progressWidth: CGFloat = 0 public var progressColor: UIColor? public var progressBackgroundColor: UIColor? public var progress: CGFloat = 0 public var clockwise: Bool = false public var progressLayer: CAShapeLayer? var center: CGPoint { return CGPoint(x: frame.size.width / 2, y: fr.. 2021. 12. 11.
[iOS 예제] UIView에 원형으로 shadow 넣기 ※ 중요! shadowOpacity값은 무조건 설정해야한다. 안 그러면 그림자가 보이지 않는다. import UIKit class ViewController: UIViewController { @IBOutlet weak var circleView: UIView! override func viewDidLoad() { super.viewDidLoad() setUpCircleView() //그림자 세팅 setCircleViewShadow() } private func setCircleViewShadow() { circleView.layer.masksToBounds = false circleView.layer.shadowColor = UIColor.black.cgColor //그림자 색깔 : 검정색 circle.. 2021. 12. 7.