From e640befd9e0fd1efa108be2fa56ff0c598984e27 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 19 Oct 2023 13:21:11 +0200 Subject: [PATCH] Get rid of FollowButton --- .../View/Content/FollowButton.swift | 20 ------------------- .../MastodonUI/View/Content/UserView.swift | 7 +++++-- 2 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 MastodonSDK/Sources/MastodonUI/View/Content/FollowButton.swift diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/FollowButton.swift b/MastodonSDK/Sources/MastodonUI/View/Content/FollowButton.swift deleted file mode 100644 index a7d03a4d2..000000000 --- a/MastodonSDK/Sources/MastodonUI/View/Content/FollowButton.swift +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright © 2023 Mastodon gGmbH. All rights reserved. - -import UIKit -import MastodonAsset - -public final class FollowButton: UIButton { - - public init() { - super.init(frame: .zero) - configureAppearance() - } - - required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - - private func configureAppearance() { - var buttonConfiguration = UIButton.Configuration.filled() - buttonConfiguration.background.cornerRadius = 10 - self.configuration = buttonConfiguration - } -} diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/UserView.swift b/MastodonSDK/Sources/MastodonUI/View/Content/UserView.swift index a3acc3e9d..cd07b3004 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/UserView.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/UserView.swift @@ -101,8 +101,11 @@ public final class UserView: UIView { }() private let followButtonWrapper = UIView() - private let followButton: FollowButton = { - let button = FollowButton() + private let followButton: UIButton = { + var buttonConfiguration = UIButton.Configuration.filled() + buttonConfiguration.background.cornerRadius = 10 + + let button = UIButton(configuration: buttonConfiguration) button.isHidden = true button.translatesAutoresizingMaskIntoConstraints = false button.setContentCompressionResistancePriority(.required, for: .horizontal)