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 the web, iOS (iPhone, iPad and iPod Touch), and MacOS out of New York City. In 2008 I started a software company called Urban Apps that has made some pretty popular apps such as Ambiance and Hourly News. In 2019, I joined the team at Ticket Evolution as a Senior Software Engineer. 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 and a MBA from Quantic. 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