Change reader button to be a system button

This commit is contained in:
Maurice Parker 2019-09-27 14:09:28 -05:00
parent 67e6408da0
commit 65356424d9
2 changed files with 6 additions and 18 deletions

View File

@ -16,23 +16,6 @@ enum ArticleExtractorButtonState {
} }
class ArticleExtractorButton: UIButton { class ArticleExtractorButton: UIButton {
init() {
super.init(frame: CGRect(x: 0, y: 0, width: 44, height: 44))
setImage(AppAssets.articleExtractorOff, for: .normal)
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override var isEnabled: Bool {
didSet {
if isEnabled != oldValue {
tintColor = isEnabled ? nil : UIColor.secondaryLabel
}
}
}
var buttonState: ArticleExtractorButtonState = .off { var buttonState: ArticleExtractorButtonState = .off {
didSet { didSet {

View File

@ -31,7 +31,12 @@ class ArticleViewController: UIViewController {
@IBOutlet private weak var browserBarButtonItem: UIBarButtonItem! @IBOutlet private weak var browserBarButtonItem: UIBarButtonItem!
@IBOutlet private weak var webViewContainer: UIView! @IBOutlet private weak var webViewContainer: UIView!
private var articleExtractorButton = ArticleExtractorButton() private var articleExtractorButton: ArticleExtractorButton = {
let button = ArticleExtractorButton(type: .system)
button.setImage(AppAssets.articleExtractorOff, for: .normal)
return button
}()
private var webView: WKWebView! private var webView: WKWebView!
weak var coordinator: SceneCoordinator! weak var coordinator: SceneCoordinator!