1

I draw 2 custom and view, and want to implement them into my page controller instead of standard dots, how can I so this?

Here is my custom views

class CustomPageControlViewMain: UIView {
    override func draw(_ rect: CGRect) {
        super.draw(rect)
        let path = UIBezierPath(ovalIn: rect)
        UIColor.init(displayP3Red: 243/255, green: 114/255, blue: 30/255, alpha: 1).setFill()
        path.fill()
    }
}

class CustomPageControlViewOther: UIView {
    override func draw(_ rect: CGRect) {
        super.draw(rect)
        let rect = CGRect(x: rect.origin.x + rect.width * 0.1, y: rect.origin.y + rect.height * 0.1, width: rect.width * 0.8, height: rect.height * 0.8)
        let path = UIBezierPath(ovalIn: rect)
        UIColor.init(displayP3Red: 243/255, green: 114/255, blue: 30/255, alpha: 1).setFill()
        path.fill()

        let rect2 = CGRect(x: rect.origin.x + rect.width * 0.05, y: rect.origin.y + rect.height * 0.05, width: rect.width * 0.9, height: rect.height * 0.9)
        let path2 = UIBezierPath(ovalIn: rect2)
        UIColor.white.setFill()
        path2.fill()

    }
}
  • Check following: https://stackoverflow.com/questions/47279137/custom-pagecontrol-image-swift – Bhavik Modi May 10 '19 at 12:48
  • Possible duplicate of [Custom UIPageControl with dot images](https://stackoverflow.com/questions/38869171/custom-uipagecontrol-with-dot-images) – zero3nna May 10 '19 at 12:51

0 Answers0