I am porting an android music score application over to iOS, using swift and SwiftUI.
One of the elements of music notation is a glissando.
The form of this line can be seen here. - could not see how to add an image here.
When I draw the glissando in the android app, I can create a shape which represents a single "wave" of this line and then use it as a stamp which is repeated by the graphics system along the defined path, in this manner :
m_StampPath = new Path();
m_StampPath.moveTo(...);
m_StampPath.cubicTo(...);
m_StampPath.cubicTo(...);
...
m_StampPath.close();
m_WavyLine = new PathDashPathEffect(m_StampPath, fStampOffset, 0.0f, PathDashPathEffect.Style.MORPH);
// this is a Paint object
pt.setPathEffect(m_WavyLine);
pt.setStyle(Paint.Style.STROKE);
LinePath = new Path();
LinePath.moveTo(...);
LinePath.lineTo(...);
canvas.drawPath(LinePath, pt);
How can I achieve the same thing within swift, taking into account that the angle of the line is not always the same ?