iOS Developer Library

Developer

SpriteKit Framework Reference SpriteKit Function Reference

Options
Deployment Target:

On This Page

SpriteKit Function Reference

The SpriteKit Framework defines one macro to simplify cross-platform development.

Functions

  • A macro that expands to a platform-specific color class.

    Declaration

    Objective-C

    #if TARGET_OS_IPHONE #define SKColor UIColor #else #define SKColor NSColor #endif

    Discussion

    All SpriteKit methods that work with colors accept SKColor objects as parameters. On iOS, this resolves to the UIColor class. On OS X, this resolves to the NSColor class.

    Sprite Kit works only with solid colors. For best results, use the preset colors provided by the platform class or a custom color defined in the RGBA device color space.

    Import Statement

    Availability

    Available in iOS 7.0 and later.