Skip to content

Commit

Permalink
Impement demo web-view to show unsupported block content.
Browse files Browse the repository at this point in the history
  • Loading branch information
etoledom committed Apr 14, 2020
1 parent 061cb7b commit e102ae2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ios/gutenberg/GutenbergViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import UIKit
import Gutenberg
import Aztec
import WebKit

class GutenbergViewController: UIViewController {

Expand Down Expand Up @@ -194,6 +195,17 @@ extension GutenbergViewController: GutenbergBridgeDelegate {
func gutenbergDidLogUserEvent(_ event: GutenbergUserEvent) {
print("Gutenberg loged user event")
}

func gutenbergDidRequestUnsupportedBlockFallback(with content: String) {
let webView = WKWebView()
let meta = """
<meta name="viewport" content="width=device-width, shrink-to-fit=YES">
"""
webView.loadHTMLString(meta+content, baseURL: nil)
let controller = UIViewController()
controller.view = webView
present(controller, animated: true)
}
}

extension GutenbergViewController: GutenbergBridgeDataSource {
Expand Down

0 comments on commit e102ae2

Please sign in to comment.