jamonholmgren / ProMotion

ProMotion is a RubyMotion gem that makes iPhone development less like Objective-C and more like Ruby.
MIT License
1.26k stars 147 forks source link

Support for WKWebView ... FINALLY #819

Closed markrickert closed 4 years ago

markrickert commented 4 years ago

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

OVER 5 years in the making!

πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰

So i ran into a crash when opening a modal screen that loads in a PM::WebScreen. If you close the modal before the content loads, the app would crash. So decided to look into if it was possible to get this old branch up and running and it's working great for simple web page display in a screen.

Once i merged master into the wk_web_view branch, the changes are actually quite simple!

I've tested this on ios 13 and displaying a simple web page works great:

class GoogleWebScreen < PM::WebScreen
  title "Google"

  def on_load
    set_nav_bar_button :left, title: "Close", action: :close
  end

  def content
    NSURL.URLWithString("https://www.google.com")
  end
end

Closes #543

andrewhavens commented 4 years ago

😲 Nice!

markrickert commented 4 years ago

The only things is breaks are the methods go_to_item(item), back_forward_list, and progress because they're not supported in WKWebView but you'll get a warning if you try and use them.

I agree a major version bump is warranted here but not entirely necessary.

ben5516 commented 4 years ago

Is there a target release date for 3.0.0? We're starting to get Deprecation notices from App Store connect regarding UIWebView.

andrewhavens commented 4 years ago

Ah, I forgot we haven’t released this yet. Sorry about that. I’ll work on doing that today.

Sent from my iPhone

On Mar 2, 2020, at 10:36 AM, Ben Govero notifications@github.com wrote:

ο»Ώ Do we have a target release date for 3.0.0? We're starting to get Deprecation notices from App Store connect regarding UIWebView.

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.