SwiftUI WebView Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

ความคิดเห็น • 22

  • @CodeWithChris
    @CodeWithChris  8 หลายเดือนก่อน

    👋 Our "Launch Your First App" program will help you build up your iOS skills to publish your very own feature rich app even if you’re a beginner starting from scratch. cwc.to/youtubeoffer

  • @pasta0328
    @pasta0328 8 หลายเดือนก่อน +3

    Got excited for a moment there

    • @CodeWithChris
      @CodeWithChris  8 หลายเดือนก่อน +1

      Ah, sorry i know what you mean but everyone searches for "SwiftUI WebView" and so that's what I have to optimize the title for. I hope they make it easier for us in the future!

    • @pasta0328
      @pasta0328 8 หลายเดือนก่อน +1

      Oh totally all good on the title! I hope so, too!

  • @nekbeth
    @nekbeth 6 หลายเดือนก่อน +1

    App crashes, asks for entitlements. Any clue? thanks

  • @zbighugh9193
    @zbighugh9193 26 วันที่ผ่านมา

    Using your example, I'm getting a "Failed to resolve host network app id" error.

    • @zbighugh9193
      @zbighugh9193 25 วันที่ผ่านมา

      It turns out it's because I placed the WebView() inside a ScrollView. Once I took it out, it ran. But I'm getting a warning that I didn't set parameter permission in WebPrivacy. But this just might be a bug of Apple's.

  • @immanuelkolwin
    @immanuelkolwin 8 หลายเดือนก่อน +1

    Can I upload webview app in app store?

    • @CodeWithChris
      @CodeWithChris  8 หลายเดือนก่อน

      Maybe someone else with that experience can comment but my feeling is if the webview is a significant part of the app, then it won't pass.

    • @immanuelkolwin
      @immanuelkolwin 8 หลายเดือนก่อน

      @@CodeWithChris okay

    • @CodeWithChris
      @CodeWithChris  8 หลายเดือนก่อน

      I use the platform called Plutio to run my photography business. It handles my invoices, etc. The macOS and iOS app is just the web app inside some sort of WebView window... so I wouldn't be surprised this is what they did.
      @AdrienVillez

    • @immanuelkolwin
      @immanuelkolwin 8 หลายเดือนก่อน

      @@CodeWithChris thank you for give me a clarification brother

  • @pmanolak
    @pmanolak 7 หลายเดือนก่อน

    Can this also used to get data from API which returns a json?

    • @CodeWithChris
      @CodeWithChris  7 หลายเดือนก่อน +1

      No, this only shows how to add a webview to a SwiftUI view and load a web page. You’ll need to use `URLSession` instead. - Iñaki

    • @pmanolak
      @pmanolak 7 หลายเดือนก่อน

      @@CodeWithChris Thanks Chris! I am trying to find an easy way to use some existed APIs built in PHP (to get data from mysql DBs), but as I beginner in swift, I am still learning the basics! :-)

  • @Rishi-sv5ns
    @Rishi-sv5ns 8 หลายเดือนก่อน

    How to use WKWebView Delegate methods?

    • @CodeWithChris
      @CodeWithChris  8 หลายเดือนก่อน +1

      Hi there, we've got a community of learners over at cwc.to/codecrew. I highly recommend joining and reaching out for assistance, especially for any concepts you're finding challenging to grasp. - Iñaki

  • @jyunderwood
    @jyunderwood 8 หลายเดือนก่อน +3

    This is a good start, but none of the JavaScript UI will work like alerts and confirmations. If you need support for these, the WKUIDelegate protocol will need to be implemented.

    • @CodeWithChris
      @CodeWithChris  8 หลายเดือนก่อน

      Ah! Thank you for that reminder. I didn't know that!

  • @IvanWeber-x5z
    @IvanWeber-x5z 2 หลายเดือนก่อน

    I Have an error on "WebView(url: URL.....)). can someone help me?

  • @ericdraven7857
    @ericdraven7857 8 หลายเดือนก่อน +1

    Hopefully we get some new SwiftUI features come WWDC.

    • @CodeWithChris
      @CodeWithChris  8 หลายเดือนก่อน

      I'm hoping too.. it's soon!