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 UIKit | |
| let ones = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] | |
| let teens = ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] | |
| let tens = ["twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"] | |
| let hundred = "hundred" | |
| let thousand = "one" + "thousand" // no spaces |
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
| NSURLConnection.sendAsynchronousRequest(request, | |
| queue: NSOperationQueue.mainQueue(), | |
| completionHandler: { response, data, error in | |
| if data == nil { | |
| println("request data was nil") | |
| } | |
| var json = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions(0), error: nil) as? NSArray | |
| if json == nil { | |
| println("json couldn't be created") |
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 closure: () -> () = { | |
| damageCharacter(targets[0], 30) | |
| if gameController!.die1.toRaw() < 5 { | |
| self.roll("Damage", closure) | |
| } | |
| } |
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 closure: (() -> ())! | |
| closure = { | |
| damageCharacter(targets[0], 30) | |
| if gameController!.die1.toRaw() < 5 { | |
| gameController!.roll("Damage", closure) | |
| } | |
| } |
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
| func postReport() { | |
| var url = NSURL(string: "challenge2.airtime.com:7182/report") | |
| if url == nil { | |
| return | |
| } | |
| var request = NSMutableURLRequest(URL: url!) | |
| request.HTTPMethod = "POST" |
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
| subscript (i: Int) -> Character { | |
| return self[advance(self.startIndex, i)] | |
| } |
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
| diff --git a/magpie/Browse.storyboard b/magpie/Browse.storyboard | |
| index 1cf1342..470ff14 100755 | |
| --- a/magpie/Browse.storyboard | |
| +++ b/magpie/Browse.storyboard | |
| @@ -1,7 +1,7 @@ | |
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
| -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="ptx-WX-Fxm"> | |
| +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="ptx-WX-Fxm"> | |
| <dependencies> | |
| - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/> |
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
| diff --git a/Pods/Instabug/Instabug.bundle/Instabug_dsym_upload.sh b/Pods/Instabug/Instabug.bundle/Instabug_dsym_upload.sh | |
| index 68b69c0..611ad4b 100755 | |
| --- a/Pods/Instabug/Instabug.bundle/Instabug_dsym_upload.sh | |
| +++ b/Pods/Instabug/Instabug.bundle/Instabug_dsym_upload.sh | |
| @@ -17,6 +17,14 @@ | |
| # source "${SCRIPT_SRC}" | |
| # --- INVOCATION SCRIPT END --- | |
| +# Check for simulator builds | |
| +if [ "$EFFECTIVE_PLATFORM_NAME" == "-iphonesimulator" ]; then |
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
| // assuming mutableArray1, mutableArray2, mutableResultArray | |
| while (mutableArray1.count > 0 || mutableArray2.count > 0) { | |
| if mutableArray1.count > 0 && mutableArray2.count > 0 { | |
| let object1 = mutableArray1.removeObjectAtIndex(0) | |
| let object2 = mutableArray2.removeObjectAtIndex(0) | |
| if object1["createdAt"] > object2["createdAt"] { | |
| mutableResultArray.append(object1) | |
| } else { | |
| mutableResultArray.append(object2) | |
| } |
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 objCMutableArray = NSMutableArray(array: ["c", "b", "a"]) | |
| if let swiftArray = objCMutableArray as NSArray as? [String] { | |
| swiftArray.map() { $0.lowercaseString } | |
| swiftArray | |
| if let objCArray = (swiftArray as NSArray?) as! NSMutableArray? { | |
| swiftArray | |
| } | |
| } |
OlderNewer