Skip to content

Commit

Permalink
Merge pull request sopt-makers#93 from yangsubinn/fix/sopt-makers#92
Browse files Browse the repository at this point in the history
[Fix] sopt-makers#92 - 글 상세 edit으로 타입 변경시, changeTitle로 타이틀 변경
  • Loading branch information
yangsubinn authored Jan 8, 2023
2 parents 2e6962a + 3c6696c commit eaef7eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ extension CustomButton {

/// 버튼의 Title 변경
@discardableResult
public func changeTitle(attributedString: NSAttributedString) -> Self {
self.setAttributedTitle(attributedString, for: .normal)
public func changeTitle(attributedString: String) -> Self {
let string = NSAttributedString(string: attributedString, attributes: [.font: UIFont.h2, .foregroundColor: self.titleLabel?.textColor ?? .white])
self.setAttributedTitle(string, for: .normal)
return self
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ extension ListDetailVC: UITextViewDelegate {

public func textViewDidChange(_ textView: UITextView) {
let missionImageViewFilled = missionImageView.image != nil
self.bottomButton.setEnabled(textView.hasText && missionImageViewFilled)
self.bottomButton.setEnabled(textView.hasText && missionImageViewFilled && textView.text != originText)
}
}

Expand All @@ -394,11 +394,12 @@ extension ListDetailVC {
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false
self.originText = textView.text
self.originImage = self.missionImageView.image ?? UIImage()
self.bottomButton.setTitle(I18N.ListDetail.editComplete, for: .normal)
self.bottomButton.changeTitle(attributedString: I18N.ListDetail.editComplete)
.setEnabled(false)
} else {
self.naviBar.resetLeftButtonAction()
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
self.bottomButton.setTitle(I18N.ListDetail.missionComplete, for: .normal)
self.bottomButton.changeTitle(attributedString: I18N.ListDetail.missionComplete)
}

switch type {
Expand Down

0 comments on commit eaef7eb

Please sign in to comment.