From 236e324ef10631e804d6f00049a3fcd58d73bd07 Mon Sep 17 00:00:00 2001 From: Nora Trapp Date: Wed, 30 Oct 2019 14:41:32 -0700 Subject: [PATCH] Fix attachment keyboard --- .../AttachmentFormatPickerView.swift | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Signal/src/ViewControllers/Attachment Keyboard/AttachmentFormatPickerView.swift b/Signal/src/ViewControllers/Attachment Keyboard/AttachmentFormatPickerView.swift index 2829d0708b..9fddfd5da2 100644 --- a/Signal/src/ViewControllers/Attachment Keyboard/AttachmentFormatPickerView.swift +++ b/Signal/src/ViewControllers/Attachment Keyboard/AttachmentFormatPickerView.swift @@ -52,6 +52,7 @@ class AttachmentFormatPickerView: UICollectionView { guard photoCapture == nil else { return } let photoCapture = PhotoCapture() + photoCapture.delegate = self self.photoCapture = photoCapture photoCapture.startVideoCapture().done { [weak self] in @@ -111,6 +112,58 @@ extension AttachmentFormatPickerView: UICollectionViewDelegate { } } +extension AttachmentFormatPickerView: PhotoCaptureDelegate { + func photoCaptureDidStartPhotoCapture(_ photoCapture: PhotoCapture) { + owsFailDebug("\(#function) should never be called") + } + + func photoCapture(_ photoCapture: PhotoCapture, didFinishProcessingAttachment attachment: SignalAttachment) { + owsFailDebug("\(#function) should never be called") + } + + func photoCapture(_ photoCapture: PhotoCapture, processingDidError error: Error) { + owsFailDebug("\(#function) should never be called") + } + + func photoCaptureDidBeginVideo(_ photoCapture: PhotoCapture) { + owsFailDebug("\(#function) should never be called") + } + + func photoCaptureDidCompleteVideo(_ photoCapture: PhotoCapture) { + owsFailDebug("\(#function) should never be called") + } + + func photoCaptureDidCancelVideo(_ photoCapture: PhotoCapture) { + owsFailDebug("\(#function) should never be called") + } + + func photoCaptureCanCaptureMoreItems(_ photoCapture: PhotoCapture) -> Bool { + owsFailDebug("\(#function) should never be called") + return false + } + + func photoCaptureDidTryToCaptureTooMany(_ photoCapture: PhotoCapture) { + owsFailDebug("\(#function) should never be called") + } + + var zoomScaleReferenceHeight: CGFloat? { + owsFailDebug("\(#function) should never be called") + return nil + } + + var captureOrientation: AVCaptureVideoOrientation { + return AVCaptureVideoOrientation(interfaceOrientation: CurrentAppContext().interfaceOrientation) ?? .portrait + } + + func beginCaptureButtonAnimation(_ duration: TimeInterval) { + owsFailDebug("\(#function) should never be called") + } + + func endCaptureButtonAnimation(_ duration: TimeInterval) { + owsFailDebug("\(#function) should never be called") + } +} + // MARK: - UICollectionViewDataSource extension AttachmentFormatPickerView: UICollectionViewDataSource {