tapptitude / TTFortuneWheel-iOS

Fortune spinning wheel that supports custom drawing.
MIT License
132 stars 41 forks source link

How can I change titles of Wheel with new titles after completed the spin? #6

Closed GokmenAkar closed 6 years ago

EfraimB commented 6 years ago

If you want to change the titles on the Wheel you may trigger a redraw by calling setNeedDisplay on your wheel. So basically you will want to do something like this:

self.spinningWheel.startAnimating(fininshIndex: 5) { (finished) in
                let slices = [ CarnivalWheelSlice.init(title: "New title"),
                               CarnivalWheelSlice.init(title: "New title"),
                               CarnivalWheelSlice.init(title: "Test")]
                self.spinningWheel.slices = slices
                self.spinningWheel.setNeedsDisplay()
}