Documentation Archive Developer
Search

SpriteKit Changes for Objective-C

SpriteKit

SK3DNode.h

Declaration
From
- (NSArray *)hitTest:(CGPoint)thePoint options:(NSDictionary *)options
To
- (NSArray<SCNHitTestResult *> * _Nonnull)hitTest:(CGPoint)point options:(NSDictionary<NSString *,id> * _Nullable)options

SKAction.h

Declaration
From
+ (SKAction *)animateWithTextures:(NSArray *)textures timePerFrame:(NSTimeInterval)sec
To
+ (SKAction * _Nonnull)animateWithTextures:(NSArray<SKTexture *> * _Nonnull)textures timePerFrame:(NSTimeInterval)sec

Declaration
From
+ (SKAction *)animateWithTextures:(NSArray *)textures timePerFrame:(NSTimeInterval)sec resize:(BOOL)resize restore:(BOOL)restore
To
+ (SKAction * _Nonnull)animateWithTextures:(NSArray<SKTexture *> * _Nonnull)textures timePerFrame:(NSTimeInterval)sec resize:(BOOL)resize restore:(BOOL)restore

Declaration
From
+ (SKAction *)group:(NSArray *)actions
To
+ (SKAction * _Nonnull)group:(NSArray<SKAction *> * _Nonnull)actions

Declaration
From
+ (SKAction *)sequence:(NSArray *)actions
To
+ (SKAction * _Nonnull)sequence:(NSArray<SKAction *> * _Nonnull)actions

Introduction
FromiOS 7.0
ToiOS 7.1

SKAudioNode.h (Added)

SKCameraNode.h (Added)

SKConstraint.h

Declaration
From
@property(retain) SKNode *referenceNode
To
@property(retain, nonatomic, nullable) SKNode *referenceNode

SKEmitterNode.h

SKKeyframeSequence.h

Declaration
From
- (instancetype)initWithKeyframeValues:(NSArray *)values times:(NSArray *)times
To
- (instancetype _Nonnull)initWithKeyframeValues:(NSArray * _Nonnull)values times:(NSArray<NSNumber *> * _Nonnull)times

SKNode.h

Declaration
From
@property(nonatomic, readonly) NSArray *children
To
@property(nonatomic, readonly, nonnull) NSArray<SKNode *> *children

Declaration
From
@property(nonatomic, copy) NSArray *constraints
To
@property(nonatomic, copy, nullable) NSArray<SKConstraint *> *constraints

Declaration
From
- (NSArray *)nodesAtPoint:(CGPoint)p
To
- (NSArray<SKNode *> * _Nonnull)nodesAtPoint:(CGPoint)p

Declaration
From
- (NSArray *)objectForKeyedSubscript:(NSString *)name
To
- (NSArray<SKNode *> * _Nonnull)objectForKeyedSubscript:(NSString * _Nonnull)name

Declaration
From
- (void)removeChildrenInArray:(NSArray *)nodes
To
- (void)removeChildrenInArray:(NSArray<SKNode *> * _Nonnull)nodes

SKPhysicsBody.h

Declaration
From
- (NSArray *)allContactedBodies
To
- (NSArray<SKPhysicsBody *> * _Nonnull)allContactedBodies

Declaration
From
+ (SKPhysicsBody *)bodyWithBodies:(NSArray *)bodies
To
+ (SKPhysicsBody * _Nonnull)bodyWithBodies:(NSArray<SKPhysicsBody *> * _Nonnull)bodies

Declaration
From
@property(nonatomic, readonly) NSArray *joints
To
@property(nonatomic, readonly, nonnull) NSArray<SKPhysicsJoint *> *joints

SKReferenceNode.h (Added)

SKScene.h

SKShader.h

Declaration
From
- (instancetype)initWithSource:(NSString *)source uniforms:(NSArray *)uniforms
To
- (instancetype _Nonnull)initWithSource:(NSString * _Nonnull)source uniforms:(NSArray<SKUniform *> * _Nonnull)uniforms

Declaration
From
+ (instancetype)shaderWithSource:(NSString *)source uniforms:(NSArray *)uniforms
To
+ (instancetype _Nonnull)shaderWithSource:(NSString * _Nonnull)source uniforms:(NSArray<SKUniform *> * _Nonnull)uniforms

Declaration
From
@property(copy) NSArray *uniforms
To
@property(copy, nonnull) NSArray<SKUniform *> *uniforms

SKTexture.h

Declaration
From
+ (void)preloadTextures:(NSArray *)textures withCompletionHandler:(void (^)(void))completionHandler
To
+ (void)preloadTextures:(NSArray<SKTexture *> * _Nonnull)textures withCompletionHandler:(void (^ _Nonnull)(void))completionHandler

SKTextureAtlas.h

Declaration
From
+ (instancetype)atlasWithDictionary:(NSDictionary *)properties
To
+ (instancetype _Nonnull)atlasWithDictionary:(NSDictionary<NSString *,id> * _Nonnull)properties

Declaration
From
+ (void)preloadTextureAtlases:(NSArray *)textureAtlases withCompletionHandler:(void (^)(void))completionHandler
To
+ (void)preloadTextureAtlases:(NSArray<SKTextureAtlas *> * _Nonnull)textureAtlases withCompletionHandler:(void (^ _Nonnull)(void))completionHandler

Declaration
From
@property(nonatomic, readonly) NSArray *textureNames
To
@property(nonatomic, readonly, nonnull) NSArray<NSString *> *textureNames

SKTransition.h

Modified SKTransition
Protocols
From--
ToNSCopying

SKUniform.h

Declaration
From
@property(readonly) NSString *name
To
@property(nonatomic, readonly, nonnull) NSString *name

Declaration
From
@property SKTexture *textureValue
To
@property(nonatomic, retain, nullable) SKTexture *textureValue

Declaration
From
@property(readonly) SKUniformType uniformType
To
@property(nonatomic, readonly) SKUniformType uniformType

SKVersion.h (Added)

Added #def SK_VERSION

SKVideoNode.h