Looking at the frames, it looks like a shallow quadratic curve moving along the path. What you could try is to define a range for the beginning and end of the curve, such as the beginning and end, and then add a breakpoint in the middle. Then just add straight lines at both ends. Something I quickly wrote:
CGFloat start; CGFloat end; CGFloat heightOfQuad; CGFloat mid = (start + end)/2; UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(start, 0)]; [path addQuadCurveToPoint:CGPointMake(end, 0) controlPoint:CGPointMake(mid, heightOfQuad)]; UIBezierPath *startPath = [UIBezierPath bezierPath]; [startPath moveToPoint:CGPointMake(0, 0)]; [startPath addLineToPoint:CGPointMake(start, 0)]; UIBezierPath *endPath = [UIBezierPath bezierPath]; [endPath moveToPoint:CGPointMake(end, 0)]; [endPath addLineToPoint:CGPointMake(lengthOfViewHere, 0)]; [startPath appendPath:path]; [startPath appendPath:endPath];
* I have not tested this yet, but you can give it go
UPDATE:
- (UIBezierPath *)wavePath { CGFloat mid = (self.start + self.end)/2; CGFloat y = self.frame.size.height; UIBezierPath *curvePath = [UIBezierPath bezierPath]; [curvePath moveToPoint:CGPointMake(self.start, y)]; [curvePath addQuadCurveToPoint:CGPointMake(self.end, y) controlPoint:CGPointMake(mid, y - waveHeight)]; UIBezierPath *startPath = [UIBezierPath bezierPath]; [startPath moveToPoint:CGPointMake(0, y)]; [startPath addLineToPoint:CGPointMake(self.start, y)]; UIBezierPath *endPath = [UIBezierPath bezierPath]; [endPath moveToPoint:CGPointMake(self.end, y)]; [endPath addLineToPoint:CGPointMake(self.frame.size.width, y)]; [startPath appendPath:curvePath]; [startPath appendPath:endPath]; return startPath; } - (void)setWavePosition:(CGFloat)wavePosition {
After playing some of them, the code above generates this with a position of 0.5, waveHeight at 5.0 and waveWidth 150.0 with a viewing width of 200.0: 
All you have to do is set wavePosition and then wavePath will return a new path.
David cao
source share