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.
Fixes #133
This PR is weird in several ways.
First, it appears that
SKIP DECLARE
won't let me disregard the complexwhere
clause of the declaration of this function. If I uncomment theK.Value : Equatable
part, Skip will complain, "Skip does not support the referenced type as a generic constraint." I would have expectedSKIP DECLARE
to tell Skip to disregard that problem, but it doesn't. (Relaxing that constraint should be harmless in practice, because the Xcode build will reject it if someone tries to make a PreferenceKey of a non-Equatable value.) I've filed this as a bug on the transpiler. skiptools/skip#432Second, I'm using
snapshotFlow
; I have no idea how I'd port that to Swift, so I just didn't; I'm heavily usingSKIP INSERT
for this.Third, you can't just build out an ordinary
PreferenceKey
and use it withpreference
. I had to declare my PreferenceKey like this:That is, in SwiftUI, I could just declare a couple of static methods, but in SkipUI, I had to explicitly declare a companion object so I could declare it a
PreferenceKeyCompanion
.This is all quite strange, but it does work. (And isn't that really what Skip is all about? 😉)
Skip Pull Request Checklist:
swift test