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
// A compile-time check is what you need in the case of Xcode 5 | |
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 | |
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) { | |
// use registerUserNotificationSettings | |
// Register for Push Notitications - iOS 8 Notifications | |
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | | |
UIUserNotificationTypeBadge | | |
UIUserNotificationTypeSound); | |
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes |
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
#pragma mark - Managing Keyboard | |
- (void)registerForKeyboardNotifications | |
{ | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillShowNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillBeHidden:) |
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
// | |
// UIColor+AppName.h | |
// AppName | |
// | |
// Created by Thinh Phan on 4/10/15. | |
// Copyright (c) 2015 Gennova. All rights reserved. | |
// | |
// See http://blog.alexedge.co.uk/speeding-up-uicolor-categories/ | |
#define AGEColorDefine(COLOR_NAME) \ |
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
1. Set navigation bar style to black | |
[self.navigationController.navigationBar setBarStyle:UIBarStyleDefault]; | |
2. Set directly | |
- Set the UIViewControllerBasedStatusBarAppearance to YES in the .plist file. | |
- In the viewDidLoad do a | |
[self setNeedsStatusBarAppearanceUpdate]; | |
- Add the following method: |
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
- (NSString *)md5:(NSString *)string { | |
// Create pointer to the string as UTF8 | |
const char *ptr = [string UTF8String]; | |
// Create byte array of unsigned chars | |
unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; | |
// Create 16 byte MD5 hash value, store in buffer | |
CC_MD5(ptr, strlen(ptr), md5Buffer ); // This is the md5 call |
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
Objective-C | |
- (void)getListAvailableFontNames { | |
for (NSString *familyName in [UIFont familyNames]){ | |
NSLog(@"Family name: %@", familyName); | |
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) { | |
NSLog(@"--Font name: %@", fontName); | |
} | |
} | |
} |
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)isNumeric:(NSString *)string | |
{ | |
NSScanner *scanner = [NSScanner scannerWithString:string]; | |
return [scanner scanInteger:NULL] && [scanner isAtEnd]; | |
} |
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
// | |
// NSArray+JSONString.h | |
// | |
// | |
// Created by Thinh Phan on 4/26/15. | |
// Copyright (c) 2015 Gennova. All rights reserved. | |
// | |
@interface NSArray (JSONString) | |
- (NSString *) jsonStringWithPrettyPrint:(BOOL)prettyPrint; |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
Locale Country | |
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) |
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
// | |
// Prefix header | |
// | |
// The contents of this file are implicitly included at the beginning of every source file. | |
// | |
#import <Availability.h> | |
#ifndef __IPHONE_5_0 | |
#warning "This project uses features only available in iOS SDK 5.0 and later." |