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
A Call for Tinder | |
We at Tinder are looking to hire | |
Some fresh cool coals to fuel our fire. | |
That lump given proper compression, | |
a clear diamond revealed might make an impression. | |
A bit about us | |
As evidenced thus | |
The way that we roll |
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)managedObjectContextDidChange:(NSNotification *)note | |
{ | |
NSArray *updatedObjects = [note userInfo][NSUpdatedObjectsKey]; | |
if ([updatedObjects containsObject:self.user]) { | |
[self updateView:YES]; | |
} | |
} |
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
[MagicalRecord saveWithBlock:^(NSManagedObjectContext *localContext) { | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"match == nil && failedChoice == NO"]; | |
NSArray *users = [TNDRUser MR_findAllWithPredicate:predicate inContext:localContext]; | |
for (TNDRUser *user in users) { | |
[user MR_deleteEntity]; | |
} | |
} completion: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
"match.matchID == $FETCH_SOURCE.matchID && viewed == NO". | |
-------------------MODEL DETAILS --------------------- | |
Match (entity) | |
messages (to-many relationship with Message entity) | |
viewed (boolean attribute) | |
matchID (string attribute) | |
unviewedMessages (fetched property with - see above) | |
PREDICATE = "match.matchID == $FETCH_SOURCE.matchID && viewed == NO" |
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
[[FBSession activeSession] closeAndClearTokenInformation]; | |
if (NSClassFromString(@"ACAccountStore")) { | |
ACAccountStore *accountStore = [[ACAccountStore alloc] init]; | |
if ([accountStore respondsToSelector:NSSelectorFromString(@"ACAccountStoreRemoveCompletionHandler")]) { | |
ACAccountType *fbType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; | |
NSArray *accounts = [accountStore accountsWithAccountType:fbType]; | |
ACAccount *account = [accounts lastObject]; | |
if (account) { | |
[accountStore renewCredentialsForAccount:account completion:^(ACAccountCredentialRenewResult renewResult, NSError *error) { |
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)drawLinesInRect:(CGRect)rect forFont:(UIFont *)font | |
{ | |
CGFloat maxLineHeight = 30.0f; | |
CGFloat fontLineHeight = roundf(font.lineHeight); | |
CGFloat fontBaselineAdjustment = roundf(-font.descender); | |
CGFloat startY = fmodf(yOffset, fontLineHeight); | |
CGFloat totalDrawnLines = (int)(floorf(CGRectGetHeight(rect) / fontLineHeight)); | |
for (NSUInteger drawnLine = 0; drawnLine < totalDrawnLines; drawnLine++) { |
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
Suppose I make an app like Instagram. As soon as a photo is taken I upload the original to the server. What's good about this is that it gets it that much closer to being ready to be viewed by others. You can simultaneously allow the user to do other stuff while that's being done. The user now applies and modifies the photo using Core Image filters. When the user finishes instead of uploading a new copy of the modified photo you simply send the information necessary to recreate the effect on the server. Almost instantly that image will be available on the server for others to see. The user won't have to wait for something to upload. You also now have the benefit of having the original photo which maybe you show side by side or allow the user to modify at a later point. | |
This is just one instance off the top of my head. I'm sure there are many more useful things that could be done when interfacing with iOS apps specifically. |
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
- (NSInteger)numberOfSectionsInCollectionView:(PSTCollectionView *)collectionView | |
{ | |
return 1; | |
} | |
- (NSInteger)collectionView:(PSTCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section | |
{ | |
return [_photos count]; | |
} |
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
- (IBAction)open:(id)sender | |
{ | |
CATransform3D perspectiveTransform = CATransform3DIdentity; | |
perspectiveTransform.m34 = 1.0f / -2000.0f; | |
CATransform3D endScaleTransform = CATransform3DMakeScale(0.8f, 0.8f, 1.0f); | |
CATransform3D startTransform = perspectiveTransform; | |
CATransform3D endTransform = CATransform3DConcat(endScaleTransform, perspectiveTransform); | |
CATransform3D middleTransform = CATransform3DConcat(CATransform3DMakeRotation(M_PI_4 / 2.0f, 1, 0, 0), endTransform); |
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
Actual API Problems | |
- It raises an exception when you pass in an empty string for sharedInstanceWithToken. This is just a horrible practice. I had previously been using an empty string so that I wouldn't track data from our test server/app. NEVER EVER RAISE AN EXCEPTION. Just NSLog it and return nil if you must. | |
- It raises an exception when calling sharedInstance before sharedInstanceWithToken. NEVER EVER RAISE AN EXCEPTION. Just NSLog it and return nil if you must. | |
- I see no good reason to have a separate object and methods for MixpanelPeople. This seems like some sort of weird name spacing attempt or something like that. This is not done in Objective-C. It is wrong. | |
- set:to: and set: are horrible, horrible method names. Just read the Objective-C coding guidelines by Apple. This is just plain wrong. | |
- The defines like DebugLog need to use an #ifndef. DebugLog is a commonly used thing by developers and you are attempting to redefine it. Be a good citizen and don't do that. | |
Doc Problems |
NewerOlder