CALayer *layer = [myView layer]; layer.borderColor = [[UIColor grayColor] CGColor]; layer.borderWidth = 1.0f;