Introducing FlipKit - a flippin' good library for SwiftUI
Jun 1, 2025 ·
Say hi to FlipKit - a tiny open-source SwiftUI library with a FlipView
that can be used to flip between a front and a back view on all major Apple platforms.
With FlipKit’s FlipView
, you just have to provide a front and back content view, as well as optional configurations, like the flip duration and supported flip directions:
import FlipKit
struct MyView: View {
@State private var isFlipped = false
var body: some View {
FlipView(
isFlipped: $isFlipped,
flipDuration: 1.0,
tapDirection: .right,
flipDirections: [.left, .right, .up, .down],
front: { Card(color: .green) },
back: { Card(color: .red) }
)
.withListRenderingBugFix() // Use this when in a List
}
}
struct Card: View {
let color: Color
var body: some View {
color.cornerRadius(10)
}
}
You can flip the view programatically by just toggling the isFlipped
state with code.
The result is a view that works on all major Apple platforms (iOS, iPadOS, macOS, tvOS, watchOS & visionOS) and that can be flipped by both tapping or by swiping in any direction:
A first 0.1 version is out now, so feel free to give it a try and let me know what you think about it.
Discussions & More
If you found this interesting, please share your thoughts on Bluesky and Mastodon. Make sure to follow to be notified when new content is published.