Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-06-21 18:59:59 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8095516c6378832466a60187c6528bb840e32a90
8095516c
1 parent
db9fe2ce
add WKWebView event handler
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CampaignViewController.swift
View file @
8095516
...
...
@@ -9,7 +9,7 @@ import Foundation
import
UIKit
import
WebKit
@objc
public
class
CampaignViewController
:
UIViewController
,
WKNavigationDelegate
{
@objc
public
class
CampaignViewController
:
UIViewController
,
WKNavigationDelegate
,
WKScriptMessageHandler
{
@IBOutlet
weak
var
webview
:
WKWebView
!
public
var
campaignUrl
:
String
=
""
...
...
@@ -23,6 +23,14 @@ import WebKit
let
url
=
URL
(
string
:
campaignUrl
)
!
webview
.
load
(
URLRequest
(
url
:
url
))
webview
.
allowsBackForwardNavigationGestures
=
true
webview
.
configuration
.
userContentController
.
add
(
self
,
name
:
"Cosmote"
)
}
func
userContentController
(
_
userContentController
:
WKUserContentController
,
didReceive
message
:
WKScriptMessage
)
{
print
(
"=== event callback ==="
)
print
(
message
.
name
,
message
.
body
)
print
(
"=== event callback ==="
)
}
}
...
...
Please
register
or
login
to post a comment