Xcode - UITableView Issue
<p>I've met some kind of a problem when selecting a row.</p>

<p>Basically, whenever the user selects a row within the UITableViewController I want certain content to be displayed, predominantly text. I do have this working, to a degree. By using the following code:</p>

<pre><code>var varView = Int()
if (varView == 0){

    Label.text = "E110"

}

else {
    if (varView == 1){
    Label.text = "Veyron"

     }

    else {
        Label.text = "Error"
    }

}
</code></pre>

<p>This does work as mentioned. However, due to the fact I have headers to categorise products within my UITableViewController, it appears to "refresh" after each section header. </p>

<p>I have used arrays to populate my UITableViewController with both section headers and text to populate the UITableVC like so</p>

<pre><code>struct Brands {
    var sectionName : String!
    var sectionBrands : [String]!
}

var brandArray = [Brands]()


override func viewDidLoad() {


    brandArray = [


    Brands(sectionName: "Bugatti", sectionBrands: ["EB 110","Veyron"]),

    Brands(sectionName: "Cadillac", sectionBrands: ["Biarritz","BLS", "CTS", "Escalade", "SRX", "STS"]),
</code></pre>

<p>I have a LOT more than that! Haha. </p>

<p>However, due to the fact I have two rows under Buggati the Change Content Code works,but when selecting the first row under Cadillac, I get a return type of "E110", when selecting "BLS" I get a return of "Veyron" and every other row returns a value of "Error". I expected anything after the first to rows will return with "Error" but it appears to be "refreshing" the int count as mentioned.</p>

<p>This is the code I am using to return the value(s) which I desired depending on which row is selected:</p>

<pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    var DestVC = segue.destinationViewController as! ViewController

    var indexPath : NSIndexPath = self.tableView.indexPathForSelectedRow!


    DestVC.varView  = indexPath.row
}
</code></pre>

<p>Could anyone shed some light on how to resolve this matter? Or even use the name of the field to determine what is displayed as opposed to using an Integer? </p>

<p>Thank you. </p>

<p>P.S- I am using <code>SWRevealViewController</code>, which I don't think matters, but I believe it's worth mentioning. </p>