-
Notifications
You must be signed in to change notification settings - Fork 30
[4]: VEditor Components
Ha Hyun soo edited this page Jan 10, 2019
·
14 revisions
- VEditorMediaNode
- VEditorImageNode
- VEditorVideoNode
- VEditorMediaPlaceholderNode
- VEditorDeleteMediaNode
- VEditorOpenGraphNode
- VEditorTypingControlNode
- VEditorTextCellNode
- VEditorTextNode
- VEditorTextStorage
- VEditorTextNode
Under construction…

open class VEditorMediaPlaceholderNode: ASCellNode {
public init(xmlTag: String) { ... }
public func onSuccess(_ replaceContent: VEditorMediaContent) { ... }
public func onFailed() { ... }
}
You just handle onSuccess or onFailed method after network call
#### for example
```swift
init(xmlTag: String, url: URL) {
super.init(xmlTag: xmlTag)
MockService
.getOgObject(url)
.subscribe(onNext: { [weak self] attributes in
guard let `self` = self else {
fatalError()
}
let replaceContent = VOpenGraphContent(self.xmlTag,
attributes: attributes)
self.onSuccess(replaceContent)
}, onError: { [weak self] _ in
self?.onFailed()
}).disposed(by: disposeBag)
}
Under construction…
VEditorOpenGraphNode is basic open graph cell example usage
open class VEditorTypingControlNode: ASButtonNode {
public var typingStyle: VEditorStyle
public let xmlTag: String
public let rule: VEditorRule
public let isBlockStyle: Bool
public let isExternalHandler: Bool
public init(_ xmlTag: String,
rule: VEditorRule,
isBlockStyle: Bool = false,
isExternalHandler: Bool = false) {
- typingStyle: Typing Attribute Style Object
- xmlTag: Typing Identifier
- rule: Editor Rule
- isBlockStyle: Heading, Quote etc. In this case, selectedRange will convert to paragraphRange and use it
- isExternalHandler: Just follow VEditor Regex Text Atttribute Apply Delegate
Under construction…