1

using swiftUI i have a lot of Buttons which i need to make only one can be clicked at the same time. By default in swiftUI you have two or more buttons on a view you can click them all at once I tried adding the following:

            UIButton.appearance().isMultipleTouchEnabled = false
            UIButton.appearance().isExclusiveTouch = true

With UIKit we had exclusiveTouch and MultiTouchEnabled but how do we do this with swiftUI? What is the correct way to solve this application wide?

Update: The use case is simple there is a view with a login button and a register button and now the user can tap both at the same time which i don't want

Peter Van de Put
  • 878
  • 10
  • 26
  • May be you could explain what the use case – user1046037 Nov 11 '22 at 14:32
  • There isn't a whole lot of information in this question, but perhaps this will help? [link](https://stackoverflow.com/questions/58825232/how-to-prevent-two-buttons-being-tapped-at-the-same-time-in-swiftui) – Corith Nov 11 '22 at 15:17

0 Answers0