translated arrow-drawing example into Swift