title: Cannot use instance member within property initializer
body: <p>I have written a custom <code>UIView</code> and I found a strange problem. I think this is related to a very fundamental concept but I just do not understand it, sigh.....</p>
  
  <pre><code>class ArrowView: UIView {
  
      override func draw(_ rect: CGRect) {
  
          let arrowPath = UIBezierPath.bezierPathWithArrowFromPoint(startPoint: CGPoint(x:bounds.size.width/2,y:bounds.size.height/3), endPoint: CGPoint(x:bounds.size.width/2, y:bounds.size.height/3*2), tailWidth: 8, headWidth: 24, headLength: 18)
  
          let fillColor = UIColor(red: 0.00, green: 0.59, blue: 1.0, alpha: 1.0)
          fillColor.setFill()
          arrowPath.fill()
      }
  }
  </code></pre>
  
  <p>this code works fine but if I have grabbed this line out of the override draw function it does not compile. The error says I can not use the bounds property.</p>
  
  <pre><code>let arrowPath = UIBezierPath.bezierPathWithArrowFromPoint(startPoint: CGPoint(x:bounds.size.width/2,y:bounds.size.height/3), endPoint: CGPoint(x:bounds.size.width/2, y:bounds.size.height/3*2), tailWidth: 8, headWidth: 24, headLength: 18)
  </code></pre>
  
  <blockquote>
    <p>Cannot use instance member 'bounds' within property initializer; property initializers run before 'self' is available</p>
  </blockquote>
  
  <p>I don not understand why I cannot use this bounds out of the func draw</p>