Class: MIM::MotionBrowserToolbarDelegate
- Inherits:
-
Object
- Object
- MIM::MotionBrowserToolbarDelegate
- Defined in:
- lib/delegates/motion_browser_toolbar_delegate.rb
Instance Method Summary collapse
- #backButtonPressed(back_button) ⇒ Object
- #forwardButtonPressed(forward_button) ⇒ Object
-
#initialize(webview) ⇒ MotionBrowserToolbarDelegate
constructor
A new instance of MotionBrowserToolbarDelegate.
- #shareButtonPressed(shared_button) ⇒ Object
Constructor Details
#initialize(webview) ⇒ MotionBrowserToolbarDelegate
Returns a new instance of MotionBrowserToolbarDelegate.
3 4 5 |
# File 'lib/delegates/motion_browser_toolbar_delegate.rb', line 3 def initialize(webview) @webview = webview end |
Instance Method Details
#backButtonPressed(back_button) ⇒ Object
12 13 14 15 16 |
# File 'lib/delegates/motion_browser_toolbar_delegate.rb', line 12 def backButtonPressed() if @webview.canGoBack @webview.goBack end end |
#forwardButtonPressed(forward_button) ⇒ Object
18 19 20 21 22 |
# File 'lib/delegates/motion_browser_toolbar_delegate.rb', line 18 def forwardButtonPressed() if @webview.canGoForward @webview.goForward end end |
#shareButtonPressed(shared_button) ⇒ Object
7 8 9 10 |
# File 'lib/delegates/motion_browser_toolbar_delegate.rb', line 7 def shareButtonPressed() vc = UIActivityViewController.alloc.initWithActivityItems([{'url' => @webview.request.URL.absoluteString}], applicationActivities: nil) UIWindow.keyWindow.rootViewController.presentViewController(vc, animated: true, completion: nil) end |