Create SwiftUI View programmatically at runtim

Hi everyone

I'd like to know if is it possible with swiftui to create a new view at runtime, defining it's controls and buttons and graphic at runtime, no with a dedicated swift file.

Any suggestion?

Post not yet marked as solved Up vote post of TheFinal Down vote post of TheFinal
1.2k views

Replies

What does it mean that this question isn't answered? It seems like sort of a basic "meta" question. Wouldn't a lot of developers want to be able to dynamically create a View from components? It seems like it should be possible. An example would be most welcome. I feel like there is some fundamental concept or issue that I am not seeing. Help, please.

Is the problem here is that what we think of as the structure of the view is actually a program, contained in { }, and that is what we can't create programatically? (Unless we were in something like Lisp.)