dimanche 26 avril 2015

iOS swift - how to draw an ellipse with touch event


currently I am trying to port my old windows phone app to iphone. The UI looks like this:

enter image description here

I want to know how to do the following:

  1. Draw a solid ellipse on a specific position, e.g. at position x = 0, y = 0;
  2. The ellipse change its color upon touch;
  3. Touch another position on screen, the ellipse animated to move to the specific position.

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!


Aucun commentaire:

Enregistrer un commentaire