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
import SwiftUI | |
@main | |
struct BrushedMetalDemoApp: App { | |
var body: some Scene { | |
WindowGroup { | |
BrushedMetalView { | |
ContentView() | |
} | |
} |
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
import SwiftUI | |
public struct AnimatedImage: NSUIViewRepresentable { | |
public let animationImage: NSUIImage | |
public let isAnimating: Bool | |
#if os(iOS) || os(watchOS) || os(tvOS) | |
public func makeUIView(context: Context) -> UIImageView { | |
let imageView = UIImageView() | |
imageView.image = animationImage |
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
import SwiftUI | |
import simd | |
struct Tick { | |
var position: CGPoint | |
var angle: Angle | |
} | |
func roundedRectTickCoordinates(count n:Int, in rect:CGRect, cornerRadius: CGFloat) -> [Tick] { | |
let width = rect.size.width |