Search code examples
objective-csnapchat

How to draw colors over a UIImage


I was wondering how you draw colors over a UIImage in objective-c? The same way that snapchat does it.

I want to make a button that enables the painting with a scroll bar to change the color.

Does anyone know the way that snapchat implements the paint feature?


Solution

  • There's no out-of-the-box way to do this. You'll want to (a) track touch positions over time, and (b) draw them on the screen in a user-selected colour.

    There are open-source implementations of this idea, for example https://bitbucket.org/nwoolls/simpledrawing/wiki/Home

    Also a bunch of color-picker components here: https://maniacdev.com/2011/11/open-source-ios-color-picker-components-roundup