title: method does not override any method from its superclass Xcode 8
body: <p>I'm having the error "method does not override any method from its superclass" in XCode 8 when I tried to set Gradient in custom view file.
  The code is</p>
  
  <pre><code>override class func layerClass() -&gt; AnyClass {
      return CAGradientLayer.self
  }
  </code></pre>
  
  <p>when I remove the override, this error occur
  "Method 'layerClass()' with Objective-C selector 'layerClass' conflicts with getter for 'layerClass' from superclass 'UIView' with the same Objective-C selector"</p>
  
  <p>Full Code is here :</p>
  
  <pre><code>import UIKit
  
  @IBDesignable
  
  class CustomView: UIView {
  
  override class func layerClass() -&gt; AnyClass {
      return CAGradientLayer.self
  }
  
  var gradientLayer: CAGradientLayer {
      return layer as! CAGradientLayer
  }
  
  override func draw(_ rect: CGRect) {
      // Drawing code
      layer.masksToBounds = true
      layer.borderWidth = 10.0
      layer.borderColor = UIColor(red: 0.0, green: 64/225.0, blue: 128/225.0, alpha: 1.0).cgColor
      layer.cornerRadius = 20.0
  
      let startColor = UIColor(red: 102/225.0, green: 204/225.0, blue: 1.0, alpha: 1.0).cgColor
      let endColor = UIColor(red: 0.0, green: 128/225.0, blue: 1.0, alpha: 1.0).cgColor
      gradientLayer.colors = [startColor,endColor]
  }
  }
  </code></pre>
  
  <p>I'm new to iOS plz help me</p>