To move a class to a SwiftUI view, you can create a new file with a struct conforming to the View
protocol.
Here's an example:
main.swift333 chars20 lines
Replace MyClass
with the name of your class and add any necessary properties to the MySwiftUIView
struct. In this example, I'm passing an instance of MyClass
as a parameter to the view.
You can then use the MySwiftUIView
in your app like any other SwiftUI view.
main.swift125 chars9 lines
gistlibby LogSnag