This file contains hidden or 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 Double : ForwardIndexType { | |
| public func successor() -> Double { | |
| return self + 1.0 | |
| } | |
| } | |
| infix operator ∫ { associativity left precedence 120 } | |
| func ∫ (left: Range<Double>, right: (Double -> Double)) -> Double { | |
| let dx = (left.endIndex - left.startIndex) / 1000 | |
| let r = left.startIndex.stride(to: left.endIndex, by: dx) |
This file contains hidden or 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
| // | |
| // RootViewController.swift | |
| // iOS9Sampler | |
| // | |
| // Created by Shuichi Tsutsumi on 2015/06/10. | |
| // Copyright © 2015 Shuichi Tsutsumi. All rights reserved. | |
| // | |
| import UIKit |
This file contains hidden or 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
| var result: [(hasSmile: Bool, leftEyeClosed: Bool, rightEyeClosed: Bool)] = [] | |
| for feature in features as! [CIFaceFeature] { | |
| result.append((feature.hasSmile, feature.leftEyeClosed, feature.rightEyeClosed)) | |
| } | |
| if result.count >= 1 { | |
| if result[0].hasSmile { | |
| self.playerAttack() |
This file contains hidden or 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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| struct URLCodableTest: Codable { | |
| let ou: URL? | |
| let u: URL | |
| enum CodingKeys: String, CodingKey { | |
| case ou |
This file contains hidden or 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 | |
| /* | |
| https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/AppStoreTerritories.html | |
| */ | |
| public enum Country: String { | |
| case unitedArabEmirates = "ae" | |
| case antiguaAndBarbuda = "ag" | |
| case anguilla = "ai" | |
| case albania = "al" |
OlderNewer