csabau / BTracking

Other
0 stars 0 forks source link

Device Setup - Gyro functionality integration #10

Open csabau opened 2 years ago

csabau commented 2 years ago

So I've got this code for the gyroscope functionality here BubbleLevel: UIViewController

I've got this sheet called DeviceSetupView activated from the ControlView by the Setup button

How do I make my bubble levels show on the sheet? I've tried wrapping it inside UIViewRepresentable but the bubbles won't move. The Gyro data is being printed so the connection is working.

(I know I'd have to modify the sizes of the bubbles etc...as the view is different now...although I'm not sure how to get the Sheet view bounds to determine the sizes )

Am I missing something?

csabau commented 2 years ago

The new wrapper seems to have done the trick.

https://github.com/csabau/BTracking/blob/53debc1e37179fba56235aae4128fd6b19ce3ab4/BodyTracking-Example/BodyTracking-Example/DeviceSetupView.swift#L52-L69

This works ok now, the bubbles display in the sheet when the Record UI is being displayed and the right button is tapped. However, they seem to update very delayed which makes for a pretty bad user experience. Before I make it look tidy in terms of colours, layouts etc, any ideas of how I could make this run smoother?

Would I have to do anything with the func updateUIViewController perhaps?