Skip to content

Commit

Permalink
skip initial content load call
Browse files Browse the repository at this point in the history
update for iOS 14
  • Loading branch information
cbess committed Oct 3, 2020
1 parent 71b8d8d commit 72e04d7
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 302 deletions.
10 changes: 8 additions & 2 deletions RichEditorView/Classes/RichEditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ private let DefaultInnerLineHeight: Int = 21
/// Is continually updated as the text is being edited.
open private(set) var contentHTML: String = "" {
didSet {
delegate?.richEditor?(self, contentDidChange: contentHTML)
if isReady {
delegate?.richEditor?(self, contentDidChange: contentHTML)
}
}
}

Expand All @@ -89,9 +91,12 @@ private let DefaultInnerLineHeight: Int = 21
}
}

/// Whether or not the editor has finished loading or not yet.
/// Whether or not the editor DOM element has finished loading or not yet.
private var isEditorLoaded = false

/// Indicates if the editor should begin sending events to the delegate
private var isReady = false

/// Value that stores whether or not the content should be editable when the editor is loaded.
/// Is basically `isEditingEnabled` before the editor is loaded.
private var editingEnabledVar = true
Expand Down Expand Up @@ -539,6 +544,7 @@ private let DefaultInnerLineHeight: Int = 21
lineHeight = DefaultInnerLineHeight

delegate?.richEditorDidLoad?(self)
isReady = true
}
updateHeight()
}
Expand Down
1 change: 1 addition & 0 deletions RichEditorViewSample/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use_frameworks!
platform :ios, '12.0'

target 'RichEditorViewSample' do
pod "RichEditorView", :path => "../"
Expand Down
4 changes: 2 additions & 2 deletions RichEditorViewSample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
RichEditorView: 89d214ab2b434f8e87c96287c1bec7e04ea7f485

PODFILE CHECKSUM: cb2ef857fe6d826f0a9974fbfdb83ee1fbc5e9cb
PODFILE CHECKSUM: f0dbfb3be27deaad9c782c282bb564c9d6d44385

COCOAPODS: 1.8.4
COCOAPODS: 1.9.3
4 changes: 2 additions & 2 deletions RichEditorViewSample/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 72e04d7

Please sign in to comment.