Matt Coneybeare


Adding and Saving a Border Around a UIImage With Core Graphics

| Comments

I recently had to place a border around an image of unknown size and save it back as an image. Here is how:

Start with a UIImage:

Run it through this method:

You will get back a UIImage with a border. Simple.

Obviously, you will need to adjust the border percentage and color for your own application.


My name is Matt Coneybeare, I design and develop for iOS (iPhone, iPad and iPod Touch), Mac OS X and the Web out of New York. In 2008 I started a software company called Urban Apps that has made some pretty popular apps such as Ambiance and Hourly News. My current Stack Overflow reputation is about 27k.

I was a Rockstar a decade ago, but then went back to school and collected a Bachelor's Degree in Computer Science from U.C. Berkeley. Now I am settled down with my beautiful wife Di and our dog Hamachi. When not at my desk, I love exploring New York City as a Yelp Elite, or training for marathons.

Contact information

Matt Coneybeare