Support #Preview parsing (iOS 17+ only) #50
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO:
UIView
orUIViewController
in iOS 17#Preview
is currently not supported because the view factory used by SwiftUI is exposed as@MainActor () -> UIView
, but since we now use Swift 6 compiler, it cannot be casted directly to@MainActor @Sendable () -> UIView
(@MainActor
now implies@Sendable
)https://forums.swift.org/t/is-there-any-real-difference-between-mainactor-sendable-and-mainactor/72525/8
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0434-global-actor-isolated-types-usability.md
We still need a way to filter out unwantedSince the list is now grouped by modules, this is not an issue anymore#Preview
s (ex: Previews inside the StoryBookKit are also being extracted). I'm currently looking atPreview.ViewTraits
if this is customizable for our own use