Files
swift-mirror/test/1_stdlib/SpriteKit.swift
Arnold Schwaighofer 859fbc0162 More executable_test for the test directory
Swift SVN r29280
2015-06-03 23:28:51 +00:00

35 lines
650 B
Swift

// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: executable_test
// REQUIRES: objc_interop
// watchOS does not have SpriteKit.
// UNSUPPORTED: OS=watchos
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)
print("color \(r) \(g) \(b) \(a)")
// CHECK: color 1.0 0.0 0.0 1.0
#if os(OSX)
func f(c: NSColor) {
print("colortastic")
}
#endif
#if os(iOS) || os(tvOS)
func f(c: UIColor) {
print("colortastic")
}
#endif
f(color)
// CHECK: colortastic