Skip to content

Instantly share code, notes, and snippets.

@wizard1066
Created April 12, 2020 06:53
Show Gist options
  • Save wizard1066/64be606366651988986c7c2beaa68135 to your computer and use it in GitHub Desktop.
Save wizard1066/64be606366651988986c7c2beaa68135 to your computer and use it in GitHub Desktop.
ddwtp1
struct dominoView: View {
@State var topNo:Int!
@State var lowNo:Int!
var body: some View {
return ZStack {
RoundedRectangle(cornerRadius: 5)
.stroke(Color.black, lineWidth: 2)
.frame(width: 48, height: 80, alignment: .top)
.background(Color.clear)
VStack {
HStack {
ForEach((0 ..< topNo), id: \.self) { column in
Circle()
.fill(Color.black)
.frame(width: 12, height: 12, alignment: .center)
.overlay(
RoundedRectangle(cornerRadius: 20)
.stroke(Color.clear, lineWidth: 2)
.frame(width: 32, height: 32, alignment: .center)
.background(Color.clear)
)
}
}
Divider()
.frame(width: 32, height: 2, alignment: .center)
HStack {
ForEach((0 ..< lowNo), id: \.self) { column in
Circle()
.fill(Color.black)
.frame(width: 12, height: 12, alignment: .center)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.clear, lineWidth: 2)
.frame(width: 32, height: 32, alignment: .center)
.background(Color.clear)
)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment