Skip to content

A customizable SwiftUI flip view with a custom front and back view.

License

Notifications You must be signed in to change notification settings

danielsaidi/FlipKit

Repository files navigation

Project Icon

Version Swift 6.1 Documentation MIT License

FlipKit

FlipKit is a SwiftUI library with a FlipView component that works on all major Apple platforms.

Demo Gif

The FlipView component can be customized with custom content views, flip durations, flip directions, etc.

Installation

FlipKit can be installed with the Swift Package Manager:

https://github.com/danielsaidi/FlipKit.git

Getting Started

The FlipView can flip between a front and back view:

import FlipKit

struct MyView: View {

    @State private var isFlipped = false

    var body: some View {
        FlipView(
            isFlipped: $isFlipped,
            front: { Card(color: .green) },
            back: { Card(color: .red) }
        )
        .flipAnimation(.linear, duration: 1.0)
        .withListRenderingBugFix()  // Use this when in a List 
    }
}

struct Card: View {

    let color: Color

    var body: some View {
        color.cornerRadius(10)
    }
}

You can provide custom tap flip and swipe directions, and can also flip the view by toggling the isFlipped binding. You can also use the .onFlipGesture(up:left:right:down:) view modifier to apply custom flip actions.

Documentation

The online documentation has more information, articles, code examples, etc.

Demo Application

The Demo folder has a demo app that lets you explore the library and integrate with a few APIs.

Support My Work

You can become a sponsor to help me dedicate more time on my various open-source tools. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.

Contact

Feel free to reach out if you have questions, or want to contribute in any way:

License

FlipKit is available under the MIT license. See the LICENSE file for more info.

About

A customizable SwiftUI flip view with a custom front and back view.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project