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

TextView에서 CustomView Drag-Drop시 Preview가 제대로 나오지 않던 문제 수정 #156

Merged
merged 2 commits into from
Dec 10, 2024
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 @@ -52,7 +52,6 @@ final class EditPageCell: UITableViewCell {
super.prepareForReuse()

input.send(.pageWillDisappear)
cancellables.forEach { $0.cancel() }
cancellables = []
viewModel = nil
textView.text = ""
Expand Down Expand Up @@ -158,6 +157,7 @@ final class EditPageCell: UITableViewCell {
let attachmentString = NSAttributedString(attachment: mediaAttachment)
// Placeholder(공백) 교체
mutableAttributedString.replaceCharacters(in: range, with: attachmentString)
mediaAttachment.dataSource = self
}

mutableAttributedString.addAttributes(
Expand Down Expand Up @@ -264,9 +264,8 @@ final class EditPageCell: UITableViewCell {
shouldChangeTextIn: NSRange(location: textStorage.length, length: 0),
replacementText: text
) else { return }
textStorage.beginEditing()
attachment.dataSource = self
textStorage.append(text)
textStorage.endEditing()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ final class EditPageViewModel: ViewModelType {
}

private func pageWillDisappear() {
cancellables.forEach { $0.cancel() }
cancellables = []
}

Expand Down
Loading