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
#pragma mark - Keyboard Management | |
- (void)registerForKeyboardNotifications { | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; | |
} | |
- (void)keyboardWillShow: (NSNotification*) aNotification { | |
NSDictionary* info = [aNotification userInfo]; |
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
if (![[array1 valueForKey:@"uniqueId"] isEqualToArray:[array2 valueForKey:@"uniqueId"]]) { | |
// The arrays contain the same objects that each have an attribute of "uniqueId" | |
} |
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
if ([[equation substringToIndex:1] isEqualToString:@"+"]) { | |
equation = [equation substringFromIndex:1]; | |
} | |
NSExpression *equationExpression = [NSExpression expressionWithFormat:equation]; | |
NSNumber *equationNumber = [equationExpression expressionValueWithObject:nil context: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
self.tableView.rowHeight = UITableViewAutomaticDimension; | |
self.tableView.estimatedRowHeight = 60.0; |
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
// | |
// ViewController.m | |
// test | |
// | |
// Created by Joshua Howland on 11/21/14. | |
// Copyright (c) 2014 Wired In LLC. All rights reserved. | |
// | |
#import “ViewController.h” |
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/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface GradientView : UIView | |
@property (nonatomic, strong) UIColor *startColor; | |
@property (nonatomic, strong) UIColor *midpointColor; | |
@property (nonatomic, strong) UIColor *finishColor; | |
@property (nonatomic, readwrite) float progress; |
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
- (void)updateUserWithContactInfo { | |
PFUser *currentUser = [PFUser currentUser]; | |
NSString *name = currentUser[nameKey]; | |
NSArray *people = (NSArray *)CFBridgingRelease(ABAddressBookCopyPeopleWithName(ABAddressBookCreateWithOptions(NULL, NULL), (__bridge CFStringRef)(name))); | |
if (people != nil && people.count > 0) { | |
ABRecordRef person = (__bridge ABRecordRef)[people objectAtIndex:0]; | |
NSData *photoData = CFBridgingRelease(ABPersonCopyImageDataWithFormat(person, kABPersonImageFormatThumbnail)); | |
NSString *firstName = CFBridgingRelease(ABRecordCopyValue(person, kABPersonFirstNameProperty)); | |
NSString *lastName = CFBridgingRelease(ABRecordCopyValue(person, kABPersonLastNameProperty)); |
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
Parse.Cloud.define("inviteRecipientLogic", function(request, response) { | |
Parse.Cloud.useMasterKey(); | |
var InviteRecipient = Parse.Object.extend("InviteRecipient"); | |
var Invite = Parse.Object.extend("Invite"); | |
var inviteRecipientQuery = new Parse.Query(InviteRecipient); | |
var userId = request.params.id; | |
var user = new Parse.User(); | |
user.id = userId; |
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 *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
UITableViewRowAction *removeButton = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Remove" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { | |
[self deletePlayerAtIndexPath:indexPath]; | |
self.game.startingNumberOfPlayers = @(self.game.startingNumberOfPlayers.integerValue - 1); | |
}]; | |
UITableViewRowAction *resetScoreButton = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Reset Score" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { | |
[self.game resetScoresForPlayer:[self.fetchedResultsControllerDataSource.fetchedResultsController objectAtIndexPath:indexPath]]; | |
}]; | |
resetScoreButton.backgroundColor = [UIColor primaryColorLight]; | |
return @[removeButton,resetScoreButton]; |