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 "NSObject+Log.h" | |
#import <objc/runtime.h> | |
@implementation NSObject (Log) | |
- (void)log:(id)logObject | |
{ | |
unsigned int numberOfProperties = 0; | |
objc_property_t *propertyArray = class_copyPropertyList([logObject class], &numberOfProperties); | |
NSLog(@"Property List for: %@", NSStringFromClass([self class])); |
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)createWallOfFame:(NSArray *)newWallOfFameMembers | |
{ | |
NSLog(@"add %i new member(s) into wall of fame", (int)newWallOfFameMembers.count); | |
NSMutableArray *currentMembers = [NSMutableArray arrayWithArray:self.members]; | |
if (currentMembers.count > 0) { // only if members are available there is a reason to delete them an the end | |
NSRange rangeForMembersToDelete = NSMakeRange(currentMembers.count-newWallOfFameMembers.count, newWallOfFameMembers.count); | |
NSLog(@"delete members from position: %d with length: %d", (int)rangeForMembersToDelete.location, (int)rangeForMembersToDelete.length); | |
[currentMembers removeObjectsInRange:rangeForMembersToDelete]; | |
} |
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)uploadImageToServer | |
{ | |
[SVProgressHUD showWithStatus:@"Hochladen" maskType:SVProgressHUDMaskTypeBlack]; | |
NSData *imageToUpload = UIImageJPEGRepresentation(self.croppedImage, 90); | |
if (!imageToUpload) { | |
NSLog(@"no data available"); | |
return; | |
} else { |
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
"CATEGORY_MEAL_CUISINE" = "Cuisine"; | |
"CATEGORY_MEAL_CUISINE_CHINESE" = "Chinese"; | |
"CATEGORY_MEAL_CUISINE_ITALIAN" = "Italian"; | |
"CATEGORY_MEAL_CUISINE_INDIAN" = "Indian"; | |
"CATEGORY_MEAL_CUISINE_SPANISH_PORTUGUESE" = "Spanish and Portuguese"; | |
"CATEGORY_MEAL_CUISINE_AMERICAN" = "American"; | |
"CATEGORY_MEAL_CUISINE_MIDDLE_EASTERN" = "Middle Eastern"; | |
"CATEGORY_MEAL_CUISINE_ASIAN" = "Asian"; | |
"CATEGORY_MEAL_CUISINE_EUROPEAN" = "European"; |
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
MyViewController: UIViewController { | |
let refreshControl: UIRefreshControl = { | |
$0.tintColor = Theme.currentTheme().textColor | |
$0.addTarget(self, action: #selector(refresh(_:)), forControlEvents: .ValueChanged) | |
return $0 | |
}(UIRefreshControl()) | |
override func viewDidLoad() { |
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
class DebugUserDefaultsViewController: UITableViewController { | |
var userDefaults = NSUserDefaults.standardUserDefaults().dictionaryRepresentation() as NSDictionary | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
title = "NSUserDefaults" | |
} | |
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
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
server.get('/bla', function(req, res) { | |
// instead of adding the implementation here | |
}); | |
// create a new function here | |
function doBla(req, res) { | |
// implementation here | |
}); | |
// now add it to exports |
OlderNewer