Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 534 Bytes

add-uikit-preview-swiftui.md

File metadata and controls

24 lines (18 loc) · 534 Bytes

How to add UIKit preview to Swift UI

#if canImport(SwiftUI) && DEBUG
import SwiftUI

@available(iOS 13, *)
struct ActivationFooterViewPreview: PreviewProvider {

    static var previews: some View {
        UIViewPreview {
            let view = ActivationFooterView(activationResourcePackage: HitronActivationData().activationPackage)

            return view
        }
        .previewLayout(.fixed(width: 320.0, height: 100.0))
        .padding(10)
    }
}
#endif