title: Override init method of UIView in swift
body: <pre><code>class CustomView: UIView {
  
      var subViewColor:UIColor
      var subViewMessage:String
  
      override init(frame:CGRect) {
          super.init(frame:frame)
      }
  
      init(subViewColor:UIColor,subViewMessage:String){
  
          self.subViewColor = subViewColor
          self.subViewMessage = subViewMessage
          super.init()
  
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
  }
  </code></pre>
  
  <p>I have a class where I want the user to initialize a custom view either by giving properties like:</p>
  
  <pre><code>let myView = CustomLoadingView(initialize properties here)
  </code></pre>
  
  <p>If the user does not want to initialize their own properties, I want to initialize <code>CustomLoadingView</code> using default properties...</p>
  
  <pre><code>let myView = CustomLoadingView() // this should initialize using default value
  </code></pre>
  
  <p>However, with this, I am getting this error:</p>
  
  <blockquote>
    <p>Must call a designated intializer of the superclass UIView</p>
  </blockquote>