Latest 0.0.3
Homepage https://github.com/yaonimingsanqian/GWTool
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit, Foundation, AdSupport
Authors

GWTool 功能

+(void)execAfter:(double)seconds cb:(DelayExecCB)cb;//延迟执行
+(UIColor *)getColor:(NSString*)hexColor alpha:(float)alpha;//从16进制获得颜色
+(NSString*)trim:(NSString*)string;//去掉字符串中的空格
+(int)getScreenWidth;//获得屏幕宽
+(int)getScreenHeight;//获得屏幕高
+(UIImage*)clipImage:(UIImage*)srcimg area:(CGRect)area;//图片剪裁
+(float)getStatusBarHeight;//获得状态栏高度
+(float)getNaviLanHeight:(UIViewController*)sender; //获得导航栏高度
+(void)setTitleWithNaviItem:(UINavigationItem*)item //设置导航栏标题
                      title:(NSString*)title 
          fonntSize:(int)f
          textColor:(UIColor*)c;

+(void)setRightBtnWithNaviItem:(UINavigationItem*)item //设置右按钮
                   stateNormal:(UIImage*)img_normal
             stateDown:(UIImage*)img_down
                 frame:(CGRect)frame
             action:(SEL)action
             target:(id)target;

+(void)setLeftBtnWithNaviItem:(UINavigationItem*)item //设置左边按钮
                  stateNormal:(UIImage*)img_normal
            stateDown:(UIImage*)img_down
                frame:(CGRect)frame
               action:(SEL)action
               target:(id)target;
//获得圆角view 指定某个角用which 多个角用|连接 如:UIRectCornerTopLeft|UIRectCornerTopRight
+(UIView*)getRoundCornerView:(UIView*)target radius:(int)radius which:(UIRectCorner)which;

+(NSString*)getAppVersion; //获得app版本
+(NSString*)getAppBuild; //获得app Build
//时间戳转时间,format,例如:@"MM月dd日HH:mm:ss"
+(NSString*)timeSpToDateStr:(SInt32)timeSp format:(NSString*)format;
+(NSDictionary*)strToJson:(NSString *)str; //字符串转字典
+(BOOL)isBetweenFromHour:(NSInteger)fromHour toHour:(NSInteger)toHour;//当前时间是否在指定时间内
+(NSString*)getIPAddressByHostName:(NSString*)strHostName;//根据域名获得ip

+(NSString*)getAppDocumentsDir;//获得app的 Documents目录
+(NSString*)getAppTmpDir;//获得app的tmp目录
+(NSString*)getAppCachesDir;//获得app的cache目录
+(NSString*)getIDFA;//获得idfa

安装

源码安装

  1. 直接下载代码 集成到工程.

cocopods安装

  1. 未安装cocopods的自行安装.
  2. 执行pod search GWtool.
  3. 编辑Podfile,添加 pod ‘GWTool’, ‘~> 0.0.3’.
  4. 执行pod install –verbose –no-repo-update.

更新记录

0.0.2

  1. 增加函数 +(NSString)getIPAddressByHostName:(NSString)strHostName;//根据域名获得ip.

0.0.3

  1. 新增 +(NSString*)getAppDocumentsDir;//获得app的 Documents目录
  2. 新增 +(NSString*)getAppTmpDir;//获得app的tmp目录
  3. 新增 +(NSString*)getAppCachesDir;//获得app的cache目录
  4. 新增 +(NSString*)getIDFA;//获得idfa

Latest podspec

{
    "name": "GWTool",
    "version": "0.0.3",
    "summary": "A small tool collection",
    "description": "GWTool provides some small function,I will Continually updated",
    "homepage": "https://github.com/yaonimingsanqian/GWTool",
    "license": "MIT",
    "authors": {
        "zhaoguowei": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/yaonimingsanqian/GWTool.git",
        "tag": "0.0.3"
    },
    "source_files": "demo/demo/gwtools/*.{h,m}",
    "frameworks": [
        "UIKit",
        "Foundation",
        "AdSupport"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This