In GameplayKit, I want to conform the protocol GKAgentDelegate, hence use the delegate method func agentDidUpdate(agent: GKAgent)
.
The problem is, in this method, the parameter agent is declared as GKAgent, not GKAgent2D, so that I cannot access agent.position
, because the position property is in GKAgent2D, not GKAgent...
However in Objective-C API, agent is declared as GKAgent2D.
Please help.