-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added UIKit support to the #Preview macro
- Loading branch information
Showing
11 changed files
with
92 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-2.94 MB
Binaries/PrefireBinary.artifactbundle/prefire-2.8.0-macos/bin/prefire
Binary file not shown.
Binary file added
BIN
+2.98 MB
Binaries/PrefireBinary.artifactbundle/prefire-2.9.0-macos/bin/prefire
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import SwiftUI | ||
import Prefire | ||
|
||
#Preview { | ||
{ | ||
let view = UIView(frame: .init(origin: .zero, size: .init(width: 100, height: 100))) | ||
view.backgroundColor = .red | ||
return view | ||
}() | ||
} | ||
|
||
#Preview { | ||
{ | ||
let viewController = UIViewController() | ||
viewController.view.backgroundColor = .green | ||
return viewController | ||
}() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import SwiftUI | ||
import UIKit | ||
|
||
public struct ViewRepresentable<WrappedView: UIView>: UIViewRepresentable { | ||
let view: WrappedView | ||
|
||
public init(view: WrappedView) { | ||
self.view = view | ||
} | ||
|
||
public func makeUIView(context: Context) -> WrappedView { | ||
view.setContentHuggingPriority(.defaultHigh, for: .vertical) | ||
view.setContentHuggingPriority(.defaultHigh, for: .horizontal) | ||
return view | ||
} | ||
|
||
public func updateUIView(_ uiView: WrappedView, context: Context) { } | ||
} | ||
|
||
public struct ViewControllerRepresentable<WrappedViewController: UIViewController>: UIViewControllerRepresentable { | ||
let viewController: WrappedViewController | ||
|
||
public init(viewController: WrappedViewController) { | ||
self.viewController = viewController | ||
} | ||
|
||
public func makeUIViewController(context: Context) -> WrappedViewController { | ||
return viewController | ||
} | ||
|
||
public func updateUIViewController(_ uiViewController: WrappedViewController, context: Context) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ah this seems to break #38 since it uses
name
rather thantestName