diff --git a/ExampleApp/ExampleApp/AdvancedFeatures/CommandsExampleViewController.swift b/ExampleApp/ExampleApp/AdvancedFeatures/CommandsExampleViewController.swift index 24aba772..aba88cd4 100644 --- a/ExampleApp/ExampleApp/AdvancedFeatures/CommandsExampleViewController.swift +++ b/ExampleApp/ExampleApp/AdvancedFeatures/CommandsExampleViewController.swift @@ -241,9 +241,6 @@ class CommandsExampleViewController: ExamplesBaseViewController { @objc func encodeContents(sender: UIButton) { - editor.cancelPendingAsyncRendering() - return - let value = editor.transformContents(using: JSONEncoder()) let data = try! JSONSerialization.data(withJSONObject: value, options: .prettyPrinted) let jsonString = String(data: data, encoding: .utf8)! diff --git a/Proton/Sources/Swift/Core/AsyncTaskScheduler.swift b/Proton/Sources/Swift/Core/AsyncTaskScheduler.swift index e07e0e00..91e8b72a 100644 --- a/Proton/Sources/Swift/Core/AsyncTaskScheduler.swift +++ b/Proton/Sources/Swift/Core/AsyncTaskScheduler.swift @@ -36,7 +36,7 @@ class AsyncTaskScheduler { } } - func clear() { + func cancel() { runID = UUID().uuidString tasks.removeAll() pending = false diff --git a/Proton/Sources/Swift/Editor/EditorView.swift b/Proton/Sources/Swift/Editor/EditorView.swift index 7c8256ff..7b87eb45 100644 --- a/Proton/Sources/Swift/Editor/EditorView.swift +++ b/Proton/Sources/Swift/Editor/EditorView.swift @@ -458,7 +458,7 @@ open class EditorView: UIView { pendingAttributedText = newValue return } - attachmentRenderingScheduler.clear() + attachmentRenderingScheduler.cancel() // Clear text before setting new value to avoid issues with formatting/layout when // editor is hosted in a scrollable container and content is set multiple times. richTextView.attributedText = NSAttributedString() @@ -754,7 +754,7 @@ open class EditorView: UIView { /// - Note: /// Asynchronous rendering is opt-in feature scheduled by providing `asyncAttachmentRenderingDelegate` to `EditorView` public func cancelPendingAsyncRendering() { - attachmentRenderingScheduler.clear() + attachmentRenderingScheduler.cancel() } /// The range of currently marked text in a document.