Eric Steven Raymond, Thyrsus Enterprises, < [email protected] >
Rick Moen, < [email protected] >
翻译:柯非, < [email protected] >
这篇译文基于2014.05.21更新的原文修订版3.10。
特别感谢王刚,此前本文的翻译是由他进行的。
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
Eric Steven Raymond, Thyrsus Enterprises, < [email protected] >
Rick Moen, < [email protected] >
翻译:柯非, < [email protected] >
这篇译文基于2014.05.21更新的原文修订版3.10。
特别感谢王刚,此前本文的翻译是由他进行的。
fastlane_version "1.94.0" | |
default_platform :ios | |
platform :ios do | |
desc "Run Unity Editor tests" | |
lane :test_unit do | |
unity( | |
run_editor_tests: true | |
) |
/// 範例中使用了 SVProgressHUD, SwiftyJSON | |
/// 另外 UIAlertController 有 extension | |
func request(_ path: String, method: HttpMethod = .get, parameters: [String: Any]? = nil, localizedStatus: String? = NSLocalizedString("資料處理中", comment: "呼叫API讀取狀態文字"), _ completion: @escaping (_ json: JSON) -> Void) { | |
// 顯示 ActivityIndicator | |
if let status = localizedStatus { SVProgressHUD.show(withStatus: status) } | |
// 待會使用 GCD 版本所以要 Dispatch 到其他 thread | |
DispatchQueue.global().async { | |
public extension MoyaProvider { | |
public func request(_ target: Target, | |
callbackQueue: DispatchQueue? = nil, | |
progress: ProgressBlock? = nil) -> Promise<Moya.Response> { | |
return Promise { [weak self] fulfill, reject in | |
self?.request( | |
target, | |
callbackQueue: callbackQueue, | |
progress: progress, | |
completion: self?.completion(for: fulfill, reject: reject) ?? {_ in } |