Skip to content

Commit

Permalink
Update PodVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersyd committed Apr 7, 2021
1 parent 55675e2 commit bd103b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FortuneWheel.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 6 additions & 8 deletions Source/FortuneWheel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bd103b3

Please sign in to comment.