     //選択時
     func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
         
-        if(pickerView.tag == 1){
+        if(pickerView.tag == 1){            //取り込んだシフト
             SaralyLabel.text = String(DBmethod().ShiftDBSaralyGet(DBmethod().DBRecordCount(ShiftDB)-1-row))
-        }else if(pickerView.tag == 2){
+            
+        }else if(pickerView.tag == 2){      //シフトグループ選択
             shiftgroupnametextfield.text = shiftgroupname[row]
             pickerdoneButton.tag = 2
-        }else if(pickerView.tag == 3){
+            shiftgroupselectrow = row
+            
+        }else if(pickerView.tag == 3){      //シフト時間選択
             
             if(component == 0){
                 starttime = time[row]
+                shiftstarttimeselectrow = row
             }else if(component == 2){
                 endtime = time[row]
+                shiftendtimeselectrow = row
             }
             pickerdoneButton.tag = 3
             

    override func viewDidLoad() {
        super.viewDidLoad()
        
        shiftgroupnameUIPicker.frame = CGRectMake(0,0,self.view.bounds.width/2+20, 200.0)
        shiftgroupnameUIPicker.delegate = self
        shiftgroupnameUIPicker.dataSource = self
        shiftgroupnameUIPicker.tag = 2
        
        shifttimeUIPicker.frame = CGRectMake(0,0,self.view.bounds.width/2+20, 200.0)
        shifttimeUIPicker.delegate = self
        shifttimeUIPicker.dataSource = self
        shifttimeUIPicker.tag = 3
        
        pickerviewtoolBar.barStyle = UIBarStyle.Default
        pickerviewtoolBar.translucent = true
        pickerviewtoolBar.tintColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0)

            
            //シフト名,シフトグループ名の場所にカーソルがある時はボタンを有効にする
            switch(textField.tag){
            case 0:
                return true
            default:
                return false
