Reputation: 4491
currently I am trying to port my old windows phone app to iphone. The UI looks like this:
I want to know how to do the following:
I tried several tutorial on how to override drawRect in UIView, but couldn't get it work, can anyone help provide a simple sample?
Thanks a lot!
Edit: Any sample code is highly appreciated. There aren't much swift code on the internet and samples are not easy to find...
Upvotes: 1
Views: 739
Reputation: 5998
Animating inside a drawRect is never recommended. Why not just put an UIView on the place where you want it and animate the coordinates of that view?
The UIView could be a custom view responding to touch and then triggering the drawRect with a new color.
The parent view where you place these views on can respond to touches and move the ellipse view to the right position.
Upvotes: 1