Skip to content

Commit

Permalink
[Fix] resolve error
Browse files Browse the repository at this point in the history
- Publishing changes from within view updates 해결 -> DispatchQueue.main.async
- 텍스트필드 focused된 채로 업로드 버튼 클릭 시 앱이 멈추는 에러 해결 -> focused 해제 후 업로드 동작하도록 수정
  • Loading branch information
JMM00 committed Aug 13, 2023
1 parent 7f5e7e6 commit 788e06b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ struct CustomTextEditor: UIViewRepresentable {
}

func textViewDidChangeSelection(_ textView: UITextView) {
self.text = textView.text ?? ""
DispatchQueue.main.async {
self.text = textView.text ?? ""
}
}

func textViewDidBeginEditing(_ textView: UITextView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct WriteCurationInfoView: View {
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
isDescriptionFieldFocused = false
viewModel.addCuration()
self.isWriting.toggle()
} label: {
Expand Down

0 comments on commit 788e06b

Please sign in to comment.