Skip to content

2.0.0 - Production Supporting Integration

Latest
Compare
Choose a tag to compare
@AvdLee AvdLee released this 23 Jul 19:11
· 1 commit to main since this release
56f2a1f

I initially built SwiftUIKitView to create previews for UIKit views quickly. Though, many started using this framework in production code, for which it was not optimized.

I'm happy to announce that this major update adds support to the use of the framework in production apps.

Using a UIKit view directly in SwiftUI for production code requires you to use:

UIViewContainer(<YOUR UIKit View>, layout: <YOUR LAYOUT PREFERENCE>)

Performance in Previews is less important, it's being redrawn either way.
Therefore, you can use the more convenient swiftUIView() modifier:

UILabel() // <- This is a `UIKit` view.
    .swiftUIView(layout: .intrinsic) // <- This is returning a SwiftUI `View`.