迦太基文件内容:
github "SwiftyJSON/SwiftyJSON"
Run Code Online (Sandbox Code Playgroud)
错误:
Build Failed
Task failed with exit code 1:
/usr/bin/xcrun lipo -create /Users/samrezikram/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/SwiftyJSON/5.0.0/Build/Intermediates.noindex/ArchiveIntermediates/SwiftyJSON\ tvOS/IntermediateBuildFilesPath/UninstalledProducts/appletvos/SwiftyJSON.framework/SwiftyJSON /Users/samrezikram/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/SwiftyJSON/5.0.0/Build/Products/Release-appletvsimulator/SwiftyJSON.framework/SwiftyJSON -output /Users/samrezikram/Downloads/CarthageApp/Carthage/Build/tvOS/SwiftyJSON.framework/SwiftyJSON
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/px/jx4gljpj47j06qr7blw6b4w80000gn/T/carthage-xcodebuild.1NVy7o.log
Run Code Online (Sandbox Code Playgroud) 对不起,iPhone-X不可用.
在推出iPhone-X之后,每个人都希望他们的应用程序应该与iOS11和touchID兼容,但问题是开发人员测试触摸ID太昂贵了.
我没有iPhone来检查我的代码,但我可以在iOS模拟器中检查相同吗?
let context = LAContext()
if ( context.biometryType == .typeFaceID ) {
// Face ID
}
if ( context.biometryType == .typeTouchID) {
// Touch ID
} else {
// Stone Age
}
Run Code Online (Sandbox Code Playgroud) Alamofire.request(APPURL.GetAccounts, method: .post,
parameters: transactionData,
encoding: JSONEncoding.default,
headers: nil).responseJSON { responseData in }
Run Code Online (Sandbox Code Playgroud)
我的问题是限制我只能传递类型字典[String:Any]的原因是什么?
完整代码:
class func getAccounts( transactionData: [String:Any]?, withCompletionHandler: @escaping (_ response:AnyObject?)->(Void) ) {
Alamofire.request(APPURL.GetAccounts, method: .post,
parameters: transactionData,
encoding: JSONEncoding.default,
headers: nil).responseJSON { responseData in
if((responseData.result.value) != nil) {
let swiftyJsonVar = JSON(responseData.result.value!)
if let resData = swiftyJsonVar["Accounts"].arrayObject {
let resultData = resData as! [[String:AnyObject]]
withCompletionHandler(resultData as AnyObject)
}else{
withCompletionHandler(nil)
}
}else{
withCompletionHandler(nil)
}
}
}
Run Code Online (Sandbox Code Playgroud) 下面的代码是使用viewController实现的,我可以为Apple Watch做同样的事情并添加动画吗?
let filteredSubviews = self.view.subviews.filter({ $0.isKindOfClass(UIImageView) })// 2
for view in filteredSubviews {
// 3
let recognizer = UITapGestureRecognizer(target: self, action:Selector("handleTap:"))
recognizer.numberOfTapsRequired=1
// 4
recognizer.delegate = self
view.addGestureRecognizer(recognizer)
returnedAray=tempArray
//TODO: Add a custom gesture recognizer too
}
Run Code Online (Sandbox Code Playgroud)
我只需要知道WatchKit的addGestureRecognizer(识别器)的替代方案.