Sample has OSBezierPath typealias to NSBezierPath and UIBezierPath. Implemented extensions to make OSBezierPath work similar/same on both platforms iOS and MacOS.
Also in this sample we have BezierPath class which is converting OSBezierPath into segments. Segments can be used to form shape.
Sample work on both iOS and MacOS.
Screenshot of example: