Skip to content

Commit

Permalink
Merge pull request #358 from team-yello/fix/#356-fixWriting
Browse files Browse the repository at this point in the history
Feat [#356] 건의사항 추가 반영
  • Loading branch information
chaentopia committed Mar 3, 2024
2 parents e05924b + 77250d3 commit 589a559
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 6 deletions.
22 changes: 21 additions & 1 deletion YELLO-iOS/YELLO-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
C3DC4ADE2A6042B5001DCE04 /* MyYelloDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DC4ADD2A6042B5001DCE04 /* MyYelloDetailModel.swift */; };
C3E4B6FF2A68080A001A0355 /* MyYelloEmptyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E4B6FE2A68080A001A0355 /* MyYelloEmptyTableViewCell.swift */; };
C3E4B7012A682A4C001A0355 /* FriendEmptyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E4B7002A682A4C001A0355 /* FriendEmptyTableViewCell.swift */; };
C3E5626F2B94B33C003AFC6C /* FriendAddButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E5626E2B94B33C003AFC6C /* FriendAddButton.swift */; };
C3EC57332A6AB2F300676388 /* Unbounded-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C3EC57322A6AB2F300676388 /* Unbounded-Regular.ttf */; };
C3FF246C2A5D476D00A97D40 /* WithdrawalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FF246B2A5D476D00A97D40 /* WithdrawalViewController.swift */; };
C3FF246F2A5D47D100A97D40 /* WithdrawalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3FF246E2A5D47D100A97D40 /* WithdrawalView.swift */; };
Expand Down Expand Up @@ -722,6 +723,7 @@
C3DC4ADD2A6042B5001DCE04 /* MyYelloDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyYelloDetailModel.swift; sourceTree = "<group>"; };
C3E4B6FE2A68080A001A0355 /* MyYelloEmptyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyYelloEmptyTableViewCell.swift; sourceTree = "<group>"; };
C3E4B7002A682A4C001A0355 /* FriendEmptyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendEmptyTableViewCell.swift; sourceTree = "<group>"; };
C3E5626E2B94B33C003AFC6C /* FriendAddButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendAddButton.swift; sourceTree = "<group>"; };
C3EC57322A6AB2F300676388 /* Unbounded-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Unbounded-Regular.ttf"; sourceTree = "<group>"; };
C3FF246B2A5D476D00A97D40 /* WithdrawalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithdrawalViewController.swift; sourceTree = "<group>"; };
C3FF246E2A5D47D100A97D40 /* WithdrawalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithdrawalView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1305,7 +1307,8 @@
C3C57BEE2A5C066B00B84CAA /* ViewController */,
C3C57BED2A5C066200B84CAA /* View */,
C3C57BF12A5C087600B84CAA /* Cells */,
C3C57BF42A5C093D00B84CAA /* FriendModel.swift */,
C3E562712B94D68F003AFC6C /* Model */,
C3E562702B94B375003AFC6C /* Components */,
C31315A92A7A5F8100FB8B43 /* Search */,
);
path = Recommending;
Expand Down Expand Up @@ -2351,6 +2354,22 @@
path = View;
sourceTree = "<group>";
};
C3E562702B94B375003AFC6C /* Components */ = {
isa = PBXGroup;
children = (
C3E5626E2B94B33C003AFC6C /* FriendAddButton.swift */,
);
path = Components;
sourceTree = "<group>";
};
C3E562712B94D68F003AFC6C /* Model */ = {
isa = PBXGroup;
children = (
C3C57BF42A5C093D00B84CAA /* FriendModel.swift */,
);
path = Model;
sourceTree = "<group>";
};
C3FF246D2A5D477400A97D40 /* Withdrawal */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2739,6 +2758,7 @@
C3A799E62A494D6800D3EFD8 /* Int+.swift in Sources */,
2AFB01482A8A79A5001BB2C7 /* VotingUnreadResponseDTO.swift in Sources */,
367113712A7D6C740037E0D2 /* UniversityView.swift in Sources */,
C3E5626F2B94B33C003AFC6C /* FriendAddButton.swift in Sources */,
363D81642B262A460095F6CC /* NameViewController.swift in Sources */,
C3FF24972A5E907D00A97D40 /* MyYelloNameTableViewCell.swift in Sources */,
C37DFC482A8501F300D3B685 /* PaymentPlusView.swift in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion YELLO-iOS/YELLO-iOS/Global/Literals/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ enum StringLiterals {
enum Empty {
static let title = "찾는 친구가 없다면\n친구를 초대해볼까요?"
static let timeLineAllTitle = "친구들이 받은 쪽지가 궁금하다면\n친구를 초대해볼까요?"
static let timeLineMyTitle = "쪽지를 보낼 친구가 없다면\n친구를 초대하세요!"
static let timeLineMyTitle = "전하고 싶은 말이 있는 친구에게\n쪽지를 보내 보세요!"
static let inviteButton = "친구 초대하고 리워드 받기"
static let myInviteButton = "지금 바로 쪽지 보내기"
}

enum Invite {
Expand Down Expand Up @@ -358,6 +359,7 @@ enum StringLiterals {
static let cancel = "취소"
static let confirm = "네, 친구를 끊을게요"
static let toastMessage = " 님과 친구 끊기를 완료했어요."
static let empty = "아직 친구가 없네요, 친구를 초대해 보세요!"
}

enum EditProfile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ final class AroundView: BaseView {

filterButton.do {
$0.backgroundColor = .black
$0.makeBorder(width: 1, color: .grayscales800)
$0.makeBorder(width: 1, color: .grayscales600)
$0.makeCornerRound(radius: 14.adjustedHeight)
$0.addTarget(self, action: #selector(filterButtonTapped), for: .touchUpInside)
}
Expand Down Expand Up @@ -338,6 +338,7 @@ extension AroundView {
aroundEmptyView.emptyDescriptionLabel.setTextWithLineHeight(
text: StringLiterals.Recommending.Empty.timeLineMyTitle,
lineHeight: 24)
aroundEmptyView.inviteButton.setTitle(StringLiterals.Recommending.Empty.myInviteButton, for: .normal)
} else {
filterButtonLabel.text = StringLiterals.Around.allYello
filterButtonStackView.spacing = 6.adjustedWidth
Expand All @@ -347,6 +348,7 @@ extension AroundView {
aroundEmptyView.emptyDescriptionLabel.setTextWithLineHeight(
text: StringLiterals.Recommending.Empty.timeLineAllTitle,
lineHeight: 24)
aroundEmptyView.inviteButton.setTitle(StringLiterals.Recommending.Empty.inviteButton, for: .normal)
}

self.aroundPage = -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ final class ProfileView: UIView {
weak var handleShopButton: HandleShopButton?
weak var handleEditButton: HandleEditButton?
var indexNumber: Int = -1
var friendCount: Int = 0
var friendCount: Int = 0 {
didSet {
emptyLabel.isHidden = friendCount == 0 ? false : true
}
}

var fetchingMore = false
var isFinishPaging = false
Expand Down Expand Up @@ -57,6 +61,7 @@ final class ProfileView: UIView {
lazy var myFriendTableView = UITableView(frame: .zero, style: .grouped)
let refreshControl = UIRefreshControl()
let headerBorder = CALayer()
private let emptyLabel = UILabel()

lazy var topButton = UIButton()
private var isButtonHidden: Bool = false
Expand Down Expand Up @@ -120,12 +125,19 @@ extension ProfileView {
headerBorder.do {
$0.backgroundColor = UIColor.black.cgColor
}

emptyLabel.do {
$0.text = StringLiterals.Profile.Friend.empty
$0.textColor = .grayscales600
$0.font = .uiLabelLarge
}
}

private func setLayout() {
self.addSubviews(navigationBarView,
myFriendTableView,
topButton)
myFriendTableView.addSubviews(emptyLabel)

navigationBarView.snp.makeConstraints {
$0.top.equalToSuperview()
Expand All @@ -144,6 +156,11 @@ extension ProfileView {
$0.trailing.equalToSuperview().inset(16.adjustedWidth)
$0.bottom.equalTo(myFriendTableView.snp.bottom).inset(16.adjustedHeight)
}

emptyLabel.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalToSuperview().inset(389.adjustedHeight)
}
}

private func setDelegate() {
Expand Down Expand Up @@ -205,6 +222,7 @@ extension ProfileView {
case .success(let data):
guard let data = data.data else { return }

self.friendCount = data.totalCount
let friendModels = data.friends.map { profileFriend in

return ProfileFriendResponseDetail(userId: profileFriend.userId, name: profileFriend.name, profileImageUrl: profileFriend.profileImageUrl, group: profileFriend.group, yelloId: profileFriend.yelloId, yelloCount: profileFriend.yelloCount, friendCount: profileFriend.friendCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ extension ProfileViewController: HandleDeleteFriendButtonDelegate {
self.profileView.myProfileFriendModelDummy.remove(at: self.profileView.indexNumber)
self.profileView.myFriendTableView.deleteRows(at: [[0, self.profileView.indexNumber]], with: .right)
self.profileView.myProfileHeaderView.profileUser()
self.profileView.friendCount -= 1
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
self.profileView.myFriendTableView.reloadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class FriendTableViewCell: UITableViewCell {
let profileImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 42.adjusted, height: 42.adjusted))
let nameLabel = UILabel()
let schoolLabel = UILabel()
lazy var addButton = UIButton()
lazy var addButton = FriendAddButton()
let separatorLine = UIView()
var isTapped: Bool = false
var friendId: Int = -1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// FriendAddButton.swift
// YELLO-iOS
//
// Created by 정채은 on 3/3/24.
//

import UIKit

final class FriendAddButton: UIButton {

// MARK: - Functions
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
let expandedBounds = bounds.insetBy(dx: 0, dy: -23.adjustedHeight)
return expandedBounds.contains(point)
}

override init(frame: CGRect) {
super.init(frame: frame)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class FriendSearchTableViewCell: UITableViewCell {
let nameLabel = UILabel()
let yelloIdLabel = UILabel()
let schoolLabel = UILabel()
let addButton = UIButton()
let addButton = FriendAddButton()
let myFriendLabel = UILabel()

var isFriend: Bool = false {
Expand Down

0 comments on commit 589a559

Please sign in to comment.