-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8950500
commit bb6dd38
Showing
8 changed files
with
98 additions
and
43 deletions.
There are no files selected for viewing
Binary file modified
BIN
+6.55 KB
(110%)
...proj/project.xcworkspace/xcuserdata/tahatesser.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,5 @@ struct UploadProgressView: View { | |
.frame(width: 100) | ||
Text("\(uploadProgress.formatted(.percent))") | ||
} | ||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
SwiftUIPlayground/Samples/Shapes/ProgressIndicatorArcSample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// ProgressIndicatorArcSample.swift | ||
// SwiftUIPlayground | ||
// | ||
// Created by Taha Tesser on 11/5/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ProgressIndicatorArcSample: View { | ||
let sunYellow = Color(UIColor(red: 1.0, green: 0.85, blue: 0.2, alpha: 1.0)) // RGB: (255, 217, 51) | ||
let sunOrange = Color(UIColor(red: 1.0, green: 0.64, blue: 0.0, alpha: 1.0)) // RGB: (255, 165, 0) | ||
var body: some View { | ||
ZStack { | ||
_ProgressView( | ||
startAngle: .degrees(-90), | ||
endAngle: .degrees(90), | ||
clockwise: true | ||
) | ||
.fill(sunOrange) | ||
|
||
_ProgressView( | ||
startAngle: .degrees(-90), | ||
endAngle: .degrees(90), | ||
clockwise: false | ||
) | ||
.fill(sunYellow) | ||
} | ||
|
||
.padding() | ||
} | ||
} | ||
|
||
struct _ProgressView: Shape { | ||
var startAngle: Angle | ||
var endAngle: Angle | ||
var clockwise: Bool | ||
|
||
func path(in rect: CGRect) -> Path { | ||
var path = Path() | ||
|
||
path.addArc( | ||
center: CGPoint(x: rect.midX, y: rect.midY), | ||
radius: rect.width / 2, | ||
startAngle: startAngle, | ||
endAngle: endAngle, | ||
clockwise: clockwise | ||
) | ||
|
||
return path | ||
} | ||
} | ||
|
||
#Preview { | ||
ProgressIndicatorArcSample() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters