Commit 8ebda18e authored by Soomin Lee's avatar Soomin Lee

ActionSheetCell: Icon: Observe image change to change hidden state

(closes #535)
parent aea6ce4b
......@@ -9,6 +9,24 @@
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
class ActionSheetCellImageView: UIImageView {
override var image: UIImage? {
didSet {
super.image = image
isHidden = false
}
}
override init(image: UIImage? = nil) {
super.init(image: image)
isHidden = true
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
@objc(VLCActionSheetCell)
class ActionSheetCell: UICollectionViewCell {
......@@ -23,8 +41,8 @@ class ActionSheetCell: UICollectionViewCell {
}
}
let icon: UIImageView = {
let icon = UIImageView()
let icon: ActionSheetCellImageView = {
let icon = ActionSheetCellImageView()
icon.translatesAutoresizingMaskIntoConstraints = false
icon.contentMode = .scaleAspectFit
return icon
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment