enable code coverage
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) ) )
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
CountdownView SwiftUI view
A simple view to display sequence of views before something important starts. Here is a how you can do it:
or with custom background, views and animations: