views:

71

answers:

3

Hello

I wrote the code of a card game .. but now it's time todo the graphic and Interface

What's the best approach to represent a card ??

a) CALayer b) UIView c) UIButton

Which one is best to animate and receive user touches??? What do you recommend??

Thanks in advance

+1  A: 

A UIView subclass would probably be your best choice. You can easily receive touch events from the user, and UIView allows you to do simple animations easily.

agentbanks217
+1  A: 

as UIButton is subclass of UIView, there's no so much difference in both of them. If you need only 'clicks' handling, you can choose button, if you will need to override touchesBegan/touchesMoved you should override UIView instead UIButton.

tt.Kilew
+1  A: 

GeekGameBoard is older Apple-provided example code for card and board games that implements the UI in CALayers. Another user modified it to run on the iPhone so it might be helpful code for you to look at. The modified project is on bitbucket.

Nick