Skip to content

Commit

Permalink
[Feat] #61 - 대댓글 뷰 구현 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
binisnil committed Nov 19, 2024
1 parent ebe5b34 commit 18ad11c
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 37 deletions.
20 changes: 12 additions & 8 deletions Wable-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
0593F6DB2C96E75600FFAD82 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 0593F6DA2C96E75600FFAD82 /* FirebaseAnalytics */; };
0593F6DD2C96E75600FFAD82 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 0593F6DC2C96E75600FFAD82 /* FirebaseMessaging */; };
0593F6E42C9AFC1B00FFAD82 /* WablePushAlarmHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0593F6E32C9AFC1B00FFAD82 /* WablePushAlarmHelper.swift */; };
05AD1EB52CE4C1D900F36D6B /* Dev.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */; };
05AD1EB72CE4C1F400F36D6B /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05AD1EB62CE4C1F400F36D6B /* GoogleService-Info.plist */; };
05FBEED22C886A0200E4BF17 /* HomeFeedContentDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05FBEED12C886A0200E4BF17 /* HomeFeedContentDTO.swift */; };
3C35317F2C6F13FF0015A8FA /* Pretendard-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3C35317C2C6F13FF0015A8FA /* Pretendard-Regular.otf */; };
3C3531802C6F13FF0015A8FA /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3C35317D2C6F13FF0015A8FA /* Pretendard-SemiBold.otf */; };
Expand Down Expand Up @@ -190,7 +192,6 @@
3CF344EB2C75EE410038BB53 /* MyPageSignOutConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CF344EA2C75EE410038BB53 /* MyPageSignOutConfirmViewController.swift */; };
3CF344ED2C75EE620038BB53 /* MyPageSignOutConfirmView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CF344EC2C75EE620038BB53 /* MyPageSignOutConfirmView.swift */; };
3CF344EF2C7607BB0038BB53 /* MyPageSignOutConfirmViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CF344EE2C7607BB0038BB53 /* MyPageSignOutConfirmViewModel.swift */; };
DE1B58172CDDD3F90017C319 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DE1B58162CDDD3F90017C319 /* GoogleService-Info.plist */; };
DE7FAAA02CDF971300A4D8A2 /* ReuseIdentifiable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7FAA9F2CDF971300A4D8A2 /* ReuseIdentifiable.swift */; };
DEB5793A2CE3541300BEE54D /* CombineCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = DEB579392CE3541300BEE54D /* CombineCocoa */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -277,6 +278,8 @@
054A85532CAA98CC00EFD9A5 /* AmplitudeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmplitudeManager.swift; sourceTree = "<group>"; };
0593F6D52C96D6C100FFAD82 /* WablePhotoDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WablePhotoDetailView.swift; sourceTree = "<group>"; };
0593F6E32C9AFC1B00FFAD82 /* WablePushAlarmHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WablePushAlarmHelper.swift; sourceTree = "<group>"; };
05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Dev.xcconfig; sourceTree = "<group>"; };
05AD1EB62CE4C1F400F36D6B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
05FBEED12C886A0200E4BF17 /* HomeFeedContentDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeFeedContentDTO.swift; sourceTree = "<group>"; };
3C35317C2C6F13FF0015A8FA /* Pretendard-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Regular.otf"; sourceTree = "<group>"; };
3C35317D2C6F13FF0015A8FA /* Pretendard-SemiBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-SemiBold.otf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -373,8 +376,6 @@
3CF344EA2C75EE410038BB53 /* MyPageSignOutConfirmViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageSignOutConfirmViewController.swift; sourceTree = "<group>"; };
3CF344EC2C75EE620038BB53 /* MyPageSignOutConfirmView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageSignOutConfirmView.swift; sourceTree = "<group>"; };
3CF344EE2C7607BB0038BB53 /* MyPageSignOutConfirmViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageSignOutConfirmViewModel.swift; sourceTree = "<group>"; };
DE1B58142CDDD1E50017C319 /* Dev.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Dev.xcconfig; sourceTree = "<group>"; };
DE1B58162CDDD3F90017C319 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
DE7FAA9F2CDF971300A4D8A2 /* ReuseIdentifiable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReuseIdentifiable.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -596,7 +597,7 @@
0547F48D2C60D968001E3039 = {
isa = PBXGroup;
children = (
DE1B58142CDDD1E50017C319 /* Dev.xcconfig */,
05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */,
0547F4982C60D968001E3039 /* Wable-iOS */,
0547F4972C60D968001E3039 /* Products */,
);
Expand All @@ -613,7 +614,7 @@
0547F4982C60D968001E3039 /* Wable-iOS */ = {
isa = PBXGroup;
children = (
DE1B58162CDDD3F90017C319 /* GoogleService-Info.plist */,
05AD1EB62CE4C1F400F36D6B /* GoogleService-Info.plist */,
3C8B4E102C78DE2C00174943 /* Wable-iOS.entitlements */,
0547F4B02C60E247001E3039 /* Presentation */,
0547F4AF2C60E240001E3039 /* Network */,
Expand Down Expand Up @@ -1283,12 +1284,13 @@
files = (
054308EA2CB7F582001861F1 /* wable_loading.json in Resources */,
0547F4A32C60D96B001E3039 /* Assets.xcassets in Resources */,
05AD1EB52CE4C1D900F36D6B /* Dev.xcconfig in Resources */,
054308EC2CB7F6CE001861F1 /* wable_splash.json in Resources */,
3C35317F2C6F13FF0015A8FA /* Pretendard-Regular.otf in Resources */,
3C8B4E052C76247800174943 /* wable_tab.json in Resources */,
3C3531802C6F13FF0015A8FA /* Pretendard-SemiBold.otf in Resources */,
05AD1EB72CE4C1F400F36D6B /* GoogleService-Info.plist in Resources */,
0547F4A62C60D96B001E3039 /* Base in Resources */,
DE1B58172CDDD3F90017C319 /* GoogleService-Info.plist in Resources */,
0547F4C82C621ABC001E3039 /* Color.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1486,7 +1488,7 @@
/* Begin XCBuildConfiguration section */
0547F4A82C60D96B001E3039 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DE1B58142CDDD1E50017C319 /* Dev.xcconfig */;
baseConfigurationReference = 05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -1550,6 +1552,7 @@
};
0547F4A92C60D96B001E3039 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -1606,7 +1609,7 @@
};
0547F4AB2C60D96B001E3039 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DE1B58142CDDD1E50017C319 /* Dev.xcconfig */;
baseConfigurationReference = 05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -1644,6 +1647,7 @@
};
0547F4AC2C60D96B001E3039 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 05AD1EB42CE4C1D900F36D6B /* Dev.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down
2 changes: 1 addition & 1 deletion Wable-iOS/Global/Extention/UIButton+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extension UIButton {
func setTitleWithConfiguration(_ title: String, font: UIFont, textColor: UIColor) {

var config = self.configuration ?? UIButton.Configuration.plain()

config.contentInsets = NSDirectionalEdgeInsets.zero
config.title = title
config.imagePadding = 4.adjusted

Expand Down
3 changes: 3 additions & 0 deletions Wable-iOS/Global/Literals/ImageLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ enum ImageLiterals {
static var icX: UIImage { .load(name: "ic_x") }
static var icInfoPurple: UIImage { .load(name: "ic_info") }
static var icVersus: UIImage { .load(name: "ic_versus") }
static var icHeartGray: UIImage { .load(name: "ic_heart_gray")}
static var icRippleRely: UIImage { .load(name: "ic_ripple_reply")}
static var icHeartPressSmall: UIImage { .load(name: "ic_heart_press_small")}
}

enum Image {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Status=Default, Size=S.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Status=Default, [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Status=Default, [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Status=Press, Size=S.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Status=Press, [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Status=Press, [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "ic_ripple_reply.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions Wable-iOS/Network/Home/ResponseDTO/FeedDetailReplyDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,28 @@ struct FeedDetailReplyDTO: Codable {
let commentImageUrl: String?
let memberFanTeam: String
}

// MARK: - 1.1.0v DTO

struct FeedReplyListDTO: Codable {
let commentID, memberID: Int
let memberProfileURL, memberNickname: String
let isGhost: Bool
let memberGhost: Int
let isLiked: Bool
let commentLikedNumber: Int
let commentText, time: String
let isDeleted: Bool
let memberFanTeam: String
let parentCommentID: Int
let isBlind: Bool?

enum CodingKeys: String, CodingKey {
case commentID = "commentId"
case memberID = "memberId"
case memberProfileURL = "memberProfileUrl"
case memberNickname, isGhost, memberGhost, isLiked, commentLikedNumber, commentText, time, isDeleted, memberFanTeam
case parentCommentID = "parentCommentId"
case isBlind
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,6 @@ extension FeedDetailViewController: UITableViewDataSource {
if self.replyData[indexPath.row].memberId == loadUserData()?.memberId {
cell.bottomView.ghostButton.isHidden = true

cell.bottomView.heartButton.snp.remakeConstraints {
$0.height.equalTo(24.adjusted)
$0.width.equalTo(45.adjusted)
$0.trailing.equalToSuperview()
$0.centerY.equalToSuperview()
}

cell.menuButtonTapped = {
self.homeBottomsheetView.showSettings()
self.homeBottomsheetView.deleteButton.isHidden = false
Expand All @@ -684,13 +677,6 @@ extension FeedDetailViewController: UITableViewDataSource {
// 다른 유저인 경우
cell.bottomView.ghostButton.isHidden = false

cell.bottomView.heartButton.snp.remakeConstraints {
$0.height.equalTo(24.adjusted)
$0.width.equalTo(45.adjusted)
$0.trailing.equalTo(cell.bottomView.ghostButton.snp.leading).offset(-16.adjusted)
$0.centerY.equalTo(cell.bottomView.ghostButton)
}

cell.menuButtonTapped = {
self.homeBottomsheetView.showSettings()
self.homeBottomsheetView.reportButton.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ final class FeedDetailTableViewCell: UITableViewCell {
}

bottomView.snp.makeConstraints {
$0.leading.trailing.equalToSuperview().inset(16.adjusted)
$0.leading.equalTo(contentLabel)
$0.trailing.equalToSuperview().inset(16.adjusted)
$0.height.equalTo(31.adjusted)
$0.bottom.equalToSuperview().inset(18.adjusted)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ final class FeedDetailBottomView: UIView {

var ghostButtonTapped: (() -> Void)?
var heartButtonTapped: (() -> Void)?
var replyButtonTapped: (() -> Void)?
var isLiked: Bool = false {
didSet {
if isLiked {
heartButton.setImage(ImageLiterals.Icon.icHeartPress, for: .normal)
heartButton.setImage(ImageLiterals.Icon.icHeartPressSmall, for: .normal)
} else {
heartButton.setImage(ImageLiterals.Icon.icHeartDefault, for: .normal)
heartButton.setImage(ImageLiterals.Icon.icHeartGray, for: .normal)
}
}
}
Expand All @@ -31,8 +32,9 @@ final class FeedDetailBottomView: UIView {
let button = UIButton()
var config = UIButton.Configuration.plain()
button.translatesAutoresizingMaskIntoConstraints = false
button.setImage(ImageLiterals.Icon.icHeartDefault, for: .normal)
button.contentHorizontalAlignment = .center
config.contentInsets = NSDirectionalEdgeInsets.zero
button.setImage(ImageLiterals.Icon.icHeartGray, for: .normal)
button.contentHorizontalAlignment = .leading
return button
}()

Expand All @@ -42,6 +44,16 @@ final class FeedDetailBottomView: UIView {
return button
}()

var replyButton: UIButton = {
let button = UIButton()
var config = UIButton.Configuration.plain()
button.translatesAutoresizingMaskIntoConstraints = false
button.setImage(ImageLiterals.Icon.icRippleRely, for: .normal)
button.contentHorizontalAlignment = .center
button.setTitleWithConfiguration("답글쓰기", font: .caption3, textColor: .gray600)
return button
}()

// MARK: - Life Cycles

override init(frame: CGRect) {
Expand All @@ -63,27 +75,37 @@ final class FeedDetailBottomView: UIView {
extension FeedDetailBottomView {
private func setHierarchy() {
self.addSubviews(heartButton,
ghostButton)
replyButton,
ghostButton
)
}

private func setLayout() {
heartButton.snp.makeConstraints {
$0.height.equalTo(21.adjusted)
$0.width.equalTo(53.adjusted)
$0.centerY.equalToSuperview()
$0.leading.equalToSuperview()
}

replyButton.snp.makeConstraints {
$0.height.equalTo(20.adjusted)
$0.width.equalTo(66.adjusted)
$0.centerY.equalTo(heartButton)
$0.leading.equalTo(heartButton.snp.trailing).offset(8.adjusted)
}

ghostButton.snp.makeConstraints {
$0.height.width.equalTo(32.adjusted)
$0.trailing.equalToSuperview()
$0.centerY.equalToSuperview()
}

heartButton.snp.makeConstraints {
$0.height.equalTo(24.adjusted)
$0.width.equalTo(45.adjusted)
$0.trailing.equalTo(ghostButton.snp.leading).offset(-16.adjusted)
$0.centerY.equalTo(ghostButton)
}
}

private func setAddTarget() {
heartButton.addTarget(self, action: #selector(heartButtonDidTapped), for: .touchUpInside)
ghostButton.addTarget(self, action: #selector(ghostButtonDidTapped), for: .touchUpInside)
replyButton.addTarget(self, action: #selector(replyButtonDidTapped), for: .touchUpInside)
}

@objc
Expand All @@ -96,7 +118,12 @@ extension FeedDetailBottomView {
ghostButtonTapped?()
}

@objc
private func replyButtonDidTapped() {
replyButtonTapped?()
}

func bind(heart: Int) {
heartButton.setTitleWithConfiguration("\(heart)", font: .caption1, textColor: .wableBlack)
heartButton.setTitleWithConfiguration("\(heart)", font: .caption1, textColor: .gray600)
}
}

0 comments on commit 18ad11c

Please sign in to comment.