About GestureState<ManipulationState>

The source code for visionOS's WWDC23 session, Take SwiftUI to the next dimension, suddenly makes extensive use of GestureState<ManipulationState>. However, there is no sample code that shows the full extent of GestureState<ManipulationState>, nor is there any explanation of its use in the video. I cannot proceed with understanding unless you share information about this.

https://developer.apple.com/videos/play/wwdc2023/10113/?time=969

URL of the capture of the part of the video where GestureState<ManipulationState> is used. (An error occurred when uploading the image.) https://imgur.com/a/ZAeWk2k

Sincerely,

Sadao Tokuyama

https://twitter.com/tokufxug

https://www.linkedin.com/in/sadao-tokuyama/

Replies

The VisionOS sample code projects are not linked at the bottom of relevant WWDC videos.

I think this is the one that involves interacting with a satellite?

https://developer.apple.com/documentation/visionos/world/

  • @J0hn As far as I could tell, the satellite sample did not contain this code.

Add a Comment

pls search info about @GestureState you can learn from normal SwiftUI.

This worked for me:

struct ManipulationState {
  var transform: AffineTransform3D = .identity
  var active: Bool = false
}

@GestureState var manipulationState = ManipulationState()