-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
219 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...S/YELLO-iOS/Global/Resources/Assets.xcassets/imgWithdrawalNoFriend.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "noFriend.svg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...OS/Global/Resources/Assets.xcassets/imgWithdrawalNoFriend.imageset/noFriend.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 121 additions & 0 deletions
121
...O-iOS/YELLO-iOS/Presentation/Profile/Setting/Withdrawal/View/WithdrawalNoFriendView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// | ||
// WithdrawalNoFriendView.swift | ||
// YELLO-iOS | ||
// | ||
// Created by 정채은 on 6/7/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
import Then | ||
|
||
final class WithdrawalNoFriendView: BaseView { | ||
// MARK: - Variables | ||
// MARK: Property | ||
let contentsView = UIView() | ||
private let titleLabel = UILabel() | ||
private let noFriendImageView = UIImageView() | ||
let nextButton = UIButton() | ||
let wowButton = UIButton() | ||
|
||
var nextButtonAction: (() -> Void) = {} | ||
var wowButtonAction: (() -> Void) = {} | ||
|
||
override func setStyle() { | ||
// MARK: - Function | ||
// MARK: Layout Helpers | ||
self.backgroundColor = .black.withAlphaComponent(0.5) | ||
|
||
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(closeView)) | ||
self.addGestureRecognizer(tapGestureRecognizer) | ||
|
||
contentsView.do { | ||
$0.makeCornerRound(radius: 12.adjustedHeight) | ||
$0.backgroundColor = .grayscales900 | ||
} | ||
|
||
titleLabel.do { | ||
$0.setTextWithLineHeight(text: StringLiterals.Profile.WithdrawalNoFriend.title, lineHeight: 24.adjustedHeight) | ||
$0.font = .uiSubtitle01 | ||
$0.textAlignment = .center | ||
$0.textColor = .white | ||
} | ||
|
||
noFriendImageView.do { | ||
$0.image = ImageLiterals.Withdrawal.imgWithdrawalNoFriend | ||
} | ||
|
||
nextButton.do { | ||
$0.setTitle(StringLiterals.Profile.WithdrawalNoFriend.nextLabel, for: .normal) | ||
$0.setTitleColor(.grayscales600, for: .normal) | ||
$0.titleLabel?.font = .uiButton | ||
$0.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside) | ||
} | ||
|
||
wowButton.do { | ||
$0.setTitle(StringLiterals.Profile.WithdrawalNoFriend.wowLabel, for: .normal) | ||
$0.setTitleColor(.yelloMain500, for: .normal) | ||
$0.titleLabel?.font = .uiButton | ||
$0.addTarget(self, action: #selector(wowButtonTapped), for: .touchUpInside) | ||
} | ||
} | ||
|
||
override func setLayout() { | ||
self.addSubview(contentsView) | ||
|
||
contentsView.addSubviews(titleLabel, | ||
noFriendImageView, | ||
nextButton, | ||
wowButton) | ||
|
||
contentsView.snp.makeConstraints { | ||
$0.center.equalToSuperview() | ||
$0.width.equalTo(280.adjustedWidth) | ||
$0.height.equalTo(317.adjustedHeight) | ||
} | ||
|
||
titleLabel.snp.makeConstraints { | ||
$0.top.equalToSuperview().offset(44.adjustedHeight) | ||
$0.centerX.equalToSuperview() | ||
} | ||
|
||
noFriendImageView.snp.makeConstraints { | ||
$0.top.equalTo(titleLabel.snp.bottom).offset(16.adjustedHeight) | ||
$0.centerX.equalToSuperview() | ||
$0.size.equalTo(100.adjusted) | ||
} | ||
|
||
nextButton.snp.makeConstraints { | ||
$0.top.equalTo(noFriendImageView.snp.bottom).offset(49.adjustedHeight) | ||
$0.leading.equalToSuperview().inset(38.adjustedWidth) | ||
$0.width.equalTo(80.adjustedWidth) | ||
$0.height.equalTo(40.adjustedHeight) | ||
$0.bottom.equalToSuperview().inset(20) | ||
} | ||
|
||
wowButton.snp.makeConstraints { | ||
$0.top.bottom.equalTo(nextButton) | ||
$0.trailing.equalToSuperview().inset(38.adjustedWidth) | ||
$0.width.equalTo(81.adjustedWidth) | ||
$0.height.equalTo(40.adjustedHeight) | ||
} | ||
} | ||
} | ||
|
||
extension WithdrawalNoFriendView { | ||
@objc private func closeView() { | ||
self.isHidden = true | ||
self.removeFromSuperview() | ||
} | ||
|
||
@objc private func nextButtonTapped() { | ||
closeView() | ||
nextButtonAction() | ||
} | ||
|
||
@objc private func wowButtonTapped() { | ||
closeView() | ||
wowButtonAction() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters