iOS: Drawing just portions of a UImage
问题 I am trying to draw just a custom portion of a UIImage (i.e.: I would like to reveal the portion of the UIImage user touches) and I am having reasonable results by using mask property of the layer . Something like this on my UIView : UIBezierPath *maskPath = [UIBezierPath bezierPath]; [maskPath setLineWidth:10.0]; [maskPath moveToPoint:CGPointMake(10.0, 10.0)]; [maskPath addLineToPoint:CGPointMake(100.0, 100.0)]; CAShapeLayer *shapeMaskLayer = [CAShapeLayer layer]; shapeMaskLayer.path =