![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS
Boris0629
这个作者很懒,什么都没留下…
展开
-
手动添加Pch全局引用文件
1,在项目下新建 pch 文件 2,在TARGETS中,build setting 中找到 prefix header 设置 $(SRCROOT)/pchFile.pch相对路径原创 2016-05-16 10:46:36 · 238 阅读 · 0 评论 -
IOS OpenSSL项目添加
1,将include头文件夹copy 到项目中, 2,将lib文件夹copy到项目中,其中lib(libcrypto.a,libssl.a) 3,将PROJECT 中Build Setting 的User Header Search Paths 设置“$(PROJECT_DIR)/TestEcc/include” 设置为recursive; 4,将TARGETS 中Build Settin原创 2017-09-19 10:32:57 · 845 阅读 · 0 评论 -
ios监听用户是否触摸了屏幕的一种实现
近期在项目中有一个需求是:10秒钟内如果用户没有跟屏幕发生交互则提示一下用户。 经过google和实践找到一种实现方法步骤如下: 1.让AppDelegate继承UIApplication而不是UIResponser。 2.重载sendEvent方法。 - (void)sendEvent:(UIEvent *)event { [supe转载 2016-12-08 13:37:09 · 4551 阅读 · 0 评论 -
iOS Autolayout 自动布局代码使用规则
代码中一般用到的有两个添加约束的方式: 1.- (void)addConstraint:(NSLayoutConstraint *)constraint NS_AVAILABLE_IOS(6_0); 2.- (void)addConstraints:(NSArray *)constraints NS_AVAILABLE_IOS(6_0); 在使用自动布局之前要对子视图的布局方式原创 2016-08-08 15:04:32 · 214 阅读 · 0 评论 -
IOS Block使用
1,定义声明 申明 传入无参数 typedef void (^actionBlockName)(void); 有参数 typedef void (^actionBlockName)(UIButton *btn); 定义 @property(nonatomic , copy) actionBlockName competition;原创 2016-07-04 11:25:09 · 386 阅读 · 0 评论 -
iOS 静态库通用打包
//静态库通用打包 lipo -create xxxx/liblibsql.a xxxxx/liblibsql.a -output libsql.a原创 2016-08-03 11:47:03 · 228 阅读 · 0 评论 -
iOS 文件路径深度遍历
-(void)test{ NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *doc原创 2016-08-03 11:44:48 · 448 阅读 · 0 评论 -
iOS 单例模式
//.h文件 #import @interface Singleton : NSObject //单例方法 +(instancetype)sharedSingleton; @end //.m文件 #import "Singleton.h" @implementation Singleton //全局变量 static id _instance = nil; //单例方法原创 2016-08-03 11:27:56 · 213 阅读 · 0 评论 -
IOS UITextView 首行缩进
#pragma mark -UITextView的代理方法 -(void)textViewDidChange:(UITextView *)textView{ //首行缩进 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; // par原创 2016-07-25 17:59:32 · 943 阅读 · 0 评论 -
CAShapeLayer 属性(strokeStart和strokeEnd)
1 keyPath = strokeStart 动画的fromValue = 0,toValue = 1 表示从路径的0位置画到1 怎么画是按照清除开始的位置也就是清除0 一直清除到1 效果就是一条路径慢慢的消失 2 keyPath = strokeStart 动画的fromValue = 1,toValue = 0 表示从路径的1位置画到0 怎么画是按原创 2016-08-06 10:36:46 · 378 阅读 · 0 评论 -
iOS 理解KVO与KVC
KVC: 简单的键值对操作, 设值: setValue:属性值 forKey:属性名(用于简单路径)、setValue:属性值 forKeyPath:属性路径(用于复合路径) 读取: valueForKey:属性名 、valueForKeyPath:属性名(用于复合路径) KVO: 根据指定Key增加监听器, 注册指定Key路径的监听器: addOb原创 2016-05-17 09:45:38 · 214 阅读 · 0 评论 -
iOS CocoaPods的安装流程
1.移除现有Ruby默认源 $gem sources --remove https://rubygems.org/ 2.使用新的源 $gem sources -a https://ruby.taobao.org/ 3.验证新源是否替换成功 $gem sources -l 4.安装CocoaPods (1) $sudo gem install coc原创 2016-05-16 11:38:39 · 203 阅读 · 1 评论 -
iOS 隐藏键盘
- (void)setDismissKeyboard { NSNotificationCenter *nitification = [NSNotificationCenter defaultCenter]; UITapGestureRecognizer *tapAction =[[UITapGestureRecognizer alloc] initWithTarg原创 2016-05-16 12:45:26 · 364 阅读 · 0 评论 -
iOS layoutSubviews的调用
1、init初始化不会触发layoutSubviews 2、addSubview会触发layoutSubviews 3、设置view的Frame会触发layoutSubviews,当然前提是frame的值设置前后发生了变化 4、滚动一个UIScrollView会触发layoutSubviews 5、旋转Screen会触发父UIView上的layoutSubviews原创 2016-05-16 11:31:17 · 478 阅读 · 0 评论 -
iOSUIView是否包含,相交
1,判断一个点是否被一个CGRect包含 BOOL contains = CGRectContainsPoint(CGRect rect, CGPoint point); 2,判断两个View 是否相交 BOOL contains = CGRectContainsRect(CGRect rect1, CGRect rect2); 或者 BOOL contain原创 2016-05-16 11:03:40 · 1180 阅读 · 0 评论 -
iOS UIView中坐标转换
// 将像素point由point所在视图转换到目标视图view中,返回在目标视图view中的像素值 - (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view; // 将像素point从view中转换到当前视图中,返回在当前视图中的像素值 - (CGPoint)convertPoint:(CGPoint)point原创 2016-05-16 10:55:41 · 236 阅读 · 0 评论 -
ios WKWebview弹出键盘上的按钮隐藏
#import @interface WKWebView (AccessoryHiding) @property (nonatomic, assign) BOOL hackishlyHidesInputAccessoryView; @end #import "WKWebView+AccessoryHiding.h" #import原创 2017-11-06 10:28:47 · 2030 阅读 · 0 评论