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
// | |
// NSObject+Association.h | |
// | |
// Created by Maciej Swic on 03/12/13. | |
// Released under the MIT license. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSObject (Association) |
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
- (UIImage *)imageWithColor:(UIColor *)color { | |
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); | |
UIGraphicsBeginImageContext(rect.size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetFillColorWithColor(context, [color CGColor]); | |
CGContextFillRect(context, rect); | |
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); |
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
// Frome http://poolo.iteye.com/blog/1833821 | |
#import <UIKit/UIKit.h> | |
@interface UIView (Tree) | |
- (void)logViewTreeForMainWindow; | |
@end |
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
# Mac OS X Finder and whatnot | |
.DS_Store | |
# Xcode | |
build/ | |
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 |
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
// 配置自定义NavigationBar | |
- (void) setupCustomNavigaionBar | |
{ | |
// iOS 7 or Later | |
if (is_IOS7OrLater) { | |
// 图片背景 | |
[[UINavigationBar appearance] setBackgroundImage:[UIImage UIImageFromeColor:[UIColor colorWithRed:0.33 green:0.63 blue:0.7 alpha:1] withSize:CGSizeMake(0, 1)] forBarMetrics:UIBarMetricsDefault]; | |
// 背景颜色 | |
[[UINavigationBar appearance] setBarTintColor:Button_Backgroud_Color]; |
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
// | |
// CommonMacro.h | |
// | |
// | |
// Created by Haven on 26/9/13. | |
// Copyright (c) 2013 LF. All rights reserved. | |
// | |
#import <CoreTelephony/CTTelephonyNetworkInfo.h> | |
#import <CoreTelephony/CTCarrier.h> |