摘要: iOS 中实现线程安全 实现线程安全可以通过加锁、单线程访问等方式。 iOS 中常用的几种锁: os_unfair_lock pthread_mutex dispatch_semaphore NSLock NSRecursiveLock NSCondition NSConditionLock @sy 阅读全文
posted @ 2020-06-08 22:51 一坨☁️ 阅读(204) 评论(0) 推荐(0) 编辑
摘要: iOS 中实现多线程的几种方式: dispatch NSOperation performSelector NSThread pthread 一、dispatch,对pthread的封装 1. dispatch_sync 和 dispatch_aync dispatch_sync 程序会等待 dis 阅读全文
posted @ 2020-06-08 15:35 一坨☁️ 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 一、使用iTunes,将ipa拖到itues里即可。 二、使用xcode -> Window -> Device and Simulators, 选中设备,点+,选中需要安装的ipa文件。 三、 使用ideviceinstaller命令行脚本安装 1、安装ideviceinstaller brew 阅读全文
posted @ 2020-02-16 18:21 一坨☁️ 阅读(1903) 评论(1) 推荐(0) 编辑
摘要: UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, width, 20) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(10,10)]; ... 阅读全文
posted @ 2018-05-18 17:51 一坨☁️ 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 一、事件不响应 1、父视图存在frame为0,或者高度宽度为0的情况。 2、未设置userInteractionEnabled=YES; 二、UIControl的子视图的userInteractionEnabled为yes时,UIControl不会响应子视图上的点击事件。 阅读全文
posted @ 2018-05-14 15:05 一坨☁️ 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 通常方式,设置view的layer属性 2、四周同时有阴影 3、左右两边阴影 阅读全文
posted @ 2018-05-08 17:08 一坨☁️ 阅读(737) 评论(0) 推荐(0) 编辑
摘要: 问题:当文字内容超过textview时,希望默认显示滚动条,UITextView继承自UIScrollView,滚动条自在滚动手势追踪的时候才会出现,怎样让滚动条一直显示呢? 通过UI堆栈可以看到,滚动视图是一个UIImageView,隐藏的时候alpha为0,所以可以通过category的方式重新 阅读全文
posted @ 2018-04-25 17:00 一坨☁️ 阅读(811) 评论(0) 推荐(0) 编辑
摘要: 一、framework中有哪些内容 1. Headers 头文件 2. info.plist (动态库没有) 3. Mudues 4. 可执行文件 二、 1、类库可分为动态库(.dylib .tdb .framework)、静态库(.framework .a) 2、静态库会在编译时被打包到app的二 阅读全文
posted @ 2018-04-25 14:39 一坨☁️ 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 一、重载系统已存在的运算符。 swift中可以识别的运算符 + - * / % += -= ++ & | > >= < <= 这些运算符相当于一个方法名,可以用来定义 名字相同:运算符 参数个数:运算符为前置或者后置,一个参数,中置时两个参数。 参数类型不同:根据自己需要定义 的不同重载方法。 ex 阅读全文
posted @ 2018-04-23 21:13 一坨☁️ 阅读(351) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/zttjhm/article/details/41546913 1、删掉文件的同时删掉info.plist中关于luanch.storyboard main.storyboard的配置 2、设置 launch image source 阅读全文
posted @ 2018-03-15 14:48 一坨☁️ 阅读(135) 评论(0) 推荐(0) 编辑