Learn-iOS-Swift-by-Examples/Photos/Shared/GridViewCell.swift

36 lines
785 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Copyright (C) 2017 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
Collection view cell for displaying an asset.
*/
import UIKit
class GridViewCell: UICollectionViewCell {
@IBOutlet var imageView: UIImageView!
@IBOutlet var livePhotoBadgeImageView: UIImageView!
var representedAssetIdentifier: String!
var thumbnailImage: UIImage! {
didSet {
imageView.image = thumbnailImage
}
}
var livePhotoBadgeImage: UIImage! {
didSet {
livePhotoBadgeImageView.image = livePhotoBadgeImage
}
}
override func prepareForReuse() {
super.prepareForReuse()
imageView.image = nil
livePhotoBadgeImageView.image = nil
}
}