просочившееся окно com.android.internal.policy.PhoneWindow $ DecorView {1b2f456 V.E & hellip; R & hellip; D 0,0-684,232}, который был первоначально добавлен здесь [дубликат]

Я исправил эту проблему, вызвав функцию ниже в viewdidload или viewWillAppear или viewDidAppear, чтобы проверить разрешение для вашего приложения.

func checkPermission() {
        let photoAuthorizationStatus = PHPhotoLibrary.authorizationStatus()
        switch photoAuthorizationStatus {
        case .authorized:
            print("Access is granted by user")
        case .notDetermined:
            PHPhotoLibrary.requestAuthorization({
                (newStatus) in
                print("status is \(newStatus)")
                if newStatus ==  PHAuthorizationStatus.authorized {
                    /* do stuff here */
                    print("success")
                }
            })
            print("It is not determined until now")
        case .restricted:
            // same same
            print("User do not have access to photo album.")
        case .denied:
            // same same
            print("User has denied the permission.")
        }
    }
968
задан MiguelHincapieC 17 September 2015 в 16:38
поделиться