From bd103b3c1a37622af171acd2cfb2caaf3d73c38c Mon Sep 17 00:00:00 2001 From: Sameer Nawaz Date: Thu, 8 Apr 2021 00:03:26 +0530 Subject: [PATCH] Update PodVersion --- FortuneWheel.podspec | 2 +- Source/FortuneWheel.swift | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/FortuneWheel.podspec b/FortuneWheel.podspec index 8d741ac..fcbe886 100644 --- a/FortuneWheel.podspec +++ b/FortuneWheel.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'FortuneWheel' - s.version = '0.1.0' + s.version = '0.1.1' s.summary = 'A FortuneWheel library for iOS using SwiftUI' # This description is used to generate tags and improve search results. diff --git a/Source/FortuneWheel.swift b/Source/FortuneWheel.swift index 4ca760b..2542531 100644 --- a/Source/FortuneWheel.swift +++ b/Source/FortuneWheel.swift @@ -14,20 +14,18 @@ public struct FortuneWheel: View { var colors: [Color] = Color.spin_wheel_color, pointerColor: Color = Color(hex: "DA4533") @StateObject var viewModel: FortuneWheelViewModel - public init(titles: [String], size: CGFloat, onSpinEnd: ((Int) -> ())?, - colors: [Color]? = nil, pointerColor: Color? = nil, strokeWidth: CGFloat = 15, strokeColor: Color? = nil, - animDuration: Double = Double(6), timeCurveAnimation: Animation? = nil) { + public init(titles: [String], size: CGFloat, onSpinEnd: ((Int) -> ())?, colors: [Color]? = nil, pointerColor: Color? = nil, strokeWidth: CGFloat = 15, strokeColor: Color? = nil, animDuration: Double = Double(6), timeCurveAnimation: Animation? = nil) { - let animation = Animation.timingCurve(0.51, 0.97, 0.56, 0.99, duration: animDuration) self.titles = titles self.size = size + self.strokeWidth = strokeWidth + if let colors = colors { self.colors = colors } if let pointerColor = pointerColor { self.pointerColor = pointerColor } - self.strokeWidth = strokeWidth if let strokeColor = strokeColor { self.strokeColor = strokeColor } - _viewModel = StateObject(wrappedValue: FortuneWheelViewModel(titles: titles, animDuration: animDuration, - timeCurveAnimation: timeCurveAnimation ?? animation, - onSpinEnd: onSpinEnd)) + + let animation = Animation.timingCurve(0.51, 0.97, 0.56, 0.99, duration: animDuration) + _viewModel = StateObject(wrappedValue: FortuneWheelViewModel(titles: titles, animDuration: animDuration, timeCurveAnimation: timeCurveAnimation ?? animation, onSpinEnd: onSpinEnd)) } public var body: some View {