04 2017 档案
摘要://数字转化为汉字 如5-->五-(NSString*)translation:(NSString *)arebic{ NSString *str = arebic; NSArray *arabic_numerals = @[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"
阅读全文
摘要:-(UIColor *)colorWithHex:(NSString *)hexColor{ return [self colorWithHex:hexColor alpha:1.0f];}-(UIColor *)colorWithHex:(NSString *)hexColor alpha:(fl
阅读全文
摘要:此处我把json数据中的null转换成了@"",防止出现null程序崩掉,可以把下边宏代码复制到pch中,就可以在整个程序中引用了 #define DSStringValue(value)\({id tmp;\if ([value isKindOfClass:[NSNull class]]){\tm
阅读全文
摘要:num1与num2之间的随机数 -(float)randomFloatBetween:(float)num1 andLargerFloat:(float)num2{ int startVal = num1*10000; int endVal = num2*10000; int randomValue
阅读全文
摘要:- (NSURLRequest *)addHeaderRequestWithUrl:(NSString *)urlStr{ NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL UR
阅读全文
摘要:金融类app防止信息在后台中被一些恶意截屏软件进行截屏,对进入后台的app做模糊处理 - (void)applicationWillResignActive:(UIApplication *)application { //进入后台盖上view,实现模糊效果 UIView* view = [[UIV
阅读全文
摘要:在appdelegate中- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中加入下面代码 NSString *oldUserAg
阅读全文
摘要://获取验证码接口+ (NSDictionary *)getPhoneCodeWithPhoneWithParamDict:(NSDictionary *)paramDict vertifyButton:(UIButton *)vertifyButton urlStr:(NSString *)url
阅读全文
摘要://json格式字符串转字典+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString { if (jsonString == nil) { return nil; } NSData *jsonData = [jsonStrin
阅读全文
摘要:+(NSString *)getNewBankNumWitOldBankNum:(NSString *)bankNum{ NSMutableString *mutableStr; if (bankNum.length) { mutableStr = [NSMutableString stringWi
阅读全文
摘要:+(void)clearCache{ NSHTTPCookie *cookie; NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (cookie in [storage cookies
阅读全文
摘要:为了方便阅读,app中的金额需要用,隔开 //数字3个字一个逗号隔开,如:1,000.98+ (NSString *)separatePer3WithNumStr:(NSString *)numStr{ double oldf = [numStr doubleValue]; long long ol
阅读全文
摘要:啥都不说了,直接上代码,做了一个Category #import <UIKit/UIKit.h>@interface UILabel (ChangeLineSpaceAndWordSpace)/** * 改变行间距 */+ (void)changeLineSpaceForLabel:(UILabel
阅读全文
摘要:开发过程中难免用到圆角以及恶心的半圆角,看代码 半圆角:这是把左边的两个角切成了圆角 UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:btn.bounds byRoundingCorners:(UIRectCorner
阅读全文
摘要:在项目中有时候需要弹出活动弹框,由于原生的样式会固定,所以考虑h5显示,这就需要webView的背景色半透明,如图: 让 UIWebView 背景透明需要以下设置 webView.backgroundColor = [UIColor clearColor];
webView.opaque = NO;
阅读全文
摘要:做项目时经常要获取到当前控制器来进行一些操作,故用下边的方法可以获取到 + (UIViewController *)getCurrentVC { UIWindow *window = [[UIApplication sharedApplication].windows firstObject]; i
阅读全文