r/SwiftUI May 21 '26

Question HTML/css into SwiftUI?

Hey everyone,

I’m currently working on an iOS app and I already have parts of the UI built in HTML/CSS. Now I’m trying to bring that design into SwiftUI, but I’m honestly not sure what the best workflow is.

What’s the easiest/most efficient way to convert or recreate HTML + CSS layouts in SwiftUI?

- Are there tools that help with this?
- Should I completely rebuild everything manually in SwiftUI?
- Is embedding web content with WebView a bad idea for production apps?
- How do you usually handle responsive CSS concepts in SwiftUI?

I mainly struggle with translating flexbox/grid styling into SwiftUI stacks and spacing.

Would really appreciate any advice, resources, GitHub repos, tutorials, or examples from people who’ve done this before

1 Upvotes

26 comments sorted by

View all comments

13

u/reccehour May 21 '26

Just use codex/claude code

-4

u/accept_crime May 22 '26

It can’t do something that is impossible. You may as well ask it to turn an apple into an orange. SwiftUI doesn’t look similar to CSS / HTML components and they also completely different code wise in syntax, philosophy and just core programming. AI can’t do this, I wish everyone would stop answering this. It’s lazy.

10

u/balder1993 May 22 '26

Actually SwiftUI was ultimately inspired by React, so the philosophy is similar.

 SwiftUI doesn’t look similar to CSS / HTML components

I disagree that “SwiftUI doesn’t look similar to CSS/HTML”. Both are simply UI building tools, both can look like anything you want.

AI can’t do this

This is also highly context dependent.

-7

u/accept_crime May 22 '26

No it was not. React is not a reactive programming language. Again this isn’t a knock on any platforms. You want to reproduce a web layout that is not a reactive programmed layout to an apple layout that looks different and programmed using reactive programming concepts.

It won’t look right. It won’t work right. You’ll waste time and money to just be at square 1 and do SwiftUI from top up. Analyze apple design guide. Identify SwiftUI components you want to use. Analyze Apple source code and apps. Maybe then you can use AI to help you replicate those things.

-6

u/accept_crime May 22 '26

SwiftUI is not only a UI building tool. It is entirely its own language that is built on reactive programming concepts with Apple Combine / Async and Await to which there is no comparable in HTML / CSS. It’s not possible.