View DynamicNSStringEvaluation.m
@interface MyStringProxy : NSProxy | |
@property (nonatomic) NSString *target; | |
@end | |
@implementation MyStringProxy | |
- (BOOL)respondsToSelector:(SEL)aSelector { |
View NSFormattingContextDynamic.m
NSDate *date = [NSDate new]; | |
NSDateFormatter *dateFormatter = [NSDateFormatter new]; | |
dateFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"nl_NL"]; | |
dateFormatter.dateStyle = NSDateFormatterFullStyle; | |
dateFormatter.formattingContext = NSFormattingContextDynamic; // this is the important setting | |
NSString *dateString = [dateFormatter stringFromDate:date]; | |
NSString *s1 = [NSString stringWithFormat:@"Foo %@", dateString]; // "Foo dinsdag 13 december 2016" |
View ViewController.m
@interface MyObject : NSObject | |
@end | |
@implementation MyObject | |
- (void)doSomething { | |
for (int i = 0; i < 1000; i++) { | |
[self print:i]; | |
usleep(100); | |
} |
View ItemCollectionViewController.m
// | |
// ItemCollectionViewController.m | |
// ViewDeckExample | |
// | |
// Created by Michael Ochs on 9/17/16. | |
// Copyright © 2016 ViewDeck. All rights reserved. | |
// | |
#import "ItemCollectionViewController.h" |
View Podfile
use_frameworks! | |
pod 'CocoaLumberjack', '~> 2.0' | |
pod 'HRSCustomErrorHandling', :git => 'https://github.com/Hotel-Reservation-Service/HRSCustomErrorHandling.git', :commit => 'c4aa9fa7f670bb9b6e737893d94031bbbf335d29' #'~> 0.2' | |
pod 'Aspects', '~> 1.4' | |
pod 'BCFoundation', :path => '../../BCComponents' | |
pod 'BCInterface', :path => '../../BCComponents' | |
pod 'TFFoundation', :path => '../TFFoundation' |
View NSCharacterSet+Logographic.m
#define CharacterRange(__from__, __to__) NSMakeRange(__from__, __to__ - __from__ + 1) | |
@implementation NSCharacterSet (HRSCharacterSet) | |
+ (instancetype)logographicCharacterSet | |
{ | |
NSRange ranges[] = { | |
CharacterRange(0x2E80, 0x2EFF), // CJK Radicals Supplement | |
CharacterRange(0x2F00, 0x2FDF), // Kangxi Radicals | |
CharacterRange(0x3300, 0x33FF), // CJK Compatibility |
View ExtendUITableViewDelegate.m
@protocol HRSStepperTableViewCellDelegate<UITableViewDelegate> | |
- (void)tableView:(UITableView *)tableView didChangeStepperValue:(UIStepper *)stepper forRowWithIndexPath:(NSIndexPath *)indexPath; | |
@end | |
@implementation HRSStepperTableViewCell | |
- (UITableView *)tableView { | |
UIView *superview = self.superview; | |
while (superview != nil && [superview isKindOfClass:[UITableView class]] == NO) { |
View LocalNotifications.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
UILocalNotification *localNotification = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]; | |
if (localNotification) { | |
// the user opened your app by tapping either the notification banner, the notification | |
// center entry or the open action in the alert view of the notification while your app | |
// was not running / suspended. | |
// This is where you want to react to the user's action! | |
} | |
} |
View post-checkout
#!/bin/sh | |
diff "Podfile.lock" "Pods/Manifest.lock" > /dev/null | |
if [[ $? != 0 ]] ; then | |
echo 'CocoaPods needs some more clean up...' | |
echo 'Quit iOS simulator...' | |
osascript -e 'tell app "iPhone Simulator" to quit' | |
echo 'Quit Xcode...' | |
osascript -e 'tell app "Xcode" to quit' | |
pod install |
View gist:47735d1873d0f598c5ba
http://gsp1.apple.com/pep/gcc - Returns the current country code - Probably based on the IP address? |
NewerOlder