1.protocol 与 NSObjectProtocol:html
继承于 class通常使用在没有继承于 NSObject 的 Class 中,而继承于 NSObjectProtocol通常使用于继承于 NSObject 的 Class 中。web
2.swift
NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(startTimer), object: nil)数组
perform(#selector(startTimer), with: nil, afterDelay: 0.5)xcode
3.如何对浮点数进行取余(取模):缓存
使用 truncatingRemainder 方法进行浮点数取余.架构
4.Swift4.0 URLString内有汉字转码方法:url
https://www.jianshu.com/p/bdf040d47018code
5.orm
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
let url = request.url
if !(url?.scheme == "http") && !(url?.scheme == "https") {
if UIApplication.shared.canOpenURL(url!) {
UIApplication.shared.openURL(url!)
return false
}
}
return true
}
6.iOS 清除xcode缓存和生成文件:
https://www.jianshu.com/p/de5ae302a42a
7.查询framework的架构信息:
lipo -info xxx.framework/xxxxFramework
8.Cannot convert value of type 'String?' to closure result type '[String : Any]’:
不写明类型就行。
9.最优办法查找两个数组相同与不一样的数据:
https://www.jianshu.com/p/d817a3416955
10.Set的详解: