Please help… I am new to SWIFT and I need some help… I have the following code and I need to somehow change it so I can catch a LONG PRESS vs a PRESS. I am very new to this so if you can give me detailed help it would be great.
var body: some View {
ZStack(alignment: .bottom) {
Color.black.ignoresSafeArea()
VStack {
HStack {
Spacer()
Text(currentValue)
.foregroundColor(.white)
.font(.system(size: 72))
}
.padding()
ForEach(buttons, id: \.self) { row in
HStack {
ForEach(row, id: \.self) { button in
Button {
buttonTapped(button: button)
} label: {
HStack {
Text(button.rawValue)
.foregroundColor(button.foregroundColor)
.font(.system(size: 30, weight: .semibold))
.frame(width: button.getButtonWidth(), height: button.getButtonWidth())
if(button.isZeroButton) {
Spacer()
}
}
.frame(width: button.width, height: button.height)
.background(button.backgroundColor)
.cornerRadius(button.height)
}
}
}
}
}
.padding(.bottom)
}
}