I am new to Swift and having fits with the UIView class. I have a TableView (below) with a View object (left) and Label (right). The table itself works fine and the labels appear as expected. 

![TableView with custom cell](https://i.stack.imgur.com/pjvXA.png)

Where I am having trouble is that I want the View object next to the label to contain various shapes and colors depending on the values in the array that support the table...

```
var tArray = [["Row 1","Row 2", "Row 3", "Row 4", "Row 5"],
              ["Circle","Circle","Square","Square","Diamond"],
              ["Blue","Red","Green","Red","Purple"]]

```

So next to "Row 1", I want to have a blue circle, etc. I have linked the View object to a custom class. But I need an approach to dynamically create the shapes and fill with appropriate colors.

In the TableViewController, I have the following, which is calling the Symbol class, and I am getting back a black circle (I hard-coded circle for now)...

```
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)

    cell.cellLabel.text = tArray[0][indexPath.row]
    cell.cellSymbol = Symbol.init()
    return cell
}

```

In my custom Symbol class:

```
import UIKit

class Symbol: UIView {

var inColor: String
var inShape: String

init (in_color: String, in_shape: String) {

    self.inColor = in_color
    self.inShape = in_shape

    super.init(frame: CGRect(x: 0, y: 0, width: 70, height: 70))

}

override func drawRect(rect: CGRect) {

    let path = UIBezierPath(ovalInRect: rect)

    switch self.inColor {
    case "Green" : UIColor.greenColor().setFill()
    case "Blue" : UIColor.blueColor().setFill()
    case "Yellow" : UIColor.yellowColor().setFill()
    case "Cyan" : UIColor.cyanColor().setFill()
    case "Red" : UIColor.redColor().setFill()
    case "Brown" : UIColor.brownColor().setFill()
    case "Orange" : UIColor.orangeColor().setFill()
    case "Purple" : UIColor.purpleColor().setFill()
    case "Grey" : UIColor.darkGrayColor().setFill()
    default: UIColor.blackColor().setFill()
    }

    path.fill()
}

required init?(coder aDecoder: NSCoder) {

    self.inColor = ""
    self.inShape = ""

    super.init(coder: aDecoder)

}

override init(frame: CGRect) {

    self.inColor = ""
    self.inShape = ""
    super.init(frame: frame)
}

```

}

I may be going about this all wrong and am open to other approaches entirely. In order to compile, I had to add the required init? and override init(frame: CGRect) entires. I also had to put in the initialization of the self.inColor and .inShape to compile, but since I'm not passing in the parameters to those, I have nothing to assign.

So what I get is a black circle every time. I hard-coded circle for now to keep it simple. The switch self.inColor is nil every time, so it is going down to the default case.

Any suggestions would be greatly appreciated!!!!