Last active
September 16, 2017 13:14
-
-
Save Abhishek-NickelFox/933f74dec331f3e9618253dff503e964 to your computer and use it in GitHub Desktop.
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
import UIKit | |
struct CellModel { | |
var image: UIImage | |
} | |
class ImageCollectionCell: UICollectionViewCell { | |
@IBOutlet weak var imgView: UIImageView! | |
var item: CellModel? { | |
didSet { | |
self.configure(item) | |
} | |
} | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
} | |
func configure(_ item: CellModel?) { | |
if let model = item { | |
self.imgView.image = model.image | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment