Parallelogram view using UIBezierPath
I am trying to create custom parallelogram view using UIBezierPath but not getting a perfect one. Following is my custom view code class CustomView: UIView { override func draw(_ rect: CGRect) { let offset = 60.0; let path = UIBezierPath() path.move(to: CGPoint(x: self.frame.origin.x + CGFloat(offset), y: self.frame.origin.y)) path.addLine(to: CGPoint(x: self.frame.width + self.frame.origin.x , y: self.frame.origin.y)) path.addLine(to: CGPoint(x: self.frame.origin.x + self.frame.width - CGFloat(offset) , y: self.frame.origin.y + self.frame.height)) path.addLine(to: CGPoint(x: self.frame.origin