swift language

API reference

Swift

UIKit

Swift 菜鸟教程  Great

Installed Visual Studio Code, I found I cannot open it from Terminal. The solution is:  http://stackoverflow.com/questions/31630762/launch-visual-studio-code-editor-from-terminal-as-root-on-os-x, by adding following statement in .bash_profile file.

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}

UIWebView: http://sourcefreeze.com/uiwebview-example-using-swift-in-ios/ 

基于上面的,其实在IOS10是不工作的,代码修改如下:

        let url = URL.init(string: "http://localhost:3000")
        
        let requestObj = URLRequest(url: url!)
        webView.loadRequest(requestObj);

 但连接非HTTPS 的网站时,默认是被禁止的,会报相关错误。解决方案为:

You have to set the NSAllowsArbitraryLoads key to YES under NSAppTransportSecuritydictionary in your Info.plist file.

TOBE READ: 

http://stackoverflow.com/questions/27931135/adding-custom-http-header-field-on-all-uiwebview-requests

原文地址:https://www.cnblogs.com/swlin/p/6057733.html