Swiftpack.co - Package - kukushechkin/CountdownView

CountdownView SwiftUI view

Swift

A simple view to display sequence of views before something important starts. Here is a how you can do it:


@State var start = false

...

.overlay(
    CountdownView(startOn: $start,
                  steps: ["3️⃣", "2️⃣", "1️⃣", "🔥🔥🔥"]) {
        // Let the games begin!
    }
)

or with custom background, views and animations:


@State var start = false

...

.overlay(
    CountdownView(startOn: $start,
                  steps: ["3️⃣", "2️⃣", "1️⃣", "🔥🔥🔥"].map({ label in
                    AnyView(Text("\(label)")
                        .transition(.asymmetric(insertion: .move(edge: .leading),
                                                removal:   .move(edge: .trailing)))
                        .animation(.easeInOut(duration: 0.2)))
                  })) {
        // Let the games begin!
    }
    .background(
        Circle()
            .fill(Color.primary)
            .padding()
            .opacity(0.5)
    )
)

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

Switch to semantic versioning - 2020-03-15 13:04:29

Ah, no, this is the first release - 2020-03-15 12:59:37

First release, now this view can be used - 2020-03-15 12:58:53