Skip to content

Commit

Permalink
Fix copy method to keep other text data when adding custom attributed…
Browse files Browse the repository at this point in the history
… string data.
  • Loading branch information
SergioEstevao authored and jkmassel committed May 24, 2019
1 parent 72cb0c4 commit dff493e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Aztec/Classes/TextKit/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,11 @@ open class TextView: UITextView {
// MARK: - Pasteboard Helpers

internal func storeInPasteboard(encoded data: Data, pasteboard: UIPasteboard = UIPasteboard.general) {
pasteboard.setData(data, forPasteboardType: NSAttributedString.pastesboardUTI)
if pasteboard.numberOfItems > 0 {
pasteboard.items[0][NSAttributedString.pastesboardUTI] = data;
} else {
pasteboard.addItems([[NSAttributedString.pastesboardUTI: data]])
}
}

// MARK: - Intercept keyboard operations
Expand Down

0 comments on commit dff493e

Please sign in to comment.