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
| let phoneDictionary = ["phoneNumber" : rider.phoneNumber] | |
| PFCloud.callFunctionInBackground("DriverApproaching", withParameters: phoneDictionary) { (result, error) -> Void in | |
| if error != nil | |
| { | |
| println("DriverApproaching succeeded") | |
| } | |
| } |
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
| https://gist.github.com/vikdenic/ad3ec02e41fca673f66e |
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
| let infoDictionary = ["user_id" : profile.objectId] | |
| PFCloud.callFunctionInBackground("CancelRide", withParameters: infoDictionary) { (result, error) -> Void in | |
| if error != nil | |
| { | |
| println("CancelRide succeeded") | |
| } | |
| } |
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 alert : UIAlertController = UIAlertController(title: title, | |
| message: message, preferredStyle: .Alert) | |
| alert.addAction(UIAlertAction(title: "Nevermind", style:.Default, handler: nil)) | |
| let confirmButton = UIAlertAction(title: "Cancel Ride", style: .Default) { (action) -> Void in | |
| self.setViewsOnCanceledRide() | |
| } | |
| alert.addAction(confirmButton) |
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 | |
| class FoodItem { | |
| var labeled : Bool! | |
| var daysOld : Int! | |
| convenience init (labeled isLabeled: Bool!, daysOld age: Int) | |
| { |
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
| class func queryForComments(theStudent: Dossier, completed: (comments: [Comment], error: NSError!) -> Void) | |
| { | |
| let query = Comment.query() | |
| query.includeKey("commenter") | |
| query.whereKey(kStudentKeyString, equalTo: theStudent) | |
| query.orderByAscending("createdAt") | |
| query.findObjectsInBackgroundWithBlock { (objects, error) -> Void in | |
| if error == nil | |
| { |
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
| let url : NSURL = NSBundle.mainBundle().URLForResource("typingLogin", withExtension: "gif")! | |
| self.backgroundImageView.image = UIImage.animatedImageWithAnimatedGIFURL(url) |
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
| UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.customNotQuiteWhite()], forState:.Normal) | |
| UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.customPinkColor()], forState:.Selected) |
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
| NSArray *carsArray = [[NSArray alloc] initWithObjects:@"Tesla", @"BMW", @"Audi", @"VW", nil]; | |
| for (NSString *car in carsArray) | |
| { | |
| NSLog(@"%@", car); | |
| } |
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 testBartenderQueryForGivenEvent() | |
| { | |
| let expectation = self.expectationWithDescription("Wait for the bartender to be retrieved") | |
| Venue.queryForTestVenue { (venue, error) -> Void in | |
| let testVenue = venue as Venue | |
| testVenue.bartenders { (bartenders, error) -> Void in | |
| //NOTE: This casting is a workaround for an issue with Arrays in the Tests target |