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) |
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
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
//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
//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
<?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"); |
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
// 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 |
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
//UIButton | |
@IBOutlet weak var roofBtn: UIButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
checkBoxBtnInit() | |
} | |
// check button init | |
func checkBoxBtnInit(){ |
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
source 'https://github.com/CocoaPods/Specs.git' | |
platform :ios, '9.0' | |
use_frameworks! | |
target 'ProjectName' do | |
pod 'Alamofire', '~> 3.4' | |
end |
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 need add : UITextFieldDelegate | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
//delegate | |
discountTextField.delegate = self | |
sizeTextField.delegate = self | |
//add gesture to view |
OlderNewer