2021-02-20 13:23:29 +01:00
|
|
|
//
|
2021-02-22 16:16:13 +01:00
|
|
|
// PrimaryActionButton.swift
|
2021-02-20 13:23:29 +01:00
|
|
|
// Mastodon
|
|
|
|
//
|
2021-02-23 15:14:10 +01:00
|
|
|
// Created by BradGao on 2021/2/20.
|
2021-02-20 13:23:29 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
2021-02-22 16:16:13 +01:00
|
|
|
class PrimaryActionButton: UIButton {
|
2021-02-20 13:23:29 +01:00
|
|
|
override init(frame: CGRect) {
|
|
|
|
super.init(frame: frame)
|
|
|
|
_init()
|
|
|
|
}
|
|
|
|
|
|
|
|
required init?(coder: NSCoder) {
|
|
|
|
super.init(coder: coder)
|
|
|
|
_init()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-22 16:16:13 +01:00
|
|
|
extension PrimaryActionButton {
|
2021-02-20 13:23:29 +01:00
|
|
|
private func _init() {
|
|
|
|
titleLabel?.font = .preferredFont(forTextStyle: .headline)
|
|
|
|
setTitleColor(Asset.Colors.lightWhite.color, for: .normal)
|
|
|
|
backgroundColor = Asset.Colors.lightBrandBlue.color
|
|
|
|
applyCornerRadius(radius: 10)
|
|
|
|
setInsets(forContentPadding: UIEdgeInsets(top: 12, left: 0, bottom: 12, right: 0), imageTitlePadding: 0)
|
|
|
|
}
|
|
|
|
}
|