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
// Copyright 2014 bitecode, Michael Ochs | |
// | |
// See http://www.ios-coding.com/blog/2014/06/22/model-handling-in-uiviewcontroller/ | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// |
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? |
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
- (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
+ (instancetype)uiDateFormatter | |
{ | |
static NSDateFormatter* uiDateFormatter = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
uiDateFormatter = [[NSDateFormatter alloc] init]; | |
uiDateFormatter.dateStyle = NSDateFormatterFullStyle; | |
uiDateFormatter.timeStyle = NSDateFormatterNoStyle; | |
}); | |
return uiDateFormatter; |
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
@implementation NSNumber (Subscripting) | |
// call it like this: [@0:1]; | |
- (NSIndexSet*):(NSUInteger)length | |
{ | |
return [NSIndexSet indexSetWithIndexesInRange:NSMakeRange([self unsignedIntegerValue], length)]; | |
} | |
@end |
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
command alias reveal_load expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2); | |
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil]; | |
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil]; |
OlderNewer