-1
は私がやったとき、私はこのコードあいまいな参照が
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