Skip to content

[4]: VEditor Components

Ha Hyun soo edited this page Jan 10, 2019 · 14 revisions

Category

  • VEditorMediaNode
    • VEditorImageNode
    • VEditorVideoNode
  • VEditorMediaPlaceholderNode
  • VEditorDeleteMediaNode
  • VEditorOpenGraphNode
  • VEditorTypingControlNode
  • VEditorTextCellNode
    • VEditorTextNode
      • VEditorTextStorage

VEditorMediaNode

Under construction…

VEditorMediaPlaceholderNode

```swift

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)
    }

VEditorDeleteMediaNode

Under construction…

VEditorOpenGraphNode

VEditorOpenGraphNode is basic open graph cell example usage

VEditorTypingControlNode

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) {

VEditorTextCellNode

Under construction…

Clone this wiki locally