Skip to content

Instantly share code, notes, and snippets.

var viaWebViewURL: String = ""
@IBOutlet weak var monitorSysWebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
NSLog(viaWebViewURL)
let url = NSURL(string: viaWebViewURL)
NSURLCache.sharedURLCache().removeAllCachedResponses()// remove/clear cache
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
}
}
}
//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)
//class saleWebViewController: UIViewController, UIWebViewDelegate
@IBOutlet weak var spinner: UIActivityIndicatorView!
//網頁開始Load
func webViewDidStartLoad(webView: UIWebView) {
spinner.startAnimating() //開始轉
}
//網頁Load好了
func webViewDidFinishLoad(webView: UIWebView) {
<?php
/* Set Connection Credentials */
$serverName = "(local)"; //Local database
$connectionInfo = array( "Database"=>"your_DatabaseName", "CharacterSet" =>"UTF-8"); // /* SET database name */
/* For Cloud Connection Credentials */
//$serverName = "192.168.1.4\SQLEXPRESS,1433"; // /* SET IP */
//$connectionInfo = array( "Database"=>"DB_name", "UID"=>"your_id", "PWD"=>"your_pwd" ,"CharacterSet" =>"UTF-8");
// IRR swift version
// [email protected]
// reference http://www.codeproject.com/Tips/461049/Internal-Rate-of-Return-IRR-Calculation
// 2016/06/23
import UIKit
func computeIRR(cashFlows:[Int],numOfFlows:Int) -> Double{
//const
//UIButton
@IBOutlet weak var roofBtn: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
checkBoxBtnInit()
}
// check button init
func checkBoxBtnInit(){
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'ProjectName' do
pod 'Alamofire', '~> 3.4'
end
//class need add : UITextFieldDelegate
override func viewDidLoad() {
super.viewDidLoad()
//delegate
discountTextField.delegate = self
sizeTextField.delegate = self
//add gesture to view