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) {
|
||||
super.init(frame: frame)
|
||||
|
||||
initializationActions()
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
|
@ -62,7 +62,7 @@ extension AccountHeaderView: UITextViewDelegate {
|
|||
}
|
||||
|
||||
private extension AccountHeaderView {
|
||||
func initializationActions() {
|
||||
func initialSetup() {
|
||||
let baseStackView = UIStackView()
|
||||
|
||||
addSubview(headerImageView)
|
||||
|
|
|
@ -17,6 +17,7 @@ class AccountView: UIView {
|
|||
super.init(frame: .zero)
|
||||
|
||||
initialSetup()
|
||||
applyAccountConfiguration()
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
|
@ -93,8 +94,6 @@ private extension AccountView {
|
|||
stackView.trailingAnchor.constraint(equalTo: readableContentGuide.trailingAnchor),
|
||||
stackView.bottomAnchor.constraint(equalTo: readableContentGuide.bottomAnchor)
|
||||
])
|
||||
|
||||
applyAccountConfiguration()
|
||||
}
|
||||
|
||||
func applyAccountConfiguration() {
|
||||
|
|
|
@ -35,19 +35,18 @@ final class CardView: UIView {
|
|||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
initializationActions()
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
|
||||
initializationActions()
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
}
|
||||
|
||||
private extension CardView {
|
||||
// swiftlint:disable:next function_body_length
|
||||
func initializationActions() {
|
||||
func initialSetup() {
|
||||
backgroundColor = .secondarySystemBackground
|
||||
layer.cornerRadius = .defaultCornerRadius
|
||||
clipsToBounds = true
|
||||
|
|
|
@ -52,18 +52,17 @@ final class StatusAttachmentsView: UIView {
|
|||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
|
||||
initializationActions()
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
|
||||
initializationActions()
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
}
|
||||
|
||||
private extension StatusAttachmentsView {
|
||||
func initializationActions() {
|
||||
func initialSetup() {
|
||||
backgroundColor = .clear
|
||||
layoutMargins = .zero
|
||||
clipsToBounds = true
|
||||
|
|
|
@ -50,6 +50,7 @@ final class StatusView: UIView {
|
|||
super.init(frame: .zero)
|
||||
|
||||
initialSetup()
|
||||
applyStatusConfiguration()
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
|
@ -287,8 +288,6 @@ private extension StatusView {
|
|||
avatarButton.bottomAnchor.constraint(equalTo: avatarImageView.bottomAnchor),
|
||||
avatarButton.trailingAnchor.constraint(equalTo: avatarImageView.trailingAnchor)
|
||||
])
|
||||
|
||||
applyStatusConfiguration()
|
||||
}
|
||||
|
||||
func applyStatusConfiguration() {
|
||||
|
|
|
@ -9,12 +9,17 @@ final class TouchFallthroughTextView: UITextView {
|
|||
|
||||
override init(frame: CGRect, textContainer: NSTextContainer?) {
|
||||
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) {
|
||||
super.init(coder: coder)
|
||||
initializationActions()
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
|
||||
|
@ -124,14 +129,6 @@ final class TouchFallthroughTextView: UITextView {
|
|||
private extension TouchFallthroughTextView {
|
||||
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() {
|
||||
UIView.animate(withDuration: .defaultAnimationDuration) {
|
||||
self.linkHighlightView?.alpha = 0
|
||||
|
|
Loading…
Reference in a new issue