3

I have controls inside both SwiftUI views as well as UIKit VCs and views that are embedded inside UIView(Controller)Representable. In my (music) app it's common for the user to interact with multiple controls at the same time, e.g. tweaking knobs or moving sliders.

I've noticed that controls that are inside UIKit recognise touches/gestures at the same time no problem. Same for controls inside SwiftUI. But if one control is inside SwiftUI view and the other is inside a UIKit view then only the one that's touched first registers touches.

Is this a known issue/limitation of mixing UIKit and SwiftUI views? I can't find a mechanism/API which would let me specify not to prevent simultaneous touches/gestures being detected.

Nikolozi
  • 2,212
  • 2
  • 19
  • 29
  • Did you ever find a solution to this problem? – Luke Van In Jul 04 '22 at 19:42
  • @LukeVanIn I never did. In the end I had most UI components in SwiftUI views and very small number of them inside a UIKit VC. And likelihood of users using controls from both types of views at the same time was small, so I stopped worrying. Now I have almost everything in SwiftUI. I did notice however that controls inside SwiftUI.List and outside of it can't be controlled at the same time. This issues could be related as the List component is backed by UITableView. Again I consider this a small bug for my app, so haven't been trying to find a solution. – Nikolozi Jul 06 '22 at 08:00
  • This is still an issue in the latest SDK (iOS 16.x, XCode 14.x). Did anyone else find a solution or a workaround for this ? – Hariprasad Feb 02 '23 at 13:25

0 Answers0