Skip to content

Instantly share code, notes, and snippets.

View ksm's full-sized avatar
🏔️

Karol S. Mazur ksm

🏔️
View GitHub Profile
@ksm
ksm / gist:1830844
Created February 14, 2012 21:55
CoreGraphics UITableView iOS5 bevel effect function
/*
Copied and pasted from Tim Oliver's blog.
Source: http://www.tim-oliver.com/2011/10/23/creating-the-uitableview-bevel-effect-in-coregraphics/
*/
void DrawInsetBeveledRoundedRect(CGContextRef context, CGRect rect, CGFloat radius, UIColor *fillColor) {
//contract the bounds of the rectangle in to account for the stroke
CGRect drawRect = CGRectInset(rect, 1.0f, 1.0f);
//contract the height by 1 to account for the white bevel at the bottom