Skip to content

Commit

Permalink
✨ :: [#1243] UIView -> UIButton으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
youn9k committed Aug 31, 2024
1 parent 95821e2 commit 223ac43
Showing 1 changed file with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class PlayTypeTogglePopupItemButtonView: UIView {
$0.contentMode = .scaleAspectFit
}

private let installButtonView = InstallButtonView().then {
private let installButton = InstallButton().then {
$0.isHidden = true
}

Expand Down Expand Up @@ -79,7 +79,7 @@ final class PlayTypeTogglePopupItemButtonView: UIView {
} else {
isInstalled = false
}
installButtonView.isHidden = isInstalled
installButton.isHidden = isInstalled
button.isEnabled = isInstalled

return isInstalled
Expand Down Expand Up @@ -115,7 +115,7 @@ private extension PlayTypeTogglePopupItemButtonView {
}
button.addAction(buttonAction, for: .touchUpInside)

installButtonView.button.addAction {
installButton.addAction {
let youtubeMusicAppStoreURL = "itms-apps://apps.apple.com/app/id1017492454"
if let url = URL(string: youtubeMusicAppStoreURL) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
Expand All @@ -128,7 +128,7 @@ private extension PlayTypeTogglePopupItemButtonView {
addSubview(titleLabel)
addSubview(imageView)
addSubview(button)
addSubview(installButtonView)
addSubview(installButton)
}

func setLayout() {
Expand All @@ -152,15 +152,15 @@ private extension PlayTypeTogglePopupItemButtonView {
$0.edges.equalTo(baseView)
}

installButtonView.snp.makeConstraints {
installButton.snp.makeConstraints {
$0.edges.equalToSuperview()
}
}
}

private extension PlayTypeTogglePopupItemButtonView {
class InstallButtonView: UIView {
private let titleLabel = WMLabel(
class InstallButton: UIButton {
private let messageLabel = WMLabel(
text: "미설치",
textColor: DesignSystemAsset.BlueGrayColor.gray400.color,
font: .t7(weight: .bold),
Expand All @@ -173,8 +173,6 @@ private extension PlayTypeTogglePopupItemButtonView {
$0.clipsToBounds = true
}

let button = UIButton()

init() {
super.init(frame: .zero)
addViews()
Expand All @@ -187,20 +185,16 @@ private extension PlayTypeTogglePopupItemButtonView {
}

func addViews() {
addSubviews(titleLabel, button)
addSubviews(messageLabel)
}

func setLayout() {
titleLabel.snp.makeConstraints {
messageLabel.snp.makeConstraints {
$0.width.equalTo(55)
$0.height.equalTo(24)
$0.trailing.equalToSuperview().inset(20)
$0.centerY.equalToSuperview()
}

button.snp.makeConstraints {
$0.edges.equalToSuperview()
}
}
}
}

0 comments on commit 223ac43

Please sign in to comment.