Skip to content

Instantly share code, notes, and snippets.

@wizard1066
Created April 2, 2020 07:33
Show Gist options
  • Save wizard1066/f65c67b334ccbcfb2afd38fc1ac5c4c5 to your computer and use it in GitHub Desktop.
Save wizard1066/f65c67b334ccbcfb2afd38fc1ac5c4c5 to your computer and use it in GitHub Desktop.
abgwtpC
VStack(alignment: .center, spacing: 5) {
ForEach((0 ..< 4).reversed(), id: \.self) { row in
HStack(alignment: .center, spacing: 5) {
ForEach((0 ..< 4).reversed(), id: \.self) { column in
return VStack {
if self.textColors[fCalc(c: column, r: row)] == Color.clear {
Text(self.textText[fCalc(c: column, r: row)])
.font(Fonts.futuraCondensedMedium(size:48))
.frame(width: 64, height: 64, alignment: .center)
.background(InsideView(rect: self.$rect))
.onDrop(of: ["public.utf8-plain-text"], delegate: dropDelegate)
} else {
Text(self.textText[fCalc(c: column, r: row)])
.onTapGesture {
self.textText[fCalc(c: column, r: row)] = ""
self.textColors[fCalc(c: column, r: row)] = Color.clear
}
.font(Fonts.futuraCondensedMedium(size:48))
.frame(width: 64, height: 64, alignment: .center)
.background(self.textColors[fCalc(c: column, r: row)])
.onDrop(of: ["public.utf8-plain-text"], delegate: dropDelegate)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment