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
// Registering Cell eg: -viewDidLoad | |
[self.tableView registerNib:[UINib nibWithNibName:MY_CELL_IDENTIFIER bundle:[NSBundle mainBundle]] | |
forCellReuseIdentifier:MY_CELL_IDENTIFIER]; | |
// -tableView: cellForRowAtIndexPath; | |
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:MY_CELL_IDENTIFIER]; | |
// Creating a var with cell tag | |
UIImageView *imageView = (UIImageView *)[cell viewWithTag:IMAGEVIEW_TAG]; |
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
[self.view.window endEditing:YES]; |
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 *phoneNumber = [NSString stringWithFormat:@"tel:%@",phoneNumber]; | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; |
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 *mapsURL = @"http://maps.google.com/maps?q="; | |
if ([[[[UIDevice currentDevice] systemVersion] substringToIndex:1] intValue] >= 6) // if iOS 6 or greater use apple maps | |
{ | |
mapsURL = @"http://maps.apple.com/maps?q="; | |
} | |
NSString *mapaddress = [mapsURL stringByAppendingString:address]; | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[mapaddress stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]]; |
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
//Adds a shadow to sampleView | |
CALayer *layer = self.sampleView.layer; | |
layer.shadowOffset = CGSizeMake(1, 1); | |
layer.shadowColor = [[UIColor blackColor] CGColor]; | |
layer.shadowRadius = 4.0f; | |
layer.shadowOpacity = 0.80f; | |
layer.shadowPath = [[UIBezierPath bezierPathWithRect:layer.bounds] CGPath]; |
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
+ (AppDelegate *)instance | |
{ | |
return (AppDelegate *)[UIApplication sharedApplication].delegate; | |
} |
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 *numberWithCommas = [NSNumberFormatter localizedStringFromNumber:@(intNumber) | |
numberStyle:NSNumberFormatterDecimalStyle]; |
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 WINDOW_WIDTH [[UIScreen mainScreen] bounds].size.width | |
#define WINDOW_HEIGHT [[UIScreen mainScreen] bounds].size.height |
OlderNewer