Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] #92 - 글 상세 edit으로 타입 변경시, changeTitle로 타이틀 변경 #93

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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