Skip to content

Instantly share code, notes, and snippets.

@smrfeld
Last active April 12, 2022 21:17
Show Gist options
  • Select an option

  • Save smrfeld/d607d68f653140625efa783860beac28 to your computer and use it in GitHub Desktop.

Select an option

Save smrfeld/d607d68f653140625efa783860beac28 to your computer and use it in GitHub Desktop.
Simple circle content view
import SwiftUI
struct ContentView: View {
@State var xpos: CGFloat = 400
@State var ypos: CGFloat = 200
var body: some View {
ZStack {
Circle()
.frame(width: 50, height: 50)
.foregroundColor(.blue)
.position(x: xpos, y: ypos)
}
.frame(width: 800, height: 800)
.background(.white)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment