문제

I would like to use KVO to observe changes to the SKSpriteNode position property, but it doesn't seem to work. Is SKNode's position property observable?

도움이 되었습니까?

해결책

Nope, it is not. SK behind the scenes is a C++ engine that bypasses most of Objective-C's overhead, like for instance KVO (KVC will still work cause that's entirely on you).

Unlike in UI(Kit) apps, most values of most objects change often anyway, so if you're interested in changes to a property it's faster to simply check it every frame using SKScene's update: or (better) didSimulatePhysics methods.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top