 
 class DynamicTableViewController: UITableViewController {
     var count = 0;
+    let listSectionTitle:String = "ALL LIST";
     var items:Array<Dictionary<String,String>> = [
         [
             "name":"Wao1"

        count++;
        
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

        return items.count;
    }
    
    //headerのスタイルを上書き
    override func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        var screenW = UIScreen.mainScreen().bounds.size.width
        let view:UIView = UIView();
        view.backgroundColor = UIColor.grayColor();
        
        view.frame.size.width = screenW;
        
        let label = UILabel();
        label.frame.origin.x = 15;
        label.frame.origin.y = 2;
        label.font = UIFont.systemFontOfSize(15.0);
        label.textColor = UIColor.whiteColor();
        label.text = listSectionTitle;
        label.sizeToFit();
        view.addSubview(label);
        view.frame.size.height = label.frame.size.height;
        
        return view;
    }
    
    //headerの名前
    override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        return listSectionTitle;
    }
    
    
    
    //編集時にセルを移動する
    override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
        return true;
    }
    
    override func tableView(tableView: UITableView, moveRowAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath) {
        tableView.moveRowAtIndexPath(sourceIndexPath, toIndexPath:destinationIndexPath);
        
        var itemToMove = self.items[sourceIndexPath.row];
        self.items.removeAtIndex(sourceIndexPath.row);
        self.items.insert(itemToMove, atIndex: destinationIndexPath.row);
        
    }

    
