-1
轉換我的語法斯威夫特3.當我做到了,我用這個代碼不明確的參考成員「下標」
open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath! == "animatingTab" && change!["new"]!.isEqual(NSNumber (value: 2 as Int))// here i got error{
UIView.animate(withDuration: 0.25, delay: 0, options: UIViewAnimationOptions.curveEaseIn, animations: {
self.settingsView.frame.origin = CGPoint(x: LayoutService.width(widthPercentage: 20), y: 0)
self.settingsView.setShadows()
}, completion: nil)
}
else if keyPath! == "animatingTab" && !change!["new"]!.isEqual(NSNumber(value: 2 as Int))// here i got error {
UIView.animate(withDuration: 0.25, delay: 0, options: UIViewAnimationOptions.curveEaseOut, animations: {
self.settingsView.frame.origin = CGPoint(x: LayoutService.width(widthPercentage: 100), y: 0)
self.settingsView.clearShadows()
}, completion: nil)
}
if keyPath! == "currentUser" {
self.settingsView.profileView.buildProfileForUser(user: AccountService.sharedInstance.currentUser!)
}
}
請它所出現添加完整的錯誤消息和行 – mlidal