4 Replies
      Latest reply on Oct 24, 2019 12:06 AM by limtc
      limtc Level 1 Level 1 (0 points)

        In an app ported to Mac Catalyst, the camera interface always turned out to be blank.

        I have checked: the capabilities includes "Camera", the privacy setting in info.plist is there (the iPad app shows the camera fine), and I even try to include front camera for UIImagePickerController.

            if UIImagePickerController.isSourceTypeAvailable(.camera) { 
              let imagePicker = UIImagePickerController()
              imagePicker.sourceType = .camera
              imagePicker.delegate = self
              imagePicker.cameraDevice = .front // added for Mac

              self.present(imagePicker, animated:true, completion:nil)
            }

        The error I got is: "[Generic] Could not create video device input: Error Domain=AVFoundationErrorDomain Code=-11814"

        • Re: Using camera with Mac Catalyst
          RickMaddy Level 1 Level 1 (0 points)

          I have no trouble taking a picture using the camera using UIImagePickerController when running my iPad app on a Mac. My code doesn't attempt to set anything on the image picker except the delegate and the sourceType (camera).

           

          Did you check if your app is enable in the privacy settings? Run the System Preferences app on the Mac. Go to Security & Privacy. Then click on the Privacy tab. Select Camera on the left. Is your app showing and enabled?