Skip to content

Commit

Permalink
Merge pull request #524 from boostcampwm2023/iOS/hotfix
Browse files Browse the repository at this point in the history
[iOS] feat: 캡처 버튼 버그 수정, 편집화면 버그 수정
  • Loading branch information
looloolalaa authored Dec 8, 2023
2 parents 6322e4f + a016241 commit a2970fd
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
10 changes: 3 additions & 7 deletions iOS/moti/moti/Design/Sources/Design/CaptureButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public final class CaptureButton: UIButton {

setupUI()
addTarget()

let size = min(Self.defaultSize, Self.defaultSize)
applyCorenrRadius(size: size)
}

required init?(coder: NSCoder) {
Expand All @@ -36,13 +39,6 @@ public final class CaptureButton: UIButton {
addTarget(self, action: #selector(captureButtonTouchUpOutside), for: .touchUpOutside)
}

public override func layoutSubviews() {
super.layoutSubviews()

let size = min(frame.width, frame.height)
applyCorenrRadius(size: size)
}

// MARK: - Setup
private func setupUI() {
backgroundColor = .motiBackground
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ extension EditAchievementViewController: UIPickerViewDataSource {
private extension EditAchievementViewController {
func setupNavigationBar() {
navigationItem.rightBarButtonItems = [doneButton]
doneButton.isEnabled = false
doneButton.title = "로딩 중"
}

func showDoneButton() {
Expand Down Expand Up @@ -276,7 +274,8 @@ private extension EditAchievementViewController {
guard let self else { return }
print("Save Image: \(state)")
switch state {
case .none, .loading:
case .none: break
case .loading:
doneButton.isEnabled = false
doneButton.title = "로딩 중"
case .finish:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,25 @@ final class GroupDetailAchievementViewController: BaseViewController<GroupDetail
})
// 작성자가 아닌 유저에게만 표시
let blockingAchievementAction = UIAction(title: "도전기록 차단", attributes: .destructive, handler: { _ in
self.viewModel.action(.blockingAchievement)
self.delegate?.blockingAchievementMenuDidClicked(achievementId: self.viewModel.achievement.id)
self.showDestructiveTwoButtonAlert(
title: "도전기록 차단",
message: "더이상 해당 도전기록을 볼 수 없습니다.\n정말 차단하시겠습니까?",
okTitle: "차단",
okAction: {
self.viewModel.action(.blockingAchievement)
self.delegate?.blockingAchievementMenuDidClicked(achievementId: self.viewModel.achievement.id)
})
})
// 작성자가 아닌 유저에게만 표시
let blockingUserAction = UIAction(title: "사용자 차단", attributes: .destructive, handler: { _ in
self.viewModel.action(.blockingUser)
self.delegate?.blockingUserMenuDidClicked(userCode: self.viewModel.achievement.userCode)
self.showDestructiveTwoButtonAlert(
title: "사용자 차단",
message: "더이상 해당 사용자의 모든 도전기록을 볼 수 없습니다.\n정말 차단하시겠습니까?",
okTitle: "차단",
okAction: {
self.viewModel.action(.blockingUser)
self.delegate?.blockingUserMenuDidClicked(userCode: self.viewModel.achievement.userCode)
})
})

var children: [UIAction] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,23 @@ extension GroupHomeViewController: UICollectionViewDelegate {
})
// 작성자가 아닌 유저에게만 표시
let blockingAchievementAction = UIAction(title: "도전기록 차단", attributes: .destructive, handler: { _ in
self?.viewModel.action(.blockingAchievement(achievementId: selectedItem.id))
self?.showDestructiveTwoButtonAlert(
title: "도전기록 차단",
message: "더이상 해당 도전기록을 볼 수 없습니다.\n정말 차단하시겠습니까?",
okTitle: "차단",
okAction: {
self?.viewModel.action(.blockingAchievement(achievementId: selectedItem.id))
})
})
// 작성자가 아닌 유저에게만 표시
let blockingUserAction = UIAction(title: "사용자 차단", attributes: .destructive, handler: { _ in
self?.viewModel.action(.blockingUser(userCode: selectedItem.userCode))
self?.showDestructiveTwoButtonAlert(
title: "사용자 차단",
message: "더이상 해당 사용자의 모든 도전기록을 볼 수 없습니다.\n정말 차단하시겠습니까?",
okTitle: "차단",
okAction: {
self?.viewModel.action(.blockingUser(userCode: selectedItem.userCode))
})
})

var children: [UIAction] = []
Expand Down

0 comments on commit a2970fd

Please sign in to comment.