Skip to content

added merge paths, oncomplete callback, specific frame setting#12

Merged
marcprux merged 10 commits intoskiptools:mainfrom
vincentborko:main
Jan 12, 2026
Merged

added merge paths, oncomplete callback, specific frame setting#12
marcprux merged 10 commits intoskiptools:mainfrom
vincentborko:main

Conversation

@vincentborko
Copy link
Contributor

Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

vincentborko and others added 7 commits December 9, 2025 16:51
Added MotionLoopMode enum:
playOnce - play once and stop
loop - loop forever (default)
autoReverse - back-forth loop forever
repeat(Int) - loop N times
repeatBackwards(Int) - back-forth N times

Added isPlaying parameter to MotionView (default: true)
@cla-bot cla-bot bot added the cla-signed label Jan 11, 2026
@@ -99,33 +111,45 @@ public struct MotionView : View {
if isPlaying {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of branching here. Could we simplify this with some private extensions on LottieView that handle these optional values? E.g., something like:

#if !SKIP
private extension LottieView {
    @ViewBuilder func currentFrameOptional(_ currentFrameOptional: Double?) -> some View {
        if let currentFrameOptional {
            return self.currentFrame(currentFrameOptional)
        } else {
            return self
        }
    }
}
#endif

And then the body could be kept simple by just passing the optional values along like:

LottieView(animation: lottieContainer.lottieAnimation)
                        .currentProgressOptional(progressOptional)
                        .animationSpeedOptional(animationSpeedOptional)
                        .currentFrameOptional(currentFrameOptional)
                        .resizable()
                        .scaledToFillOptional(when: contentMode == .fit)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea. had some problems with my initial viewbuilder attempt but I'm all for shorter more readable code. just tried to get it working first ;) do you want me to try updating it with that approach or are you already doing it? I'll gladly do it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please give it a shot and if you run into issues, I'll be happy to help out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need SKIP @nobridge for private vars. They won't be bridged by default.

@vincentborko
Copy link
Contributor Author

vincentborko commented Jan 11, 2026

oh no, again these merge conflicts... still dont get why. however this should be much less code, let me know if theres anything else.

@marcprux
Copy link
Member

Great, thanks for the contribution and for the fixes!

@marcprux marcprux merged commit 4905403 into skiptools:main Jan 12, 2026
2 checks passed
@vincentborko
Copy link
Contributor Author

no problem, its fun :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants