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
NSTimeInterval timeZoneOffset = [[NSTimeZone defaultTimeZone] secondsFromGMT]; | |
NSDate* today = [[NSDate date] dateByAddingTimeInterval:timeZoneOffset]; |
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
a ver el timestamp... |
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
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
{ | |
// Return the number of sections. | |
return 1; | |
} | |
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { | |
//This is just for avoiding separation lines in empty rows (needs "numberOfSectionsInTableView") | |
if ([self numberOfSectionsInTableView:tableView] == (section+1)){ | |
return [UIView new]; |
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
+ (UIImage *)scaleImage:(UIImage *)image ToSize:(CGSize)newSize { | |
//UIGraphicsBeginImageContext(newSize); | |
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0); | |
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; | |
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return newImage; | |
} |
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
CGSize s = originalImage.size; | |
CGSize s2 = [UIScreen mainScreen].bounds.size; | |
CGSize s3 = CGSizeMake(roundf(s.width / s2.width), roundf(s.height/s2.height)); | |
CGFloat factor = fmax(s3.width, s3.height); | |
// Divide the size by the greater of the vertical or horizontal shrinkage factor | |
s.width = roundf(s.width /factor); | |
s.height = roundf (s.height / factor); | |
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
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | |
{ | |
NSString *newSearch = [textField.text stringByReplacingCharactersInRange:range withString:string]; | |
NSLog(@"%@",newSearch); | |
if ([newSearch length] >= MIN_NUMBER_OF_CHARACTERS_TO_LAUCH_SEARCH) | |
{ | |
//Hacer búsqueda con newSearch | |
} | |
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
+ (UIImage *)convertImageToGrayScale:(UIImage *)img | |
{ | |
// Create image rectangle with current image width/height | |
CGRect imageRect = CGRectMake(0, 0, img.size.width, img.size.height); | |
// Grayscale color space | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); | |
// Create bitmap content with current image size and grayscale colorspace | |
CGContextRef context = CGBitmapContextCreate(nil, img.size.width, img.size.height, 8, 0, colorSpace, kCGImageAlphaNone); |
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 "NSMutableArray+Stack.h" | |
#define SHOW_ANIMATION_DURATON 0.5f | |
@property (nonatomic, strong) NSMutableArray *viewStack; | |
-(void)pushView:(UIView *)view | |
{ | |
UIView *anterior = [self.viewStack peek]; | |
[self.viewStack push:view]; | |
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
@property (strong, nonatomic) IBOutlet UITextField *pin1_1; | |
@property (strong, nonatomic) IBOutlet UITextField *pin1_2; | |
@property (strong, nonatomic) IBOutlet UITextField *pin1_3; | |
@property (strong, nonatomic) IBOutlet UITextField *pin1_4; | |
@property (nonatomic, strong) NSString *pinText; | |
- (void)viewDidLoad | |
{ | |
(...) |