Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    You should externalize your context (define it at a higher level, perhaps as an ivar of your class) and re-use it on every touch. You wouldn't need recreating it over and over again. Commented Feb 25, 2014 at 10:20
  • Also, avoid calling UIGraphicsGetCurrentContext() so frequently. Just call it once and assign the result: CGContextRef ctx = UIGraphicsGetCurrentContext(); Commented Feb 25, 2014 at 10:21
  • 3
    Also, here you're re-adding drawImage on each frame. That might be a big performance hit. Commented Feb 25, 2014 at 10:22
  • could you tell me more in detail. Im pretty new to objective C. Commented Feb 25, 2014 at 10:23
  • "Also you are re-adding draw image for each frame" Yeah thats what i thought too. Commented Feb 25, 2014 at 10:24