title: Array of Objects - Swift
body: <p>I want to create an arrray of objects I have created. I will include and example of the object. However, every time I try, I get the error: "Expected Declaration". I was also getting an error that the array was unidentified. Is this because I have to mention the class somewhere in the array?</p>
  
  <pre><code>class ShapeColour : NSObject {
      var colour:String
      var shape:String
      var image:UIImage
  
      init(color: String, shape: String, image: UIImage) {
          self.colour = color
          self.shape = shape
          self.image = image
      }
  
  }
  </code></pre>
  
  <p>above is the class, Below is an exmaple</p>
  
  <pre><code> let redTriangleObject = ShapeColour(color: "red", shape: "triangle", image: UIImage(named: "redTriangle.png")!)
  </code></pre>
  
  <p>Bellow is the array</p>
  
  <pre><code>mainShapeDict = [blueSquareObject,blueCircleObject,blueTriangleObject,redSquareObject,redCircleObject,redTriangleObject,yellowSquareObject,yellowCircleObject,yellowTriangleObject]
  </code></pre>
  
  <p>Thanks!</p>