(void)drawRect:(CGRect)rect{
// 1.获取上下文
CGContextRef ctx = UIGraphicsGetCurrentContext();// 注意:上下文矩阵操作一定放在你的路径之前
// 平移上下文
CGContextTranslateCTM(ctx, 50, 100);
// 旋转上下文
CGContextRotateCTM(ctx, M_PI_4);
// 缩放上下文
CGContextScaleCTM(ctx, 0.5, 1.2);// 2.拼接路径
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(-50, -100, 150, 200)];
// 3.把路径添加到上下文
CGContextAddPath(ctx, path.CGPath);
[[UIColor yellowColor] set];
// 4.渲染
CGContextFillPath(ctx);
}