Created
March 13, 2025 05:36
-
-
Save nbhasin2/2604e7c8bc37203bf586fad98217a30a to your computer and use it in GitHub Desktop.
metal10.swift
This file contains hidden or 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
| struct AnimatedCircleMetalView: UIViewRepresentable { | |
| func makeUIView(context: Context) -> MTKView { | |
| let metalView = MTKView() | |
| metalView.device = MTLCreateSystemDefaultDevice() | |
| metalView.framebufferOnly = false | |
| metalView.colorPixelFormat = .bgra8Unorm | |
| metalView.delegate = context.coordinator | |
| return metalView | |
| } | |
| func updateUIView(_ uiView: MTKView, context: Context) {} | |
| func makeCoordinator() -> AnimatedCircleRenderer { | |
| return AnimatedCircleRenderer() | |
| } | |
| } | |
| struct Step4View: View { | |
| var body: some View { | |
| AnimatedCircleMetalView() | |
| .edgesIgnoringSafeArea(.all) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment