этот кусок кода не будет работать, я не знаю почему.
просто создайте переход и обрежьте, затем нарисуйте градиент
// create contect and save
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
// create path
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, 20, rect.size.height - 20);
CGPathAddLineToPoint(path, NULL, rect.size.width / 2, 20);
CGPathAddLineToPoint(path, NULL, rect.size.width - 20, rect.size.height - 20);
CGPathCloseSubpath(path);
CGContextAddPath(context, path);
CGContextClip(context);
// create gradient
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
NSArray *colorArr = @[
(id)[UIColor blackColor],
(id)[UIColor whiteColor],
];
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef) colorArr, NULL);
// rlease gradinet
CGContextDrawLinearGradient(context, gradient, CGPointMake(rect.size.width / 2,rect.size.height - 20), CGPointMake(rect.size.width / 2, 20), 0);
// restore context
CGContextRestoreGState(context);