title: how to declare UIView globally in swift?
body: <p>Unable to create View globally. My code is :</p>
  
  <pre><code> required init(coder aDecoder: NSCoder)
   {
      fatalError("init(coder:) has not been implemented")
   }   
  
   // CODING
   class ViewController: UIViewController { 
  
      //Unable to create View globally, kindly help me,, 
      //Error coming like this
  
      required init(coder aDecoder: NSCoder) 
      {
         fatalError("init(coder:) has not been implemented")
      }   
  
      var view11:UIView
      var img_view11:UIImageView
      .
      .
      .
  
      @IBAction func long(sender: UILongPressGestureRecognizer) 
      {
          var data1: NSData = UIImagePNGRepresentation(img.image)
          view11 = UIView(frame: CGRect(x: 25, y: 0, width: 300, height: 200))
          img_view11 = UIImageView(frame: CGRect(x: 0, y: 0, width: 300, height: 200))
          img_view11.image = UIImage(data: data1)
          view11.addSubview(img_view11)
          self.vw.addSubview(view11)
      }
   }
  </code></pre>
  
  <p>If we erase that "required" line, we get this error:</p>
  
  <p><code>"fix-it Insert \n required initializer.</code>"</p>
  
  <p>after that, if we run, then the thread error is thrown.</p>