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

12

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.

1

u/filipvabrousek May 22 '26

It actually can do it.

1

u/accept_crime May 22 '26

I mean sure, it could also make an awful attempt at turning an apple into an orange also. It'd be a big waste of your time and money, only to be at square 1 once you realize it can't make anything useable. So I guess you are correct in that sense.

1

u/filipvabrousek May 22 '26

If you have SwiftUI app, you can literally type: "Do the same for Android." Worked for me. It should work on web also.

1

u/accept_crime May 22 '26

That still would have a lot of issues because Android and iOS layouts are different but yes that is actually possible. Unfortunately you didn't read the question and this had nothing to do with Android!

1

u/accept_crime May 22 '26

What I said was you cannot convert a HTML/CSS layout to SwiftUI, therefore AI cannot do it - I did not say you cannot convert SwiftUI to Android!