This commit is contained in:
Trey t
2023-07-07 14:02:50 -05:00
parent 4fc5127011
commit f7ab828b28
9 changed files with 3085 additions and 200 deletions

View File

@@ -7,6 +7,7 @@
import Foundation
import UIKit
import SwiftUI
extension Dictionary {
func percentEncoded() -> Data? {
@@ -121,3 +122,20 @@ extension Double {
return formatter.string(from: self) ?? ""
}
}
extension View {
func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View {
clipShape( RoundedCorner(radius: radius, corners: corners) )
}
}
struct RoundedCorner: Shape {
var radius: CGFloat = .infinity
var corners: UIRectCorner = .allCorners
func path(in rect: CGRect) -> Path {
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
return Path(path.cgPath)
}
}