Save 37% off PRO during our Black Friday Sale! »

What's new WebKit.framework

What's new WebKit.framework

07236dd218acc51812c47f92cd6bba19?s=128

yashigani

June 21, 2014
Tweet

Transcript

  1. ϦϑΝϨϯε͔ΒಡΈղ͘ WebKit.framework @yashigani
 Cocoaษڧձؔ੢ #56

  2. @yashigani

  3. None
  4. None
  5. None
  6. –Mattt Thompson “UIWebView is dead. Long live WKWebView.”

  7. WKWebView is Կʁ

  8. WKWebViewͷਖ਼ମ • Safari/Mobile Safariͱಉ͡΋ͷ͕࢖͑Δ • ϞμϯͳΠϯλʔϑΣʔε • WebKit 2 APIϕʔε

    • ࣮͸UIWebView΍WebView͸ҧ͏API
  9. WebKit 2 API • ϚϧνϓϩηεʹରԠͨ͠API • WebKit 1ͱ͸ඇޓ׵ • Safari

    5.1(07/2011)~
  10. ࣮͸͜ͳ͍ͩൃදͨ͠ • @kyoto.ͳΜ͔ • WebKit 2 API͸CϕʔεͰʙͬͯ࿩΋ͨ͠ • ՈؼͬͯϦϙδτϦݟͨΒͦΜͳ͜ͱͳͯ͘ ݁ߏͪΌΜͱͯͨ͠

    • #expectWWDC
  11. ΊͰ͍ͨʂ

  12. WKWebView • iOS/OS XͰڞ௨ • ϞμϯͳΠϯλʔϑΣʔε • property/delegate • Ϛϧνϓϩηε

  13. ߏ੒ • WKWebView • WKUIDelegate • WKNavigationDelegate • WKWebViewConfiguration •

    WKPreferences • WKUserContentController
  14. WKWebView • Built-in Gesture • KVO compliant • title/URL/loading/estimatedProgress… •

    backForwardList • WKUIDelegate/WKNavigationDelegate
  15. WKUIDelegate • alert()ͷॲཧΛࣗલͰ • ࣗ෼Ͱॲཧͯ͠ɼcompletionHandlerΛݺͿ

  16. WKNavigationDelegate • shouldStart…/didFinish… • UIDelegateͱಉ༷ʹdecisionHandlerͰॲཧ • ϩʔυͷਐḿΛࡉ͔͘औಘͰ͖Δ

  17. WKWebViewConfiguration • WKPreferences/WKProcessPool/ WKUserContentController • WKWebViewΛॳظԽ͢Δͱ͖ʹ౉͢ • ෳ਺WKWebViewΛ࡞Δͱ͖ʹڞ༗Ͱ͖Δ

  18. WKPreferences • JavaScriptͷΦϯΦϑ • ϑΥϯταΠζ • ಈը࠶ੜΛΠϯϥΠϯͰ • ઃఆ͸User Defaultsʹอଘ͞ΕΔ

  19. WKUserContentController • ϩʔυ͢ΔUser Scriptͷ௥Ճ/࡟আ • User ScriptͷHandlerΛొ࿥ • User Script͔ΒϝοηʔδΛૹΕΔ

  20. σϝϦοτ

  21. stringByEvaluatingJavaScriptFromString: ͕ແ͍

  22. None
  23. ͡Ό͋Ͳ͏͠Ζͱ • User ScriptͰͳΜͱ͔͠Ζͱ͍͏͜ͱʁ • Easy app-webpage communication • ΋ͪΖΜΦʔϓϯͳ࣮૷ʹ͸͋Δ

    • evaluateJavaSctipt:completionHandler: • ৭ʑࢼ͚ͨ͠Ͳ… #࡯͍ͯͩ͘͠͞
  24. OS X͔Β͢Δͱ… • ΊͬͪΌऑମԽ • WebViewʹ͋Δdelegate͸΋ͬͱ͋Δ • WebFrameʹ΋ΞΫηεͰ͖ͳ͍͠… • ΋ͪΖΜJSContext΋࢖͑ͳ͍

  25. ٙ໰ • લճͷWWDCͰJavaScriptCore.frameworkΛ ։์ͨ͠ҙਤ͕Θ͔Βͳ͍ • ಛʹ࠷ۙ͸WebKitͷJSEngine͸͍͢͝վྑ ͞Ε͍ͯΔ • ϑΟʔυόοΫ࣍ୈͰ͸΋ͬͱ։์͞ΕΔՄ ೳੑ͕ʁ

  26. ·ͱΊ • UIWebView is dead. Long live WKWebView. • Ϛϧνϓϩηε+Ϟμϯ

    API • ࠓͷͱ͜Ζظ଴΄ͲͰ͸ͳ͍(ͱࢥ͏) • ͨͩ͠ྗΛೖΕ͍ͯΔͷ͸͔֬ • ظ଴ͯ͠Δਓ͸Bug Reportʹཁ๬ग़ͦ͏ʂ
  27. ؔ࿈ • http://www.webkit.org • https://github.com/webkit/webkit • Introducing the Modern WebKit

    API • http://nshipster.com/ios8/
  28. Thank you!