This commit is contained in:
2024-01-24 18:02:39 +08:00
parent e681d68c65
commit 2d7d3dc836
7 changed files with 161 additions and 50 deletions

View File

@@ -0,0 +1,38 @@
//
// KillCountDown.swift
// demo
//
// Created by Jason on 2024/1/24.
//
import SwiftUI
struct KillCountDown: View {
var body: some View {
HStack(spacing: 6) {
number(num: 23)
spector
number(num: 19)
spector
number(num: 9)
}
}
func number(num: Int) -> some View {
var s = String(num)
if num < 10 {
s = "0".appending(s)
}
return Text(s)
.padding(4)
.foregroundColor(Color.red)
.background(Color.white)
.font(.system(size: 14))
.cornerRadius(4)
}
var spector: some View {
Text(":")
.foregroundColor(Color.white)
}
}