     
     // weightPicker configuration
     
+    func pickerView(pickerView: UIPickerView,
+        didSelectRow row: Int,
+        inComponent component: Int) {
+            
+            let alertController = UIAlertController(title: "Confirmation", message: "Confirm weight change?", preferredStyle: .Alert)
+    
+            let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
+                //restore current weight
+                self.setWeightInUI(self.userWeight, animation:true)
+            }
+            alertController.addAction(cancelAction)
+            
+            let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in
+                println(row)
+                var newWeight = self.kgArray[row].toInt()
+                self.saveUserWeight(Double(newWeight!))
+            }
+            alertController.addAction(OKAction)
+            
+            self.presentViewController(alertController, animated: true) {
+                
+            }
+}
+
     func numberOfComponentsInPickerView(pickerView: UIPickerView!) -> Int {
         return 1
     }

//        self.selectUserWeight()
        self.stepCounter = StepCounter(healthStore: healthStore, delegate: self);
      
      healthStore.requestAuthorizationToShareTypes(nil, readTypes: dataTypesToRead(), completion: {
        (success:Bool, error:NSError!) -> Void in
        //      if !success{
        //        var alert = UIAlertView(title: "Missed authorization", message: "The app cannot work without authorization for HealthKit. Closing", delegate: nil, cancelButtonTitle: nil, otherButtonTitles: "Close")

        }
        return pos
    }

  
    /*
