 
 extension EditProfileViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
     func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
-        s3PublicUploadParams(failureHandler: nil) { s3UploadParams in
+
+        YepHUD.showActivityIndicator()
+
+        s3PublicUploadParams(failureHandler: { (reason, errorMessage) in
+            defaultFailureHandler(reason, errorMessage)
+
+            YepHUD.hideActivityIndicator()
+
+        }, completion: { s3UploadParams in
 
             let image = image.largestCenteredSquareImage().resizeToTargetSize(YepConfig.avatarMaxSize())
 
             var imageData = UIImageJPEGRepresentation(image, YepConfig.avatarCompressionQuality())
 
-            // TODO: 等待的菊花
-            uploadFileToS3(inFilePath: nil, orFileData: imageData, mimeType: "image/jpeg", s3UploadParams: s3UploadParams, completion: { (result, error) in
-                println("upload avatar to s3 result: \(result), error: \(error)")
-
-                if (result) {
+            uploadFileToS3(inFilePath: nil, orFileData: imageData, mimeType: "image/jpeg", s3UploadParams: s3UploadParams, completion: { (success, error) in
+                println("upload avatar to s3 result: \(success), error: \(error)")
+
+                if (success) {
                     let newAvatarURLString = "\(s3UploadParams.url)\(s3UploadParams.key)"
 
-                    updateMyselfWithInfo(["avatar_url": newAvatarURLString], failureHandler: nil) { success in
+                    updateMyselfWithInfo(["avatar_url": newAvatarURLString], failureHandler: { (reason, errorMessage) in
+                        defaultFailureHandler(reason, errorMessage)
+                        
+                        YepHUD.hideActivityIndicator()
+
+                    }, completion: { success in
                         dispatch_async(dispatch_get_main_queue()) {
                             YepUserDefaults.setAvatarURLString(newAvatarURLString)
 
-                            self.updateAvatar()
+                            self.updateAvatar() {
+                                YepHUD.hideActivityIndicator()
+                            }
 
                             if
                                 let myUserID = YepUserDefaults.userID(),


                            NSNotificationCenter.defaultCenter().postNotificationName(YepUpdatedProfileAvatarNotification, object: nil)
                        }
                    }
                }
            })
        }
        
        dismissViewControllerAnimated(true, completion: nil)
    }

    }

    @IBAction func changeAvatar(sender: UITapGestureRecognizer) {

        let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)

