title: My BeizerPath is above my labels. How can I make my labels appear above?
body: <p>I'm looking to make my dopePointlabel appear above my beizerPath. I created a custom shape and I want my label to appear above it. I tried z-index and that does not seem to work. In what way can I make my Beizer Path below my text so my text is viewable. Thank you in advance. </p>
  
  <pre><code>class DemoView: UIView {
  
      /*
      // Only override draw() if you perform custom drawing.
      // An empty implementation adversely affects performance during animation.
      override func draw(_ rect: CGRect) {
          // Drawing code
      }
      */
  
      var path: UIBezierPath!
  
      override init(frame: CGRect) {
          super.init(frame: frame)
  
          self.backgroundColor = UIColor.darkGray
  
      }
  
      required init?(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
      }
  
      func createRectangle() {
          path = UIBezierPath()
  
          path.move(to: CGPoint(x:0.0, y: 0.0))
  
          path.addLine(to: CGPoint(x: 0.0, y: 300.0))
  
          //path.addLine(to: CGPoint(x: self.frame.size.width, y: self.frame.size.height))
  
  
          //self.frame.size.height
          path.addCurve(to:CGPoint(x: self.frame.size.width, y: 300.0), controlPoint1:  CGPoint(x: self.frame.size.width/2, y: 400), controlPoint2:  CGPoint(x: self.frame.size.width/2, y: 400))
  
          path.addLine(to: CGPoint(x: self.frame.size.width, y: 0.0))
  
          path.close()
      }
  
      override func draw(_ rect: CGRect) {
          self.createRectangle()
  
          UIColor.orange.setFill()
          path.fill()
  
          UIColor.purple.setStroke()
          path.stroke()
  
  
      }
  }
  </code></pre>
  
  <p>view controller code below</p>
  
  <pre><code>let height: CGFloat = 400.0
  
                 let demoView = DemoView(frame: CGRect(x: 0,
                                                       y: self.view.frame.size.height/2 - height/2,
                                                       width: self.view.frame.size.width,
                                                       height: height))
              dopepointsNumberLabel.layer.zPosition = 1
                 self.view.addSubview(demoView)
  </code></pre>