| 123456789101112131415161718192021222324252627 |
- //
- // PreviewShims.swift
- // ark_ui_basic
- //
- // Bridging helpers for Xcode Preview support.
- // Wraps ark_ui_basic views in hosting controllers
- // so they can be used with SwiftUI's #Preview macro.
- import ark_ui_basic_core
- // Helper method before we add fully preview thunk and preview macro support for ark_ui_basic
- #if canImport(AppKit) && !targetEnvironment(macCatalyst)
- public import AppKit
- extension ark_ui_basic.View {
- public func _previewVC() -> NSViewController {
- ark_ui_basic.NSHostingController(rootView: self)
- }
- }
- #elseif canImport(UIKit)
- public import UIKit
- extension ark_ui_basic.View {
- public func _previewVC() -> UIViewController {
- ark_ui_basic.UIHostingController(rootView: self)
- }
- }
- #endif
|