- 博客(52)
- 资源 (1)
- 收藏
- 关注
原创 Cocoapods 集成部分命令
1.生成podfile文件,终端中执行cd 项目目录pod init2.集成三方框架,podfile中更改platform:ios,'8.0'use_frameworks!target'yourProjectName'dopod'AFNetworking'end3.安装框架,终端中执行pod i
2016-09-20 10:32:02
379
转载 在iOS应用程序中打开设备设置界面及其中某指定的选项界面
在iOS应用程序中打开设备设置界面及其中某指定的选项界面ios 5.1 之前摘自:http://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
2016-09-20 09:20:55
443
原创 自定义tableview 左划 按键
ios 8 以后系统有自定义方法- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath{ // 添加一个删除按钮 UITableViewRowAction *deleteRowAction = [UIT
2016-09-20 09:18:42
386
原创 在cocoaPods安装及使用过程中遇到的问题
使用mac安装cocoapods的流程及遇到的问题1. 安装cocoaPods 打开终端,输入以下命令sudo gem install cocoapods2. 出现错误 ERROR: Error installing cocoapods:activesupport requires Ruby version >= 2.2.2. 如下:3. 提示ruby版本
2016-09-20 09:16:53
382
原创 系统相机相册最基本调用
- (void)openPhotoLibrary{ UIImagePickerController * pickerImage = [[UIImagePickerControlleralloc] init]; if([UIImagePickerControllerisSourceTypeAvailable:UIImagePickerControllerSourceT
2016-03-03 12:03:31
312
转载 textfield监听删除按键 包括没有输入文字时(ios8 也可以使用)
@interface PFTextfield : UITextField@end--------------@implementation PFTextfield/** * 调用的私有方法,子类中重写该方法,父类执行 * * 用途:主要应用于ios8中没有输入文字时调用删除按钮 * * @param textField textfi
2016-02-23 11:45:53
3153
原创 ios 以后毛玻璃
UIBlurEffect *blur = [UIBlurEffecteffectWithStyle:UIBlurEffectStyleDark]; UIVisualEffectView *effectView = [[UIVisualEffectViewalloc] initWithEffect:blur]; effectView.alpha =0.
2016-01-13 16:54:39
390
原创 ios 指定角度圆角
// 指定角度圆角 UIBezierPath *maskPath = [UIBezierPathbezierPathWithRoundedRect:_viewBackground.boundsbyRoundingCorners:UIRectCornerTopLeft |UIRectCornerTopRight cornerRadii:CGSizeMake(10,10)];
2016-01-13 16:53:55
401
原创 present一个背景透明的viewController
viewController.view.backgroundColor = [UIColorclearColor]; if ([[[UIDevicecurrentDevice] systemVersion]floatValue]>=8.0) { viewController.modalPresentationStyle =UIModalPresentat
2016-01-13 16:40:21
340
转载 runloop介绍
http://mp.weixin.qq.com/s?__biz=MjM5Nzc1MzU2NA==&mid=400846546&idx=1&sn=1c4d98c12ac14063909aaab31de2059b&scene=23&srcid=1202Yh9am1igErGxn2Uc7x2M#rd
2015-12-07 10:51:01
339
原创 添加vvdocument
1.打开终端,输入以下代码获取到DVTPlugInCompatibilityUUID defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID 2.然后输入如下命令 【最后一项是获取到的DVTPlugInCompatibilityUUID】 find ~/Lib
2015-11-02 17:53:58
365
转载 iOS开发项目自动生成技术文档
转载自:http://www.iphonetrain.com/index.php?tp=blog_info&id=67做项目一般都会要求写技术文档,特别是单干接项目的,客户多少都会要求除了提供code之外,还得提供技术文档,而如果我们手写这类的文档,那工作量不比写code少。一般的开发工具都会提供类似集成的功能,比如Java语言本身就自带javadoc命令,可以从源码中抽取文档,几个配置,
2015-10-30 11:38:54
739
转载 去掉searchbar边框线
转载自 http://codego.net/361893/使用第五个解决问题1. 我通过添加一个子视图到seekbar的视图堆栈解决了这个问题。CGRect rect = self.searchBar.frame;UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, rect.size.heig
2015-08-06 10:45:08
1199
原创 textview防抖动 最后一行消失
// 防抖动 CGRect line = [textViewcaretRectForPosition: textView.selectedTextRange.start]; CGFloat overflow = line.origin.y + line.size.height - ( textView.contentOffs
2015-05-11 13:11:30
551
原创 视图拖动返回原位和高斯模糊效果
@interface ViewController ()@property (weak,nonatomic) IBOutletNSLayoutConstraint *redViewTopC; // 视图顶部约束@property (strong,nonatomic) IBOutletUIPanGestureRecognizer *redViewPanG;//
2015-05-05 16:13:33
475
转载 线程基础相关
转载自:http://www.cnblogs.com/yjg2014/p/yjg.htmlIOS多线程知识总结/队列概念/GCD/主队列/并行队列/全局队列/主队列/串行队列/同步任务/异步任务区别(附代码)2014-04-25 14:37 by JG2014, 586 阅读, 0 评论, 收藏, 编辑 进程:正在进行中的程序被称为进程,负责程序运行的内
2015-04-08 12:26:07
344
转载 在iOS应用程序中打开设备设置界面及其中某指定的选项界面(ios6以后也有)
在iOS应用程序中打开设备设置界面及其中某指定的选项界面ios 5.1 之前摘自:http://stackoverflow.com/questions/8246070/ios-launching-settings-restrictions-url-scheme[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@
2015-03-12 09:49:05
1054
原创 getsuperviewcontroller
- (UIViewController *)getSuperViewController{ for (UIView* next = [self superview];next; next = next.superview) { UIResponder* nextResponder = [next nextResponder]; if ([
2015-03-02 15:55:55
461
转载 string 用法大全
一、NSString 创建字符串。 NSString *astring = @"This is a String!"; 创建空字符串,给予赋值。 NSString *astring = [[NSString alloc] init]; astring = @"This is a String!"; NSLog(@"astring:%@",astring); s
2015-02-05 15:40:35
515
转载 判断ios设备
一、判断设备1.?1234567891011//设备名称return[UIDevice currentDevice].name; //设备型号,只可得到是何设备,无法得到是第几代设备return[UIDevi
2015-02-02 17:04:06
457
转载 ios 判断禁止输入emoji表情
@implementation NSString(NSString_Emoji)+ (BOOL)isContainsEmoji:(NSString *)string { __blockBOOL isEomji = NO; [string enumerateSubstringsInRange:NSMakeRange(0, [stringlength])
2015-01-30 15:51:03
1454
原创 iOS 8 UITableView separator inset 0 not working
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ if ([tableViewrespondsToSelector:@selector(setSeparatorInset:)])
2015-01-30 10:15:26
1023
原创 textfield、 textView内容长度限制(中文输入越界)附带:textView回车效果,判断禁止字符
error: NSMutableRLEArray replaceObjectsInRange:withObject:length:: Out of bounds实现textView的代理- (void)textViewDidChange:(UITextView *)textView{ // !isEmtpy && >maxLength if(![NSStri
2015-01-27 11:02:26
3971
原创 滚动隐藏statusbar
@property (assign,nonatomic) BOOL hiddenStatusBar;- (void)scrollViewDidScroll:(UIScrollView *)scrollView{ if (scrollView.contentOffset.y >108) { self.hiddenStatusBar =YES;
2015-01-15 10:05:48
520
原创 修改程序名
1.复制现有文件夹,将拷贝更名为你所想要的名字.2.打开新文件夹,将.xcodeproj更名3.右键点击.xcodeproj并选择Show package contents,弹出一个对话框包含了几个文件.(事实上.xcodeproj是这几个文件打成的包)4.用textEdit打开 project.pbxproj文件,将所有旧名字替换成为新的.5.删除build文件夹6.用XCo
2015-01-14 12:48:43
619
转载 IOS基础:Objective-C 字符串处理
转载自:http://www.cnblogs.com/martin1009/archive/2012/06/07/2540123.html//一、NSString/*----------------创建字符串的方法----------------*/ //1、创建常量字符串。NSString *astring = @"This is a String!";
2015-01-06 18:02:39
397
原创 ios tableViewCell 数组方式 全选、多选的删除
typedef NS_ENUM(NSUInteger, EditTypes) { // 删除状态 deleteForEditTypes = 0, // 编辑状态 editForEditTypes,};@interface FavoriteBoard ()UITableViewDelegate,UITableViewDataSource>
2015-01-05 16:50:53
1440
转载 block
zz from http://www.cnbluebox.com/?p=255引言使用block已经有一段时间了,感觉自己了解的还行,但是几天前看到CocoaChina上一个关于block的小测试主题: 【小测试】你真的知道blocks在Objective-C中是怎么工作的吗?,发现竟然做错了几道, 才知道自己想当然的理解是错误的,所以抽时间学习了下,并且通过一些测试代码进行测试,
2014-12-18 15:30:26
423
原创 navigation高度
// UINavigationBar *bar = [self.navigationController navigationBar];// CGFloat navBarHeight = 88.f;// CGRect frame = CGRectMake(0.0f, 20.0f, [UIScreen mainScreen].bounds.size.width, navBa
2014-12-08 09:41:46
489
转载 IOS开发/iphone开发震动与播放声音
转载自:http://blog.sina.com.cn/s/blog_68661bd80101d2bj.html可能在软件某些时候需要震动手机以示提醒,可能还要播放一段特殊的声音引起用户的注意,在ios中如何实现呢?首先实现震动,其实就是调用系统的方法,一句话就行,AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);当然前提是要加
2014-12-01 12:21:43
757
原创 圆角边的实现
全部圆角 _imgRange.layer.cornerRadius =_imgRange.bounds.size.width/2;(圆形,数字越小或越大->边角越尖) _imgRange.layer.masksToBounds =YES;指定角度圆角 // 指定角度圆角 UIBezierPath *maskPath = [UIBezierPath
2014-11-27 09:45:21
768
原创 键盘点击return
-(BOOL)textFieldShouldReturn:(UITextField *)textField{ [textField resignFirstResponder]; return YES;}- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range
2014-11-25 12:08:06
422
原创 prepareForSegue 传递数据
Scene之间的数据传递当你从当前 scene中触发一个segue的时候,系统会自动调用prepareForSegue:sender:这个方法。如果你想从一个界面切换到里另一个界面的时候传递数据,你应该override这个方法。A---》B想把数据 NSString A_data 从AController传到BController,则在BController中 @proper
2014-10-23 21:26:13
739
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人