// // MainOptionView.swift // List // // Created by Saveliy Stavitsky on 7/14/20. // Copyright © 2020 Igor Danich. All rights reserved. // import UIKit class MainOptionView: CommonViewCustom { @IBOutlet var iconImageView: UIImageView! @IBOutlet var titleLabel: UILabel! @IBOutlet var descriptionLabel: UILabel! @IBOutlet var rightDisclosureImageView: UIImageView! @IBOutlet var countButton: CommonButtonAction! @IBInspectable public var iconImage: UIImage? { get { iconImageView.image } set { iconImageView?.image = newValue?.withRenderingMode(.alwaysTemplate) } } @IBInspectable public var lzTitle: String? { get { titleLabel.lzText } set { titleLabel.lzText = newValue } } @IBInspectable public var lzDescription: String? { get { descriptionLabel.lzText } set { descriptionLabel.lzText = newValue } } var isEnabled: Bool = true { didSet { if isEnabled { iconImageView.tintColor = Asset.dark.color titleLabel.textColor = Asset.dark.color descriptionLabel.textColor = Asset.lightGray.color rightDisclosureImageView.image = Asset.commonArrowRight.image } else { iconImageView.tintColor = Asset.disabled.color titleLabel.textColor = Asset.disabled.color descriptionLabel.textColor = Asset.dark.color rightDisclosureImageView.image = Asset.commonLock.image } } } }