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
// | |
// UIColor+IntegerRGB.h | |
// Shell mPayment | |
// | |
// Created by Jose Luis Campaña on 8/21/12. | |
// | |
// | |
#import <UIKit/UIKit.h> |
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
// | |
// UIColor+IntegerRGB.m | |
// Shell mPayment | |
// | |
// Created by Jose Luis Campaña on 8/21/12. | |
// | |
// | |
#import "UIColor+IntegerRGB.h" |
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
UINavigationBar *navBar = [[self navigationController] navigationBar]; | |
//If we want a custom logo: | |
UIImage *backgroundImage = [UIImage imageNamed:@"background_im"]; | |
[navBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault]; | |
self.navigationItem.titleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_img"]] autorelease]; | |
self.navigationController.navigationBar.barStyle = UIBarStyleBlack; | |
self.navigationController.navigationItem.backBarButtonItem.tintColor = [UIColor redColor]; | |
self.navigationController.navigationBar.tintColor = [UIColor redColor]; |
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)navigationController:(UINavigationController *)navigationController PopNumberOfViews:(NSInteger)numberOfViews | |
{ | |
NSInteger count = [navigationController.viewControllers count]; | |
UIViewController *vc = [navigationController.viewControllers objectAtIndex:(count - (1 + numberOfViews))]; | |
[navigationController popToViewController:vc animated:YES]; | |
} |
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)apiRequestDone:(ASIHTTPRequest *)request | |
{ | |
(...) | |
[NSJSONSerialization JSONObjectWithData:[request responseData] options: NSJSONReadingMutableContainers error:&error] |
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
NSError *error; | |
NSData *body = [NSJSONSerialization dataWithJSONObject:payJSON options:NSJSONWritingPrettyPrinted error:&error]; | |
NSString *jsonString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding]; |
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
// | |
// CWLSynthesizeSingleton.h | |
// CocoaWithLove | |
// | |
// Created by Matt Gallagher on 2011/08/23. | |
// Copyright (c) 2011 Matt Gallagher. All rights reserved. | |
// | |
// Permission is given to use this source code file, free of charge, in any | |
// project, commercial or otherwise, entirely at your risk, with the condition | |
// that any redistribution (in part or whole) of source code must retain |
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
NSArray* reversedArray = [[startArray reverseObjectEnumerator] allObjects]; |
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
//.h | |
@protocol XXXXXXDelegate <NSObject> | |
@optional | |
@end | |
@property (nonatomic, weak) id <XXXXXXDelegate> delegate; | |
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
CALayer *capa = [self.navigationController navigationBar].layer; | |
[capa setShadowColor: [[UIColor blackColor] CGColor]]; | |
[capa setShadowOpacity:0.85f]; | |
[capa setShadowOffset: CGSizeMake(0.0f, 1.5f)]; | |
[capa setShadowRadius:2.0f]; | |
[capa setShouldRasterize:YES]; | |
//Round | |
CGRect bounds = capa.bounds; |