This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //class saleWebViewController: UIViewController, UIWebViewDelegate | |
| @IBOutlet weak var spinner: UIActivityIndicatorView! | |
| //網頁開始Load | |
| func webViewDidStartLoad(webView: UIWebView) { | |
| spinner.startAnimating() //開始轉 | |
| } | |
| //網頁Load好了 | |
| func webViewDidFinishLoad(webView: UIWebView) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //GG crach | |
| let webViewURL001: String = "http://text.com/?q1=我是中文&q2=我是符號%%%" | |
| //Good to go with string.stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())! | |
| let webViewURL002: String = "http://text.com/?q1=我是中文&q2=我是符號%%%".stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())! | |
| let url = NSURL(string: webViewURL002) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Alamofire.request(.GET,urlString).responseJSON { (response) in | |
| if let JSON = response.result.value{ | |
| let jsonObj = JSON as! NSArray | |
| for p in jsonObj { | |
| // append to Array | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSURLCache.sharedURLCache().removeAllCachedResponses()// remove/clear cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var viaWebViewURL: String = "" | |
| @IBOutlet weak var monitorSysWebView: UIWebView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| NSLog(viaWebViewURL) | |
| let url = NSURL(string: viaWebViewURL) |
NewerOlder