Post

Replies

Boosts

Views

Activity

Static property 'shared' is not concurrency-safe because it is non-isolated global shared mutable state
Hi all, I am fairly new to Swift development so go easy on me! I am working through a few examples of using Reality Kit content within my projects and whilst trying to work on adding gestures to RealityKit entities, I have come across a weird issue. Downloading and running the example here This works fine for me. When adding the same things to my own code - in this case a class called EntityGestureState to my GestureComponent file (within the reality kit project) I constantly get this error: "Static property 'shared' is not concurrency-safe because it is non-isolated global shared mutable state" Even just troubleshooting with something as simple as: public class EntityGestureState { // The entity currently being dragged if a gesture is in progress. // Singleton shared instance static let shared: EntityGestureState = EntityGestureState() } I immediately get the error and from a bunch of trial and error and reading different sources I can't seem to get around this. Could anyone help here? I am running on Xcode 16 beta 3 so am wondering if it's a bug but also more than likely user-error.
2
1
1.2k
Aug ’24