     func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
         var count = 0
         
-        for(var i = 0; i < appDelegate.selectedcell.count; i++){
+        for i in 0 ..< appDelegate.selectedcell.count{
             if(appDelegate.selectedcell[i] == true){
-                count++
+                count += 1
             }
         }
         return count

        let count = DBmethod().DBRecordCount(ShiftImportHistoryDB)-1
        
        if(DBmethod().DBRecordCount(ShiftImportHistoryDB) != 0){
            for(var i = 0; i <= count; i++){
                if(appDelegate.selectedcell[i]){
                    let historydate = DBmethod().ShiftImportHistoryDBGet()[count-i].date
                    let historyname = DBmethod().ShiftImportHistoryDBGet()[count-i].name

    //表示ボタンを押した時に呼ばれる関数
    @IBAction func TapShowButton(sender: AnyObject) {
        
        for i in 0 ..< selectedCells.count{
            if(selectedCells[i] == true){
                flag = true
                break
