Skip to content

Instantly share code, notes, and snippets.

@HassanElDesouky
Last active August 28, 2019 07:26
Show Gist options
  • Save HassanElDesouky/5237beb600f334bdc3a82f441c699034 to your computer and use it in GitHub Desktop.
Save HassanElDesouky/5237beb600f334bdc3a82f441c699034 to your computer and use it in GitHub Desktop.
class IconChooseColorCell: UICollectionViewCell {
let view: UIImageView = {
let cv = UIImageView()
cv.translatesAutoresizingMaskIntoConstraints = false
return cv
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupView()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
fileprivate func setupView() {
self.addSubview(view)
NSLayoutConstraint.activate([
view.topAnchor.constraint(equalTo: self.topAnchor),
view.bottomAnchor.constraint(equalTo: self.bottomAnchor),
view.leftAnchor.constraint(equalTo: self.leftAnchor),
view.rightAnchor.constraint(equalTo: self.rightAnchor),
])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment