Files
swift-mirror/test/1_stdlib/SpriteKit.swift
Chris Willmore 98d17e318d Add support for AppleTV simulator tests.
You can run tests with e.g. 'ninja check-swift-appletvsimulator-x86_64'.

Swift SVN r27297
2015-04-14 23:53:03 +00:00

31 lines
563 B
Swift

// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: objc_interop
import Foundation
import SpriteKit
// SKColor is NSColor on OS X and UIColor on iOS.
var r = CGFloat(0)
var g = CGFloat(0)
var b = CGFloat(0)
var a = CGFloat(0)
var color = SKColor.redColor()
color.getRed(&r, green:&g, blue:&b, alpha:&a)
println("color \(r) \(g) \(b) \(a)")
// CHECK: color 1.0 0.0 0.0 1.0
#if os(OSX)
func f(c: NSColor) {
println("colortastic")
}
#endif
#if os(iOS) || os(tvOS)
func f(c: UIColor) {
println("colortastic")
}
#endif
f(color)
// CHECK: colortastic