Correct vibrancy configuration for Settings

This commit is contained in:
Maurice Parker
2019-10-22 03:31:25 -05:00
parent d9a165151d
commit 528284999f
10 changed files with 98 additions and 18 deletions

View File

@@ -0,0 +1,32 @@
//
// VibrantButton.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 10/22/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
class VibrantButton: UIButton {
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
private func commonInit() {
setTitleColor(AppAssets.vibrantTextColor, for: .highlighted)
}
override var isHighlighted: Bool {
didSet {
backgroundColor = isHighlighted ? AppAssets.secondaryAccentColor : nil
}
}
}

View File

@@ -0,0 +1,27 @@
//
// VibrantLabel.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 10/22/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
class VibrantLabel: UILabel {
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}
private func commonInit() {
highlightedTextColor = AppAssets.vibrantTextColor
}
}

View File

@@ -9,6 +9,7 @@
import UIKit
class VibrantTableViewCell: UITableViewCell {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
commonInit()
@@ -26,7 +27,9 @@ class VibrantTableViewCell: UITableViewCell {
/// Subclass overrides should call super
func applyThemeProperties() {
let selectedBackgroundView = UIView(frame: .zero)
selectedBackgroundView.backgroundColor = AppAssets.primaryAccentColor
selectedBackgroundView.backgroundColor = AppAssets.secondaryAccentColor
self.selectedBackgroundView = selectedBackgroundView
textLabel?.highlightedTextColor = AppAssets.vibrantTextColor
}
}