Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ struct ByeBooNavigationBar {
target: topViewController,
action: action
)
navigationItem.leftBarButtonItem = backButtonItem
navigationItem.leftBarButtonItems = [makeSpacer(), backButtonItem]

let editButtonItem = makeBarButtonItem(
image: .edit,
target: topViewController,
action: secondAction
)
navigationItem.rightBarButtonItem = editButtonItem
navigationItem.rightBarButtonItems = [makeSpacer(), editButtonItem]

case .title(let string, _):
navigationItem.title = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ final class LoadingView: BaseView {

func updateNickname(_ newNickname: String) {
self.nickname = newNickname
titleLabel.attributedText = "\(nickname)님에게 꼭 맞는\n이별 극복 여정을 찾는 중 ..."
titleLabel.attributedText = "\(nickname)님에게 꼭 맞는\n극복 여정을 찾는 중 ..."
.makeTitle(rangedText: nickname, font: FontManager.body1Sb16.font)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

import UIKit

import SnapKit

final class CommonQuestAnswerCell: UITableViewCell {

private var answerID: Int?
private var containerBottomConstraint: Constraint?

private let containerView = UIView()
private let userIconView = UIImageView()
Expand Down Expand Up @@ -70,7 +73,7 @@ final class CommonQuestAnswerCell: UITableViewCell {
containerView.snp.makeConstraints {
$0.top.equalToSuperview().inset(24.adjustedH)
$0.horizontalEdges.equalToSuperview().inset(24.adjustedW)
$0.bottom.equalToSuperview()
containerBottomConstraint = $0.bottom.equalToSuperview().constraint
}
userIconView.snp.makeConstraints {
$0.top.equalToSuperview().inset(16.adjustedH)
Expand Down Expand Up @@ -100,7 +103,8 @@ extension CommonQuestAnswerCell {
func bind(
profileIcon: UIImage?,
answer: CommonQuestAnswerEntity,
writtenAt: String
writtenAt: String,
isLast: Bool
) {
if let profileIcon {
userIconView.image = profileIcon
Expand All @@ -110,6 +114,9 @@ extension CommonQuestAnswerCell {
writtenDateLabel.text = writtenAt

answerID = answer.answerID

let inset = isLast ? 24.adjustedH : 0
containerBottomConstraint?.update(inset: inset)
}

func getAnswewrID() -> Int? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,15 @@ extension CommonQuestViewController: UITableViewDataSource {
let answer = viewModel.getAnswer(at: indexPath.row - 1)
let profileIcon = viewModel.getProfileIcon(at: indexPath.row - 1)
let writtenAt = viewModel.getWrittenAt(at: indexPath.row - 1)
let isLast = viewModel.isLast(at: indexPath.row - 1)

if let answer,
let writtenAt {
cell.bind(
profileIcon: profileIcon,
answer: answer,
writtenAt: writtenAt
writtenAt: writtenAt,
isLast: isLast
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,8 @@ extension CommonQuestViewModel {
return DateFormatter.toDisplayDateString(from: writtenAt)
}
}

func isLast(at index: Int) -> Bool {
answersCount == answers.count && index == answers.count - 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "mu-off.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "my-on.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"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.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading