0

I have a UIView that should be contained many different circular elements (as subview or sublayer). Circular elements are just small shapes that are just filled circle with capability of taping on them and doing some actions. I can add them to the view as CAShapeLayer or UIView, but I have no idea which approach is better in terms of performance.

The elements should be animated when they are going to appear at the first time! afterwards they should recognize the tap gesture on them. Both UIView and CAShapeLayer or CALayer objects are capable of animation, but considering the count of these elements (which could be up to 30 items) and concurrence of animations, which approach do you suggest considering performance and reliability issue?

I've searched around a lot but the information was not enough to be able to make a certain decision.

Thanks in advance

Majid
  • 3,128
  • 1
  • 26
  • 31

1 Answers1

1

You are fine with UIViews. For the tap gestures you will need them. There should not be any significant performance differences (if any) between the two approaches.

Mundi
  • 79,884
  • 17
  • 117
  • 140
  • Thanks for your answer. You mean tap gesture is not implementable for CALayer?! I heard CALayer is more lightweight than UIViews, so what if the elements count increase? do you suggest UIViews in that case? – Majid Aug 05 '15 at 12:30
  • 1
    It doesn't make difference : This answer better explained in here: http://stackoverflow.com/questions/7826306/what-are-the-differences-between-a-uiview-and-a-calayer – Teja Nandamuri Aug 05 '15 at 12:51
  • @T_77 Thank you for your reply. The answer in that link was very useful. – Majid Aug 05 '15 at 13:05