swift language
2016-11-12 23:02 Wizardlsw 阅读(188) 评论(0) 编辑 收藏 举报
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: