Let's imagine you need to add a dashed border to a view. Normally, you would write code like that. First iteration private func addUglyDashedBorder() { borderLayer = CAShapeLayer() let viewRect = CGRect(x: 0, y: 0, width: frame.size.width, he...