mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 01:31:02 +00:00
Cleanup
This commit is contained in:
parent
bd1659af6a
commit
670e2f9af6
6 changed files with 20 additions and 27 deletions
|
@ -35,7 +35,7 @@ class AccountHeaderView: UIView {
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
initializationActions()
|
initialSetup()
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
|
@ -62,7 +62,7 @@ extension AccountHeaderView: UITextViewDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension AccountHeaderView {
|
private extension AccountHeaderView {
|
||||||
func initializationActions() {
|
func initialSetup() {
|
||||||
let baseStackView = UIStackView()
|
let baseStackView = UIStackView()
|
||||||
|
|
||||||
addSubview(headerImageView)
|
addSubview(headerImageView)
|
||||||
|
|
|
@ -17,6 +17,7 @@ class AccountView: UIView {
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
|
|
||||||
initialSetup()
|
initialSetup()
|
||||||
|
applyAccountConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
|
@ -93,8 +94,6 @@ private extension AccountView {
|
||||||
stackView.trailingAnchor.constraint(equalTo: readableContentGuide.trailingAnchor),
|
stackView.trailingAnchor.constraint(equalTo: readableContentGuide.trailingAnchor),
|
||||||
stackView.bottomAnchor.constraint(equalTo: readableContentGuide.bottomAnchor)
|
stackView.bottomAnchor.constraint(equalTo: readableContentGuide.bottomAnchor)
|
||||||
])
|
])
|
||||||
|
|
||||||
applyAccountConfiguration()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyAccountConfiguration() {
|
func applyAccountConfiguration() {
|
||||||
|
|
|
@ -35,19 +35,18 @@ final class CardView: UIView {
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
initializationActions()
|
initialSetup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
|
||||||
initializationActions()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension CardView {
|
private extension CardView {
|
||||||
// swiftlint:disable:next function_body_length
|
// swiftlint:disable:next function_body_length
|
||||||
func initializationActions() {
|
func initialSetup() {
|
||||||
backgroundColor = .secondarySystemBackground
|
backgroundColor = .secondarySystemBackground
|
||||||
layer.cornerRadius = .defaultCornerRadius
|
layer.cornerRadius = .defaultCornerRadius
|
||||||
clipsToBounds = true
|
clipsToBounds = true
|
||||||
|
|
|
@ -52,18 +52,17 @@ final class StatusAttachmentsView: UIView {
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
initializationActions()
|
initialSetup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
|
||||||
initializationActions()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension StatusAttachmentsView {
|
private extension StatusAttachmentsView {
|
||||||
func initializationActions() {
|
func initialSetup() {
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
layoutMargins = .zero
|
layoutMargins = .zero
|
||||||
clipsToBounds = true
|
clipsToBounds = true
|
||||||
|
|
|
@ -50,6 +50,7 @@ final class StatusView: UIView {
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
|
|
||||||
initialSetup()
|
initialSetup()
|
||||||
|
applyStatusConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
|
@ -287,8 +288,6 @@ private extension StatusView {
|
||||||
avatarButton.bottomAnchor.constraint(equalTo: avatarImageView.bottomAnchor),
|
avatarButton.bottomAnchor.constraint(equalTo: avatarImageView.bottomAnchor),
|
||||||
avatarButton.trailingAnchor.constraint(equalTo: avatarImageView.trailingAnchor)
|
avatarButton.trailingAnchor.constraint(equalTo: avatarImageView.trailingAnchor)
|
||||||
])
|
])
|
||||||
|
|
||||||
applyStatusConfiguration()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyStatusConfiguration() {
|
func applyStatusConfiguration() {
|
||||||
|
|
|
@ -9,12 +9,17 @@ final class TouchFallthroughTextView: UITextView {
|
||||||
|
|
||||||
override init(frame: CGRect, textContainer: NSTextContainer?) {
|
override init(frame: CGRect, textContainer: NSTextContainer?) {
|
||||||
super.init(frame: frame, textContainer: textContainer)
|
super.init(frame: frame, textContainer: textContainer)
|
||||||
initializationActions()
|
|
||||||
|
clipsToBounds = false
|
||||||
|
textDragInteraction?.isEnabled = false
|
||||||
|
textContainerInset = .zero
|
||||||
|
self.textContainer.lineFragmentPadding = 0
|
||||||
|
linkTextAttributes = [.foregroundColor: tintColor as Any, .underlineColor: UIColor.clear]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
fatalError("init(coder:) has not been implemented")
|
||||||
initializationActions()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
||||||
|
@ -124,14 +129,6 @@ final class TouchFallthroughTextView: UITextView {
|
||||||
private extension TouchFallthroughTextView {
|
private extension TouchFallthroughTextView {
|
||||||
static let linkHighlightViewTransform = CGAffineTransform(scaleX: 1.1, y: 1.1)
|
static let linkHighlightViewTransform = CGAffineTransform(scaleX: 1.1, y: 1.1)
|
||||||
|
|
||||||
func initializationActions() {
|
|
||||||
clipsToBounds = false
|
|
||||||
textDragInteraction?.isEnabled = false
|
|
||||||
textContainerInset = .zero
|
|
||||||
textContainer.lineFragmentPadding = 0
|
|
||||||
linkTextAttributes = [.foregroundColor: tintColor as Any, .underlineColor: UIColor.clear]
|
|
||||||
}
|
|
||||||
|
|
||||||
func removeLinkHighlightView() {
|
func removeLinkHighlightView() {
|
||||||
UIView.animate(withDuration: .defaultAnimationDuration) {
|
UIView.animate(withDuration: .defaultAnimationDuration) {
|
||||||
self.linkHighlightView?.alpha = 0
|
self.linkHighlightView?.alpha = 0
|
||||||
|
|
Loading…
Reference in a new issue