I am designing one of the screen which has quite complex UI.
The UIView has dashed-line in middle with arc on right and left side.
Please check below picture for better understanding.
Can anyone guide me how to achieve such design in iOS?
I am designing one of the screen which has quite complex UI.
The UIView has dashed-line in middle with arc on right and left side.
Please check below picture for better understanding.
Can anyone guide me how to achieve such design in iOS?
Use this code to create a dashed line with custom parameters:
let path = UIBezierPath()
let point1 = CGPointMake(CGRectGetMinX(self.bounds),CGRectGetMidY(self.bounds))
path.moveToPoint(point1)
let point2 = CGPointMake(CGRectGetMaxX(self.bounds),CGRectGetMidY(self.bounds))
path.addLineToPoint(point2)
let dashes: [CGFloat] = [12.0, 24.0]
path.setLineDash(dashes, count: dashes.count, phase: 0.0)
path.lineWidth = 10.0
path.lineCapStyle = .Butt
UIColor.greenColor().set()
path.stroke()
For framing just use a rectangle and a circle (you'll get an arc).