Q:

will create a view in code, how to delcare it in Swift 1.2

I have to fix another developer's code by adding a dimmedView. I'd like to create this all in code. I understand the ! for an optional value but how would I declare the following view. It doesn't seem like I would need to initialize it but the compiler wants it initialized. How would I deal with this? 
class EKViewController: UIViewController, UITableViewDataSource, UITableViewDelegate  {

  @IBOutlet weak var mainTV: UITableView!
  var dimmedView:UIView

....

  func renderOverlayNav(){
    println("YYY about to render outlay")
    self.dimmedView=UIView(frame: CGRectMake(0.0, 0.0, self.screenWidth, self.screenHeight))

A:

You must initialize all properties in Swift in your init. To get around this you can make the dimmedView an optional which will set it's value to nil or you can initialize it like so var dimmedView = UIView()

