class MIM::MotionBrowserToolbarDelegate

Public Class Methods

new(webview) click to toggle source
# File lib/delegates/motion_browser_toolbar_delegate.rb, line 3
def initialize(webview)
  @webview = webview
end

Public Instance Methods

backButtonPressed(back_button) click to toggle source
# File lib/delegates/motion_browser_toolbar_delegate.rb, line 12
def backButtonPressed(back_button)
  if @webview.canGoBack
    @webview.goBack
  end
end
forwardButtonPressed(forward_button) click to toggle source
# File lib/delegates/motion_browser_toolbar_delegate.rb, line 18
def forwardButtonPressed(forward_button)
  if @webview.canGoForward
    @webview.goForward
  end
end
shareButtonPressed(shared_button) click to toggle source
# File lib/delegates/motion_browser_toolbar_delegate.rb, line 7
def shareButtonPressed(shared_button)
  vc = UIActivityViewController.alloc.initWithActivityItems([{'url' => @webview.request.URL.absoluteString}], applicationActivities: nil)
  UIWindow.keyWindow.rootViewController.presentViewController(vc, animated: true, completion: nil)
end