Skip to content

Instantly share code, notes, and snippets.

View vanbungkring's full-sized avatar
🐴
Monkey coder

Arie vanbungkring

🐴
Monkey coder
View GitHub Profile
@vanbungkring
vanbungkring / gist:3863732
Created October 10, 2012 07:29 — forked from robin/gist:62684
round corner uiimage
#import "ImageManipulator.h"
@implementation ImageManipulator
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight)
{
float fw, fh;
if (ovalWidth == 0 || ovalHeight == 0) {
CGContextAddRect(context, rect);
return;
//Draw the shadow for center component
CGContextSetFillColorWithColor( ctx, [UIColor colorWithWhite:.1 alpha:.4].CGColor );
CGContextFillEllipseInRect( ctx, CGRectInset(self.bounds, CENTER_INSET-4, CENTER_INSET-4) );
//Draw center transparent mask
CGContextSetFillColorWithColor( ctx, [UIColor clearColor].CGColor );
CGContextSetBlendMode(ctx, kCGBlendModeClear);
CGContextFillEllipseInRect( ctx, CGRectInset(self.bounds, CENTER_INSET, CENTER_INSET) );
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//.. do other setup
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
// Transition neatly from splash screen
// Very odd, on iPhone 5 you need to position the splash screen differently..
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Put necessary initialization steps here...
// Add imageView overlay with fade out and zoom in animation
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.window.frame];
imageView.image = [UIImage imageNamed:@"Default"]; // assuming your splash image is "Default.png" or "[email protected]"
[self.window addSubview:imageView];
[self.window bringSubviewToFront:imageView];
[UIView transitionWithView:self.window

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer

# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/github.com/user
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin