自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 GCD线程管理 两个请求结束 做其他操作

dispatch_group_async(group,dispatch_get_global_queue(0,0), ^{            //线程一         dispatch_semaphore_t semaphore =dispatch_semaphore_create(0);//网络操作....dispatch_semaphore

2017-07-04 17:35:44 407

转载 iOS常用的宏

#define NavigationBar_HEIGHT 44  #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)#define SAFE_RELE

2017-05-08 13:58:28 329 1

原创 颜色随机

int R = (arc4random() % 256) ;//  int G = (arc4random() % 256) ;//  int B = (arc4random() % 256) ;//  cell.backgroundColor = [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:

2017-03-09 13:27:22 396

原创 iOS label添加删除线

NSString * textStr = [NSStringstringWithFormat:@"原价:¥%.2f",model.par_value];  NSUInteger length = textStr.length;  NSMutableAttributedString *attri = [[NSMutableAttributedStringalloc] in

2017-02-20 10:57:42 391

原创 iOS调到各种权限设置收集

例子  : 通知  判断通知是否开启 只判断一次-(void)judgeNoticeState{  if(![[NSUserDefaultsstandardUserDefaults] boolForKey:@"messageFirstStart"]){    [[NSUserDefaultsstandardUserDefaults]

2016-10-27 11:11:01 1965

原创 iOS 键盘处理

[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(keyBoardWillShow:)name:UIKeyboardWillShowNotificationobject:nil];    // 键盘即将隐藏, 就会发出UIKeyboardWillHideNotificatio

2016-10-24 17:10:14 281

原创 Label自适应高度与长度

//设置行间距等属性计算高度+(CGSize)getAttributeStringSize:(NSString*)str Font:(UIFont*)setFont LineSpace:(CGFloat)spaceFloat LabelWidth:(CGFloat)labelWidth{    NSAttributedString *attributStr=[[

2016-10-24 17:08:34 1115

原创 iOS textView placeholder

#import @interface CustomTextView : UITextView@property (nonatomic,retain) NSString *placeholder; //内容@property (nonatomic,retain) UIColor *placeholderColor;  //颜色@end

2016-10-24 17:02:37 286

原创 Reachability判断的不准确 检测网络

NSString  * strNetworkType =@"";    //创建零地址,0.0.0.0的地址表示查询本机的网络连接状态  struct sockaddr_storage zeroAddress;    bzero(&zeroAddress, sizeof(zeroAddress));  zeroAddress.ss_len =

2016-10-13 17:17:05 1198

原创 UIActivityIndicatorView

UIActivityIndicatorViewUIActivityIndicatorView * activity = [[UIActivityIndicatorViewalloc] initWithFrame:CGRectMake(0, 0, 30, 30)];//指定进度轮的大小UIActivityIndicatorView * activity = [[UIActivit

2016-10-12 16:45:28 222

原创 iOS禁止当前页面左侧滑动返回

/* 禁止当前页面左侧滑动返回导致卡死 */-(void)viewDidAppear:(BOOL)animated{    [super viewDidAppear:animated];    self.navigationController.interactivePopGestureRecognizer.enabled = NO;}

2016-10-12 16:37:27 10699

原创 NSAttributedString用法

NSString * str = @"(含代)";//富文本对象     NSMutableAttributedString * aAttributedString = [[NSMutableAttributedString alloc] initWithString:str];//富文本样式     [aAttributedString addAttribute:

2016-09-07 11:24:23 289

转载 ios 启动图尺寸 及icon尺寸

图标尺寸输出列表:180x180120x12087x8780x8058x5857x5729x29启动图片尺寸输出列表:640x960640x1136750x13341242x2208自己用的1280* 1920 [email protected]*1334    [email protected]

2016-09-02 13:50:13 1100

原创 iOS 隐藏导航条左边返回按钮

[self.navigationItem setHidesBackButton:YES];

2016-09-01 10:12:10 7253

原创 iOS Button 按钮 设置图片在文字的右边

UIButton * cityBtn=[UIButtonbuttonWithType:UIButtonTypeCustom];    [cityBtn setTitle:@"上海"forState:UIControlStateNormal];    [cityBtn setImage:[UIImageimageNamed:@"icon"]forState:UICon

2016-08-25 15:32:38 2124

原创 自定义view 跳转到其他的ViewController

使用代理跳转在自定义的view设置代理方法 .h界面@protocol pushViewControlDelegate NSObject>-(void)jumpViewControllerUserId:(NSString *)userId;@end@property (nonatomic,weak) idpushViewControlDe

2016-08-25 11:31:21 842

原创 iOS xib或者sb 添加控件的圆角,边框,及边框颜色

在右边工具栏 User Defined Runtime Attributes中添加一下KeyPath         Type             valuelayer.cornerRadius  String          10 //圆角效果layer.borderWidth   Number       1    //边框宽度layer.borderColo

2016-08-25 11:25:39 1782

转载 iOS开发动画总结(Animation)

UIView的,翻转、旋转,偏移,翻页,缩放,取反的动画效果翻转的动画   [objc] view plain copy //开始动画     [UIView beginAnimations:@"doflip" context:nil];     //设置时常     [UIView setAnimationDuration:

2016-08-22 14:52:57 354

原创 iOS TableView更新某一组某一行

//一个section刷新NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:1]; //你需要更新的组数[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];  //collection 相同//

2016-08-22 09:43:59 1369

原创 iOS传入颜色返回图片

-(UIImage *)imageWithColor:(UIColor *)color {CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);UIGraphicsBeginImageContext(rect.size);CGContextRef context = UIGraphicsGetCurrentContext();

2016-08-22 09:43:24 258

转载 iOS直播等开源项目地址收藏

成为iOS顶尖高手,你必须来这里(这里有最好的开源项目和文章)一、直播项目开源https://github.com/chenliming777/LMLiveStreaming二、YY系列产品https://github.com/ibireme/YYKit三、深入解析 iOS 开源项目http://draveness.me/https:

2016-08-22 09:42:48 1537

原创 iOS进阶经常去的网站

iOS开发初学者需要经常去的论坛或网站iOS开发初学者需要经常去的论坛或网站Apple Developer:网址:https://devforums.apple.com/[美国 Apple公司]上有很多文档,对英语的要求也稍高,适合敲完上面两个网站的入门教程后,做参考和提升使用。objc中国:推荐一个特别棒的项目:objc.io 原版地址:http://www.objc.i

2016-08-22 09:42:10 674

转载 iOS 手机号码和邮箱的验证

/*手机号码验证 MODIFIED BY HELENSONG*/+(BOOL) isValidateMobile:(NSString *)mobile{    //手机号以13, 15,18开头,八个 \d 数字字符    NSString *phoneRegex = @"^((13[0-9])|(15[^4,\\D])|(18[0,0-9]))\\d{8}$";

2016-08-22 09:37:20 585

转载 iOS开发 版本更新提醒

- (void)versionUpdate{       //获得当前发布的版本    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{        //耗时的操作---获取某个应用在AppStore上的信息,更改id就行        NSS

2016-08-22 09:35:59 4110

原创 iOS类的扩展与继承、概念

//类别的作用: //(1)将类别实现分散到多个不同文件或多个不同框架中//(2)创建私有方法的前向引用//(3)向对象添加非正式协议//类别的局限性://(1)无法添加新的实例变量//(2)名称冲突,如果类别和现有的方法重名,类别具有更高的优先级,解决办法,类别方法名中添加一个前缀Extension非常像是没有命名的类别 只

2016-08-22 09:32:54 319

原创 iOS点击图片放大 再点击缩小

#import @interface MPAvatarBrowser : NSObject+(void)showImage:(UIImageView*)avatarImageView;@end#import "MPAvatarBrowser.h"static CGRect oldframe;@implementatio

2016-08-19 17:51:27 824

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除