Skip to content

Instantly share code, notes, and snippets.

View Prarik's full-sized avatar

Pratik Prarik

  • Home
  • Ahmedabad, India
View GitHub Profile
// App Information
#define AppName [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]
#define AppVersion [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]
#define AppDelegate(type) ((type *)[[UIApplication sharedApplication] delegate])
#define NSAppDelegate(type) ((type *)[[NSApplication sharedApplication] delegate])
#define SharedApp [UIApplication sharedApplication]
#define NSSharedApp [NSApplication sharedApplication]
#define Bundle [NSBundle mainBundle]
#define MainScreen [UIScreen mainScreen]
//
// NSString+UsefulStuff.h
//
// Duane Sibilly <duane@sibilly.com>
// 6/21/11
// Copyright (c) 2011-2012 Duane Sibilly. All rights reserved.
#import <Foundation/Foundation.h>
// The use of the parenthesis in the interface declaration is what tells the
#import <Foundation/Foundation.h>
@interface NSString (Extensions)
+ (NSString *)stringToSha1:(NSString *)str;
- (NSNumber*)stringToNSNumber;
- (BOOL)isEmpty;
- (BOOL)stringContainsSubString:(NSString *)subString;
- (NSString *)stringByReplacingStringsFromDictionary:(NSDictionary *)dict;
@interface UILabel (dynamicSizeMe)
-(float)resizeToFit;
-(float)expectedHeight;
@end