Skip to content

Instantly share code, notes, and snippets.

@hassanvfx
Created October 28, 2019 21:32
Show Gist options
  • Select an option

  • Save hassanvfx/03938780145d31de27bad9dcbb1218af to your computer and use it in GitHub Desktop.

Select an option

Save hassanvfx/03938780145d31de27bad9dcbb1218af to your computer and use it in GitHub Desktop.
class DisplayGenericCell< DISPLAY_VIEW :UIView> : UICollectionViewCell {
var displayView : DISPLAY_VIEW!
override init(frame: CGRect) {
super.init(frame: frame)
clipsToBounds = true
displayView = DISPLAY_VIEW()
addSubview(displayView)
displayView.snp_makeConstraints { (make) in
make.width.equalToSuperview()
make.height.equalToSuperview()
make.center.equalToSuperview()
}
}
override func prepareForReuse() {
super.prepareForReuse()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
fatalError("Interface Builder is not supported!")
}
override func awakeFromNib() {
super.awakeFromNib()
fatalError("Interface Builder is not supported!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment