Skip to content

Instantly share code, notes, and snippets.

@barisuyar
Created December 1, 2021 18:58
Show Gist options
  • Save barisuyar/251598aa21778abdcb130910c776eb50 to your computer and use it in GitHub Desktop.
Save barisuyar/251598aa21778abdcb130910c776eb50 to your computer and use it in GitHub Desktop.
ThumbView
// Step 4
final class ThumbView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setup()
}
private func setup() {
backgroundColor = UIColor(red: 183 / 255, green: 122 / 255, blue: 231 / 255, alpha: 1)
let middleView = UIView(frame: .init(x: frame.midX - 6,
y: frame.midY - 6,
width: 12,
height: 12))
middleView.backgroundColor = .white
middleView.layer.cornerRadius = 6
addSubview(middleView)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment