Class: Turbo::ScriptMessageHandler
- Inherits:
-
Object
- Object
- Turbo::ScriptMessageHandler
- Defined in:
- lib/turbo/web_view/script_message_handler.rb
Overview
This class prevents retain cycle caused by WKUserContentController
Instance Attribute Summary collapse
-
#delegate ⇒ Object
Returns the value of attribute delegate.
Instance Method Summary collapse
- #initWithDelegate(delegate) ⇒ Object
- #userContentController(userContentController, didReceiveScriptMessage: message) ⇒ Object
Instance Attribute Details
#delegate ⇒ Object
Returns the value of attribute delegate.
5 6 7 |
# File 'lib/turbo/web_view/script_message_handler.rb', line 5 def delegate @delegate end |
Instance Method Details
#initWithDelegate(delegate) ⇒ Object
7 8 9 10 |
# File 'lib/turbo/web_view/script_message_handler.rb', line 7 def initWithDelegate(delegate) self.delegate = delegate self end |
#userContentController(userContentController, didReceiveScriptMessage: message) ⇒ Object
12 13 14 |
# File 'lib/turbo/web_view/script_message_handler.rb', line 12 def userContentController(userContentController, didReceiveScriptMessage: ) delegate.scriptMessageHandlerDidReceiveMessage() if delegate end |