let actionSheet = UIAlertController(title: "上传头像", message: nil, preferredStyle: .ActionSheet)
let cancelBtn = UIAlertAction(title: "取消", style: .Cancel, handler: nil)
let takePhotos = UIAlertAction(title: "拍照", style: .Destructive, handler: {
(action: UIAlertAction) -> Void in
//判断是否能进行拍照,可以的话打开相机
if UIImagePickerController.isSourceTypeAvailable(.Camera) {
let picker = UIImagePickerController()
picker.sourceType = .Camera
picker.delegate = self
picker.allowsEditing = true
self.presentViewController(picker, animated: true, completion: nil)
}