Skip to content

Instantly share code, notes, and snippets.

View karthironald's full-sized avatar
👨‍💻
Learning.

Karthick Selvaraj karthironald

👨‍💻
Learning.
  • @mallow technologies private limited
  • Karur
View GitHub Profile
import SwiftUI
struct ContentView: View {
let timer = Timer.publish(every: 0.25, on: .main, in: .default).autoconnect()
@State private var progress: CGFloat = 0.0
var total: CGFloat = 1.0
var body: some View {
ProgressView(value: progress, total: total, label: {
import SwiftUI
struct ContentView: View {
let timer = Timer.publish(every: 0.25, on: .main, in: .default).autoconnect()
@State private var progress: CGFloat = 0.0
var total: CGFloat = 1.0
var body: some View {
ProgressView(progress >= total ? "Downloaded" : "Downloading...", value: progress, total: total)
import SwiftUI
struct ContentView: View {
let timer = Timer.publish(every: 0.25, on: .main, in: .default).autoconnect()
@State private var progress: CGFloat = 0.0
var total: CGFloat = 1.0
var body: some View {
ProgressView(value: progress, total: total)
import SwiftUI
struct ContentView: View {
var body: some View {
ProgressView(label: {
Button(action: {}, label: {
Text("Cancel")
.font(.subheadline)
.bold()
import SwiftUI
struct ContentView: View {
var body: some View {
ProgressView("Loading...")
.scaleEffect(1.5, anchor: .center)
.progressViewStyle(CircularProgressViewStyle(tint: .blue))
.foregroundColor(.blue)
}
import SwiftUI
struct ContentView: View {
var body: some View {
ProgressView()
.scaleEffect(1.5, anchor: .center)
.progressViewStyle(CircularProgressViewStyle(tint: .blue))
}
import SwiftUI
struct ContentView: View {
var cornerRadius: CGFloat = 20
var body: some View {
VStack {
ZStack {
Circle()
import SwiftUI
struct ContentView: View {
var cornerRadius: CGFloat = 20
var body: some View {
VStack {
ZStack {
RoundedRectangle(cornerRadius: cornerRadius)
import SwiftUI
struct ContentView: View {
var cornerRadius: CGFloat = 20
var body: some View {
VStack {
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color("kMainBg"))
import SwiftUI
struct ContentView: View {
var cornerRadius: CGFloat = 20
var body: some View {
VStack {
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color("kMainBg"))