TIL about using WebKit views within SwiftUI apps for hybrid mobile/web development. This approach caught my attention as a potential middle ground between native and web apps.

I’ve been thinking about architecture patterns for apps that need to work across platforms. The usual suspects are React Native, Flutter, or going full native everywhere. But WebKit in SwiftUI might be an interesting alternative.

What’s got me curious is how this compares to other hybrid approaches:

  • Hotwire for Rails (server-rendered HTML with minimal JS)
  • React Native (JS bridge to native components)
  • LiveView Native for Elixir (server-driven native UI)

All of these are trying to solve the same problem: how do you build once and deploy everywhere without sacrificing too much performance or user experience?

WebKit in SwiftUI could be compelling if you already have a solid web app and want to add native iOS features around it. You get the web content you’ve already built, plus native navigation, notifications, and device integration.

Need to dig deeper into the performance characteristics and see how smooth the web-to-native transitions feel in practice.

WWDC Session on WebKit in SwiftUI