This question is somewhat related to : https://developer.apple.com/forums/thread/652404
There seems no way to observe for incoming invitations in Game Kit, so I am looking for alternatives. Perhaps one alternative is adding an observer to GKInvite? Is this at all possible, and if so how do I create one?
I am trying :
and
The last one gives me a warning : Result of call to 'observe(_:options:changeHandler:)' is unused
But perhaps someone here knows if it is at all possible and if so, how?
GKInvite is an NSObject, and from what I have learned so far, its possible to observer for changes in an NSObject.
Thanks in advance
There seems no way to observe for incoming invitations in Game Kit, so I am looking for alternatives. Perhaps one alternative is adding an observer to GKInvite? Is this at all possible, and if so how do I create one?
I am trying :
Code Block GKInvite().addObserver(GKInvite(), forKeyPath: GKInvite().sender , options: .initial, context: GKPlayer)
and
Code Block GKInvite().observe( \GKInvite.sender , options: .initial){ person, change in print ( "SMTH CHANGED", person, change ) }
The last one gives me a warning : Result of call to 'observe(_:options:changeHandler:)' is unused
But perhaps someone here knows if it is at all possible and if so, how?
GKInvite is an NSObject, and from what I have learned so far, its possible to observer for changes in an NSObject.
Thanks in advance