mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix various warnings
This commit is contained in:
parent
a53eda40f9
commit
5a3ed9163b
7 changed files with 37 additions and 36 deletions
|
@ -311,6 +311,7 @@ class MenuActionSheetView: UIView, MenuActionViewDelegate {
|
|||
case .failed:
|
||||
Logger.debug("failed")
|
||||
unhighlightAllActionViews()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
public extension CGPoint {
|
||||
extension CGPoint {
|
||||
public func offsetBy(dx: CGFloat) -> CGPoint {
|
||||
return CGPoint(x: x + dx, y: y)
|
||||
}
|
||||
|
|
|
@ -599,24 +599,6 @@ class PhotoCaptureOutputAdaptee: NSObject, ImageCaptureOutput {
|
|||
}
|
||||
completion()
|
||||
}
|
||||
|
||||
// for legacy (iOS10) devices
|
||||
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?, resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Error?) {
|
||||
if #available(iOS 11, *) {
|
||||
owsFailDebug("unexpectedly calling legacy method.")
|
||||
}
|
||||
|
||||
guard let photoSampleBuffer = photoSampleBuffer else {
|
||||
owsFailDebug("sampleBuffer was unexpectedly nil")
|
||||
return
|
||||
}
|
||||
|
||||
let data = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(photoSampleBuffer)
|
||||
DispatchQueue.main.async {
|
||||
self.delegate?.captureOutputDidFinishProcessing(photoData: data, error: error)
|
||||
}
|
||||
completion()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -687,6 +669,7 @@ extension AVCaptureVideoOrientation: CustomStringConvertible {
|
|||
return "AVCaptureVideoOrientation.landscapeRight"
|
||||
case .landscapeLeft:
|
||||
return "AVCaptureVideoOrientation.landscapeLeft"
|
||||
default: preconditionFailure()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -708,6 +691,7 @@ extension UIDeviceOrientation: CustomStringConvertible {
|
|||
return "UIDeviceOrientation.faceUp"
|
||||
case .faceDown:
|
||||
return "UIDeviceOrientation.faceDown"
|
||||
default: preconditionFailure()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -731,6 +715,7 @@ extension UIImage.Orientation: CustomStringConvertible {
|
|||
return "UIImageOrientation.leftMirrored"
|
||||
case .rightMirrored:
|
||||
return "UIImageOrientation.rightMirrored"
|
||||
default: preconditionFailure()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -330,6 +330,7 @@ class PhotoCaptureViewController: OWSViewController {
|
|||
imageName = "ic_flash_mode_on"
|
||||
case .off:
|
||||
imageName = "ic_flash_mode_off"
|
||||
default: preconditionFailure()
|
||||
}
|
||||
|
||||
self.flashModeControl.setImage(imageName: imageName)
|
||||
|
@ -520,6 +521,7 @@ class CaptureButton: UIView {
|
|||
self.superview?.layoutIfNeeded()
|
||||
}
|
||||
delegate?.didCancelLongPressCaptureButton(self)
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ class AppUpdateNag: NSObject {
|
|||
public func showAppUpgradeNagIfNecessary() {
|
||||
return
|
||||
|
||||
/*
|
||||
guard let currentVersion = self.currentVersion else {
|
||||
owsFailDebug("currentVersion was unexpectedly nil")
|
||||
return
|
||||
|
@ -49,6 +50,7 @@ class AppUpdateNag: NSObject {
|
|||
}.catch { error in
|
||||
Logger.error("failed with error: \(error)")
|
||||
}.retainUntilComplete()
|
||||
*/
|
||||
}
|
||||
|
||||
// MARK: - Internal
|
||||
|
@ -110,7 +112,7 @@ class AppUpdateNag: NSObject {
|
|||
|
||||
// Only show nag if we are "at rest" in the home view or registration view without any
|
||||
// alerts or dialogs showing.
|
||||
guard let frontmostViewController = UIApplication.shared.frontmostViewController else {
|
||||
guard UIApplication.shared.frontmostViewController != nil else {
|
||||
owsFailDebug("frontmostViewController was unexpectedly nil")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
// Avoid blocking app launch by putting all further possible DB access in async block
|
||||
DispatchQueue.global().async { [weak self] in
|
||||
guard let _ = self else { return }
|
||||
Logger.info("running post launch block for registered user: \(TSAccountManager.localNumber)")
|
||||
Logger.info("running post launch block for registered user: \(TSAccountManager.localNumber())")
|
||||
|
||||
// We don't need to use OWSDisappearingMessagesJob in the SAE.
|
||||
|
||||
|
@ -199,7 +199,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
if tsAccountManager.isRegistered() {
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
guard let _ = self else { return }
|
||||
Logger.info("running post launch block for registered user: \(TSAccountManager.localNumber)")
|
||||
Logger.info("running post launch block for registered user: \(TSAccountManager.localNumber())")
|
||||
|
||||
// We don't need to use the TSSocketManager in the SAE.
|
||||
|
||||
|
@ -258,7 +258,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
AppReadiness.setAppIsReady()
|
||||
|
||||
if tsAccountManager.isRegistered() {
|
||||
Logger.info("localNumber: \(TSAccountManager.localNumber)")
|
||||
Logger.info("localNumber: \(TSAccountManager.localNumber())")
|
||||
|
||||
// We don't need to use messageFetcherJob in the SAE.
|
||||
|
||||
|
@ -290,7 +290,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
Logger.debug("")
|
||||
|
||||
if tsAccountManager.isRegistered() {
|
||||
Logger.info("localNumber: \(TSAccountManager.localNumber)")
|
||||
Logger.info("localNumber: \(TSAccountManager.localNumber())")
|
||||
|
||||
// We don't need to use ExperienceUpgradeFinder in the SAE.
|
||||
|
||||
|
@ -659,12 +659,8 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
var visualMediaItemProviders = [NSItemProvider]()
|
||||
var hasNonVisualMedia = false
|
||||
for attachment in attachments {
|
||||
guard let itemProvider = attachment as? NSItemProvider else {
|
||||
owsFailDebug("Unexpected attachment type: \(String(describing: attachment))")
|
||||
continue
|
||||
}
|
||||
if isVisualMediaItem(itemProvider: itemProvider) {
|
||||
visualMediaItemProviders.append(itemProvider)
|
||||
if isVisualMediaItem(itemProvider: attachment) {
|
||||
visualMediaItemProviders.append(attachment)
|
||||
} else {
|
||||
hasNonVisualMedia = true
|
||||
}
|
||||
|
@ -690,15 +686,11 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed
|
|||
}
|
||||
return isUrlItem(itemProvider: itemProvider)
|
||||
}) {
|
||||
if let itemProvider = preferredAttachment as? NSItemProvider {
|
||||
return [itemProvider]
|
||||
} else {
|
||||
owsFailDebug("Unexpected attachment type: \(String(describing: preferredAttachment))")
|
||||
}
|
||||
return [preferredAttachment]
|
||||
}
|
||||
|
||||
// else return whatever is available
|
||||
if let itemProvider = inputItem.attachments?.first as? NSItemProvider {
|
||||
if let itemProvider = inputItem.attachments?.first {
|
||||
return [itemProvider]
|
||||
} else {
|
||||
owsFailDebug("Missing attachment.")
|
||||
|
|
|
@ -10,22 +10,38 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[];
|
|||
|
||||
#import <SignalUtilitiesKit/AppSetup.h>
|
||||
#import <SignalUtilitiesKit/AppVersion.h>
|
||||
#import <SignalUtilitiesKit/AttachmentSharing.h>
|
||||
#import <SignalUtilitiesKit/BlockListUIUtils.h>
|
||||
#import <SignalUtilitiesKit/ByteParser.h>
|
||||
#import <SignalUtilitiesKit/ContactCellView.h>
|
||||
#import <SignalUtilitiesKit/ContactTableViewCell.h>
|
||||
#import <SignalUtilitiesKit/DebugLogger.h>
|
||||
#import <SignalUtilitiesKit/FunctionalUtil.h>
|
||||
#import <SignalUtilitiesKit/NSArray+OWS.h>
|
||||
#import <SignalUtilitiesKit/NSAttributedString+OWS.h>
|
||||
#import <SignalUtilitiesKit/NSObject+Casting.h>
|
||||
#import <SignalUtilitiesKit/NSSet+Functional.h>
|
||||
#import <SignalUtilitiesKit/NSURLSessionDataTask+StatusCode.h>
|
||||
#import <SignalUtilitiesKit/OWSAnyTouchGestureRecognizer.h>
|
||||
#import <SignalUtilitiesKit/OWSAttachmentDownloads.h>
|
||||
#import <SignalUtilitiesKit/OWSDatabaseMigration.h>
|
||||
#import <SignalUtilitiesKit/OWSDatabaseMigrationRunner.h>
|
||||
#import <SignalUtilitiesKit/OWSDispatch.h>
|
||||
#import <SignalUtilitiesKit/OWSError.h>
|
||||
#import <SignalUtilitiesKit/OWSFailedAttachmentDownloadsJob.h>
|
||||
#import <SignalUtilitiesKit/OWSFailedMessagesJob.h>
|
||||
#import <SignalUtilitiesKit/OWSFormat.h>
|
||||
#import <SignalUtilitiesKit/OWSMessageUtils.h>
|
||||
#import <SignalUtilitiesKit/OWSNavigationController.h>
|
||||
#import <SignalUtilitiesKit/OWSOperation.h>
|
||||
#import <SignalUtilitiesKit/OWSPrimaryStorage+keyFromIntLong.h>
|
||||
#import <SignalUtilitiesKit/OWSPrimaryStorage+Loki.h>
|
||||
#import <SignalUtilitiesKit/OWSProfileManager.h>
|
||||
#import <SignalUtilitiesKit/OWSQueues.h>
|
||||
#import <SignalUtilitiesKit/OWSResaveCollectionDBMigration.h>
|
||||
#import <SignalUtilitiesKit/OWSScrubbingLogFormatter.h>
|
||||
#import <SignalUtilitiesKit/OWSSearchBar.h>
|
||||
#import <SignalUtilitiesKit/OWSTableViewController.h>
|
||||
#import <SignalUtilitiesKit/OWSTextField.h>
|
||||
#import <SignalUtilitiesKit/OWSTextView.h>
|
||||
#import <SignalUtilitiesKit/OWSUnreadIndicator.h>
|
||||
|
@ -37,7 +53,10 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[];
|
|||
#import <SignalUtilitiesKit/SSKAsserts.h>
|
||||
#import <SignalUtilitiesKit/Theme.h>
|
||||
#import <SignalUtilitiesKit/ThreadUtil.h>
|
||||
#import <SignalUtilitiesKit/ThreadViewHelper.h>
|
||||
#import <SignalUtilitiesKit/TSConstants.h>
|
||||
#import <SignalUtilitiesKit/TSStorageHeaders.h>
|
||||
#import <SignalUtilitiesKit/TSStorageKeys.h>
|
||||
#import <SignalUtilitiesKit/UIFont+OWS.h>
|
||||
#import <SignalUtilitiesKit/UIUtil.h>
|
||||
#import <SignalUtilitiesKit/UIViewController+OWS.h>
|
||||
|
|
Loading…
Reference in a new issue