This file contains 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 MyStringProxy : NSProxy | |
@property (nonatomic) NSString *target; | |
@end | |
@implementation MyStringProxy | |
- (BOOL)respondsToSelector:(SEL)aSelector { |
This file contains 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
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" |
This file contains 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 MyObject : NSObject | |
@end | |
@implementation MyObject | |
- (void)doSomething { | |
for (int i = 0; i < 1000; i++) { | |
[self print:i]; | |
usleep(100); | |
} |
This file contains 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
// | |
// ItemCollectionViewController.m | |
// ViewDeckExample | |
// | |
// Created by Michael Ochs on 9/17/16. | |
// Copyright © 2016 ViewDeck. All rights reserved. | |
// | |
#import "ItemCollectionViewController.h" |
This file contains 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
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' |
This file contains 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
#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 |
This file contains 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
@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) { |
This file contains 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
- (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! | |
} | |
} |
This file contains 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
#!/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 |
This file contains 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
http://gsp1.apple.com/pep/gcc - Returns the current country code - Probably based on the IP address? |
NewerOlder