How to draw a line of shapes in swift

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 ?

In SwiftUI...

You can draw in a View, using a Path

Path has methods (that you should find familiar) like:

move(to:)
addLine(to:)
addCurve(to:control1:control2:)

To get the rotation, you could then use the View modifier:

rotationEffect(_:anchor:)

You could draw this over another view using a ZStack, or by using the "overlay" View modifier

@robnotyou, I am sorry that you felt I was being rude, that was not my intention. I can already create the stamp in swift, that's not a problem - its using it to create a continuous "line" of stamps. @OOPer, my question stated that I am using swift a couple of times and I gave the equivalent code in java to illustrate my need - thought that was sufficient info.

How to draw a line of shapes in swift
 
 
Q