I'm trying to have a video/camera view in the background while I also allow for haptic feedback in my app for various actions, but it seems that AVFoundation is not playing nice with any of the calls I am making that involve the haptic calls:
if #available(iOS 10.0, *) {
let generator = UIImpactFeedbackGenerator(style: .light)
generator.prepare()
generator.impactOccurred()
// More:
let feedbackGenerator = UISelectionFeedbackGenerator()
feedbackGenerator.selectionChanged()
}
Haptic feedback works great and as expected as long as the AVFoundation stuff is commented out. Any ideas?
Using:
captureSession = AVCaptureSession()
AND:
previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)