八月第三週

1.protocol 與 NSObjectProtocol:html

繼承於 class通常使用在沒有繼承於 NSObjectClass 中,而繼承於 NSObjectProtocol通常使用於繼承於 NSObjectClass 中。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]’:

不寫明類型就行。 

https://stackoverflow.com/questions/37774822/swift-closure-cannot-convert-value-of-type-bool-to-expected-argument-t

 

9.最優辦法查找兩個數組相同與不一樣的數據:

https://www.jianshu.com/p/d817a3416955

 

10.Set的詳解:

http://www.hangge.com/blog/cache/detail_1840.html

相關文章
相關標籤/搜索