I'm not sure I'm doing the best design here…

I'm coding an app where I have categories of chapters nesting chapters. All the values will be hardcoded. For exemple :

```
struct Chapter1 {
    struct Category1{
        let name = "#1"
        let content = "Lorem Ipsum"
    }

    struct Category2{
        let name = "#2"
        let content = "Lorem Ipsum Ipsum"
    }

    struct Category3{
        let name = "#3"
        let content = "Ipsum Lorem Ipsum"
    }
}

```

Now the problem is, I want to return the number of Category in a numberOfSectionsInTableView. How can I count those? Is there a way? Or maybe my design isn't the right one? 

And then, I'll need to pass the struct name through a segue… Is it possible? 

For the moment, the solution I found is very inelegant. In the Chapter1 struct, I put an array with "Category1", "Category2", etc… It's not optimum! And I didn't found a solution to do that :

```
var x = "Category1"
var nameOfTheSelectedCategory = Chapter1.x.name

```

Don't even know if it's possible but it may be a solution... I also tried with a switch but I've got the same issue…

Thanks!