NetNewsWire/iOS/UIKit Extensions/VibrantButton.swift
2019-10-22 03:31:25 -05:00

33 lines
591 B
Swift

//
// 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
}
}
}