Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for WKWebView ... FINALLY #819

Merged
merged 3 commits into from
Mar 3, 2020
Merged

Support for WKWebView ... FINALLY #819

merged 3 commits into from
Mar 3, 2020

Conversation

markrickert
Copy link
Contributor

@markrickert markrickert commented Oct 10, 2019

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

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
Copy link
Collaborator

😲 Nice!

Copy link
Collaborator

@andrewhavens andrewhavens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Do you think this warrants a major version bump?

Copy link
Owner

@jamonholmgren jamonholmgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree about a major version bump, since someone may be using other UIWebView features that we don't document.

If someone wants to use UIWebScreen instead, they can just include UIWebScreenModule in their screen instead of using WebScreenModule.

@markrickert
Copy link
Contributor Author

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.

@andrewhavens andrewhavens added this to the 3.0.0 milestone Oct 10, 2019
@ben5516
Copy link

ben5516 commented Mar 2, 2020

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

@andrewhavens
Copy link
Collaborator

andrewhavens commented Mar 2, 2020 via email

@andrewhavens andrewhavens merged commit dab5c25 into master Mar 3, 2020
@andrewhavens andrewhavens deleted the wk_web_view branch March 3, 2020 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WKWebView Support
5 participants