From 13c8efeeb6bc309fce911391d2f16384c30fde86 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Fri, 26 Jun 2015 19:24:11 +0800 Subject: [PATCH] not need prompt before do PHPhotoLibrary.requestAuthorization --- .../RegisterPickAvatarViewController.swift | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift b/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift index 2be88eb2..80361917 100644 --- a/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift +++ b/Yep/ViewControllers/Register/RegisterPickAvatarViewController.swift @@ -220,22 +220,18 @@ class RegisterPickAvatarViewController: UIViewController { openCameraRoll() case .NotDetermined: - YepAlert.confirmOrCancel(title: NSLocalizedString("Notice", comment: ""), message: NSLocalizedString("Yep need to access your Camera Roll to pick avatar.", comment: ""), confirmTitle: NSLocalizedString("OK", comment: ""), cancelTitle: NSLocalizedString("Not now", comment: ""), inViewController: self, withConfirmAction: { - PHPhotoLibrary.requestAuthorization { status in + PHPhotoLibrary.requestAuthorization { status in - switch status { + switch status { - case .Authorized: - self.openCameraRoll() + case .Authorized: + self.openCameraRoll() - default: - self.alertCanNotAccessCameraRoll() - } + default: + self.alertCanNotAccessCameraRoll() } - - }, cancelAction: { - }) + } default: alertCanNotAccessCameraRoll()