mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-13 09:59:17 +01:00
40 lines
1.0 KiB
Swift
40 lines
1.0 KiB
Swift
//
|
|
// SettingsAccountTableViewCell.swift
|
|
// NetNewsWire-iOS
|
|
//
|
|
// Created by Maurice Parker on 10/23/19.
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class SettingsAccountTableViewCell: VibrantTableViewCell {
|
|
|
|
@IBOutlet weak var accountImage: UIImageView!
|
|
@IBOutlet weak var accountNameLabel: UILabel!
|
|
|
|
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
|
|
super.setHighlighted(highlighted, animated: animated)
|
|
updateVibrancy(animated: animated)
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
updateVibrancy(animated: animated)
|
|
}
|
|
|
|
override func applyThemeProperties() {
|
|
super.applyThemeProperties()
|
|
accountNameLabel?.highlightedTextColor = AppAssets.vibrantTextColor
|
|
}
|
|
|
|
func updateVibrancy(animated: Bool) {
|
|
let tintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label
|
|
let duration = animated ? 0.6 : 0.0
|
|
UIView.animate(withDuration: duration) {
|
|
self.accountImage?.tintColor = tintColor
|
|
}
|
|
}
|
|
|
|
}
|