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
@synthesize firstName = _firstName; | |
@synthesize txtFirstName = _txtFirstName; | |
[RACAbleSelf(self.firstName) subscribeNext:^(id x) { [self firstNameChanged:x]; }]; | |
[self rac_bind:RAC_KEYPATH_SELF(self.firstName) to:self.txtFirstName.rac_textSubscribable]; | |
- (void) firstNameChanged:(id)firstName { | |
NSLog(@"changed: %@", firstName); | |
} |
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
// | |
// BSManagedDocument.h | |
// | |
// Created by Sasmito Adibowo on 29-08-12. | |
// Copyright (c) 2012 Basil Salad Software. All rights reserved. | |
// http://basilsalad.com | |
// | |
// Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license> | |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
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
// Connecting AFIncrementalStore & MagicRecord | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
PDDebugger *debugger = [PDDebugger defaultInstance]; | |
[debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]]; | |
[debugger enableNetworkTrafficDebugging]; | |
[debugger forwardAllNetworkTraffic]; | |
[debugger enableCoreDataDebugging]; | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Information</key> | |
<dict> | |
<key>Description</key> | |
<string>Map Rails ActiveSupport timezones to iOS readable timezone IDs.</string> | |
<key>Version</key> | |
<string>1.0</string> |
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
// Author: [email protected] | |
// License: BSD | |
#import <Foundation/Foundation.h> | |
@interface TJIntegerArray : NSObject <NSFastEnumeration> | |
{ | |
NSInteger* _array; | |
} |
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> | |
@interface MyCalendar : NSObject | |
+ (void)requestAccess:(void (^)(BOOL granted, NSError *error))success; | |
+ (BOOL)addEventAt:(NSDate*)eventDate withTitle:(NSString*)title inLocation:(NSString*)location; | |
@end |
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
NSMutableArray *abEmailAddresses = [NSMutableArray array]; | |
NSMutableArray *abPhoneNumbers = [NSMutableArray array]; | |
ABAddressBookRef addressBook = ABAddressBookCreate(); | |
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); | |
for (CFIndex i = 0; i < CFArrayGetCount(people); ++i) { | |
ABRecordRef aRecord = CFArrayGetValueAtIndex(people, i); | |
// phone numbers | |
ABMutableMultiValueRef phones = ABRecordCopyValue(aRecord, kABPersonPhoneProperty); |
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
@interface NSManagedObject (Serialization) | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; | |
@end |
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
// | |
// CIFaceFeature+UIImageOrientation.h | |
// | |
// | |
// Created by Xiaochao Yang on 6/9/13. | |
// Copyright (c) 2013 Xiaochao Yang. All rights reserved. | |
// | |
#import <CoreImage/CoreImage.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
static __inline__ CGRect CGRectFromCGSize( CGSize size ) { | |
return CGRectMake( 0, 0, size.width, size.height ); | |
}; | |
static __inline__ CGRect CGRectMakeWithCenterAndSize( CGPoint center, CGSize size ) { | |
return CGRectMake( center.x - size.width * 0.5, center.y - size.height * 0.5, size.width, size.height ); | |
}; | |
static __inline__ CGRect CGRectMakeWithOriginAndSize( CGPoint origin, CGSize size ) { | |
return CGRectMake( origin.x, origin.y, size.width, size.height ); |