Change reader button to be a system button
This commit is contained in:
parent
67e6408da0
commit
65356424d9
|
@ -17,23 +17,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 {
|
||||||
if buttonState != oldValue {
|
if buttonState != oldValue {
|
||||||
|
|
|
@ -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!
|
||||||
|
|
Loading…
Reference in New Issue