UITableViewやUICollectionViewのセクションはViewController内にenumとして定義しましょう。
セクション数の取得等に、count, arrayを定義しておくと非常に便利です。
enum Section : Int {
case Header
case Bill
case Payment
static let count:Int = {
return array.count
}()
static let array:[Section] = {
var sections = [] as [Section]
var i = 0
while(true){
if let s = Section(rawValue: i++){
sections.append(s)
}
else{
break
}
}
return sections
}()
}