Files
swift-mirror/stdlib/objc/SpriteKit/SpriteKit.swift
Dmitri Hrybenko 5746e4e9ca stdlib: rename _fatalError to _sanityCheckFailure. Name similarity between
fatalError and _fatalError has caused some damage already, as some
memory-safety checks in Mirrors are _fatalErrors.


Swift SVN r20969
2014-08-03 15:20:37 +00:00

29 lines
790 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] {
var nodes = [SKNode]()
enumerateChildNodesWithName(name) { node, stop in
if let n = node { nodes.append(n) }
}
return nodes
}
}