Files
swift-mirror/stdlib/public/SDK/SpriteKit/SpriteKit.swift
Dmitri Hrybenko 350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00

33 lines
908 B
Swift

@exported import SpriteKit
// SpriteKit defines SKColor using a macro.
#if os(OSX)
public typealias SKColor = NSColor
#elseif os(iOS)
public typealias SKColor = UIColor
#endif
// this class only exists to allow AnyObject lookup of _copyImageData
// since that method only exists in a private header in SpriteKit, the lookup
// mechanism by default fails to accept it as a valid AnyObject call
@objc class _SpriteKitMethodProvider : NSObject {
override init() { _sanityCheckFailure("don't touch me") }
@objc func _copyImageData() -> NSData! { return nil }
}
extension SKNode {
public subscript (name: String) -> [SKNode] {
// Note: Don't stomp on objectForKeyedSubscript:
@objc(_swiftObjectForKeyedSubscript:) get {
var nodes = [SKNode]()
enumerateChildNodesWithName(name) { node, stop in
if let n = node { nodes.append(n) }
}
return nodes
}
}
}