iOS开发

获取iPhone中登陆过的WiFi密码

1.在iPhone中登陆iCloud ,钥匙串选择使用iCloud
2.在同一AppleID账号登陆的Mac上去钥匙串中查看对应的WiFi密码
3.查看密码需要输入电脑账号密码。

Architechtures

armv6, armv7, armv7s, arm64指的是arm处理器的指令集。(真机)

i386, x86_64指的是pc端处理器指令集。(模拟器)
xcode中,指令集相关的选项主要有三种:
1,Architectures:该选项指定工程可被编译成支持何种指令集的数据包。由于工程会针对每一种指令集编译出对应的二进制数据包,所以支持的指令集越多,对应生成的ipa包就越大。
2,Valid Architectures:限制了工程可支持的指令集范围。即,工程最终支持的指令集在valid architectures定义的这个范围之内,所以工程最终编译出的包支持的指令集将由Architetures和Valid Architectures选项定义的指令集的交集决定。
3,Build Active Architecture Only:设定是否只编译出当前连接设备所支持的指令集。一般,debug的时候可指定为YES,为了debug的时候编译速度快;release的时候指定为NO,以适应不同的设备。

CocoaPods

pod update 太慢
手动去 GitHub 下载master spec,发现后续的更新有问题

问题:[!] CocoaPods could not find compatible versions for pod “UMCAnalytics”:
In snapshot (Podfile.lock):
UMCAnalytics (= 6.0.2)
In Podfile:
UMCAnalytics
None of your spec sources contain a spec satisfying the dependencies: UMCAnalytics, UMCAnalytics (= 6.0.2).
You have either:
out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.
需要更新master索引库

更新 master 索引库

更新到一半报错:[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progressCloning into ‘master’…remote: Counting objects: 1076833, done.remote: Compressing objects: 100% (100/100), done.error: RPC failed; curl 56 SSLRead() return error -980654.00 KiB/sfatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failed
1.先查看源 gem sources 如果包含https://rubygems.org继续,否则,gem sources -a https://rubygems.org
2…安装 railgem install rails
3.pod setup
如果直接复制master 到respo 会导致后期无法更新pod ,自行添加.git也不行

carthage

carthage update --platform ios(下载库的时候)无法构建 framework
	Failed to write to /Users/xx/Documents/think_tank/swiftDemo/Carthage/Build/iOS/SwiftyJSON.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “SwiftyJSON.framework” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/dushengjia/Library/Developer/Xcode/DerivedData/SwiftyJSON-amrebnrlsfqwjubevczxildlcwzc/Build/Products/Release-iphoneos/SwiftyJSON.framework, NSUnderlyingError=0x7f90ef7964a0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory

字符串宏

#define NSString(...) [NSString stringWithFormat:__VA_ARGS__](字符串宏)

ReactiveObjectC

函数响应式编程
a = b + c,赋值之后 b 或者 c 的值变化后,a 的值不会跟着变化,而响应式编程的目标就是,如果 b 或者 c 的数值发生变化,a 的数值会同时发生变化

核心思想
创建信号->订阅信号(subscribeNext)->发送信号

swift

区间
"…< “与“…”,前面半开半闭,后面是闭区间

类型装换符
as
1.子类转父类
2.数值类型装换
3.switch中的模式匹配
as!
类型强转 有 crash 风险
as?
可选转换,转换不成功 返回nil

runtime
object_getClass 获取变量类名

UI

设置状态栏
override var preferredStatusBarStyle: UIStatusBarStyle {
return UIStatusBarStyle.lightContent//只有白色和黑色
}

设置导航栏
tintColor 设置导航栏、标签栏的颜色
//去掉导航栏底下的黑线
self.navigationController?.navigationBar.shadowImage = UIImage.init()
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.black]//设置字体颜色

bounds 坐标原点是屏幕, frame 坐标原点是父控件

*UITableView.tableFootView 要设置一个bgView 再添加子控件才可以显示正常的frame 设置。

动态静态cell混用,必须用到storyBoard ,要设定cell 的高度,否则会奔溃(报数组越界)

UITableViewController 手势侧滑返回半路取消,view 会整体下移

按钮设置了图片设置它unable ,会导致图片变灰白,如果不想它响应事件应该 把用户交互设为false

CUICatalog: Invalid asset name supplied: (null)因为设置图片的时候字符串为空

屏幕宽高
iPhone4.4s 320480
iphon5,5s,5c,se 320
568
iphone6,6s,7,7s,8 375 *667
iphone6p 7p,8p 414 *736
iPhonex 375 812
iphonexs iPhone

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值