From b7f9a2a5f7eb8c5cd2af5b57b9305a71a3a704cc Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 30 Sep 2020 04:44:00 +0200 Subject: [PATCH] Fixed bug that setting frequency didn't work --- .../BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift index 780f2eec..485a916c 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift @@ -20,7 +20,7 @@ struct FlickerCodeTanView: View { @State private var showBit4: Bool = true @State private var showBit5: Bool = true - private let animator: FlickerCodeAnimator = FlickerCodeAnimator() + @State private var animator: FlickerCodeAnimator = FlickerCodeAnimator() // real curious bug: if @State is omitted setting frequency doesn't work (why?) private var tanMethodSettings: TanMethodSettings? = nil @@ -33,7 +33,7 @@ struct FlickerCodeTanView: View { set: { if (self.frequency != $0) { let newFrequency = $0 - + self.animator.setFrequency(frequency: Int(newFrequency)) DispatchQueue.main.async { @@ -85,7 +85,7 @@ struct FlickerCodeTanView: View { self._scaleFactor = State(initialValue: CGFloat(settings.width)) self._frequency = State(initialValue: CGFloat(settings.frequency)) } - + animator.setFrequency(frequency: Int(frequency)) }