This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creature | |
class Creature : Equatable { | |
} | |
func ==(lhs: Creature, rhs: Creature) -> Bool { | |
return lhs === rhs | |
} | |
// Monster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Geometry.swift | |
// ZKit | |
// | |
// Created by Kaz Yoshikawa on 11/6/15. | |
// | |
// | |
import Foundation | |
import CoreGraphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ZGeoUtils.swift | |
// ZKit | |
// | |
// Created by Kaz Yoshikawa on 2015/02/08. | |
// Copyright (c) 2015 Electricwoods LLC. All rights reserved. | |
// | |
import Foundation | |
import CoreGraphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// String+Z.swift | |
// ZKit | |
// | |
// Created by Kaz Yoshikawa on 11/10/15. | |
// | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension NSScanner { | |
func scanStringFromSet(strings: Set<String>) -> String? { | |
for string in strings { | |
if self.scanString(string, intoString: nil) { | |
return string | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for thing in things { | |
switch thing { | |
case 0 as Int: | |
print("zero as an Int") | |
case 0 as Double: | |
print("zero as a Double") | |
case let someInt as Int: | |
print("an integer value of \(someInt)") | |
case let someDouble as Double where someDouble > 0: | |
print("a positive double value of \(someDouble)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ZSearchFieldDelegate: NSTextFieldDelegate { | |
func searchFieldDidBecomeFirstResponder(textField: ZSearchField) | |
func searchFieldDidResignFirstResponder(textField: ZSearchField) | |
} | |
class ZSearchField: NSSearchField, NSTextDelegate { | |
var expectingCurrentEditor: Bool = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// String+Color.swift | |
// ZKit | |
// | |
// Created by Kaz Yoshikawa on 3/24/16. | |
// Copyright © 2016 Electricwoods LLC Inc. The MIT License. | |
// | |
import Foundation | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array where Element: Equatable { | |
mutating func remove<Element: Equatable>(object: Element) -> Array { | |
self = self.filter { $0 as? Element != object } | |
return self | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ZMapTable.swift | |
// ZKit | |
// | |
// Created by Kaz Yoshikawa on 3/26/16. | |
// Copyright © 2016 Electricwoods LLC. All rights reserved. | |
// | |
import Foundation |
OlderNewer