Created
December 1, 2021 18:58
-
-
Save barisuyar/251598aa21778abdcb130910c776eb50 to your computer and use it in GitHub Desktop.
ThumbView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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