diff --git a/ImagePicker.xcodeproj/project.pbxproj b/ImagePicker.xcodeproj/project.pbxproj index 82bc8c2..37573e8 100644 --- a/ImagePicker.xcodeproj/project.pbxproj +++ b/ImagePicker.xcodeproj/project.pbxproj @@ -364,7 +364,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = Inloop; TargetAttributes = { 420C23FB1F5D82C6008935D4 = { @@ -538,6 +538,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -562,13 +563,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -598,6 +599,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -616,11 +618,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -632,12 +634,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = P2PP2EM79F; INFOPLIST_FILE = ExampleApp/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.twof.ExampleApp; PRODUCT_NAME = "Image Picker"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -648,12 +650,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = P2PP2EM79F; INFOPLIST_FILE = ExampleApp/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.twof.ExampleApp; PRODUCT_NAME = "Image Picker"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -670,8 +672,9 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = ImagePicker/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 0.8; OTHER_SWIFT_FLAGS = "-DDEBUG"; PRODUCT_BUNDLE_IDENTIFIER = eu.inloop.ImagePicker; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -697,8 +700,9 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = ImagePicker/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 0.8; PRODUCT_BUNDLE_IDENTIFIER = eu.inloop.ImagePicker; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/ImagePicker.xcodeproj/xcshareddata/xcschemes/ImagePicker.xcscheme b/ImagePicker.xcodeproj/xcshareddata/xcschemes/ImagePicker.xcscheme index 3248adb..05c4a24 100644 --- a/ImagePicker.xcodeproj/xcshareddata/xcschemes/ImagePicker.xcscheme +++ b/ImagePicker.xcodeproj/xcshareddata/xcschemes/ImagePicker.xcscheme @@ -1,6 +1,6 @@ - - - - collectionView.bounds.width / 3 else { return } + @unknown default: return } // Compute the assets to start caching and to stop caching. diff --git a/ImagePicker/ImagePickerController.swift b/ImagePicker/ImagePickerController.swift index 1d45074..37c1543 100755 --- a/ImagePicker/ImagePickerController.swift +++ b/ImagePicker/ImagePickerController.swift @@ -276,7 +276,7 @@ open class ImagePickerController : UIViewController { collectionViewDataSource.assetsModel.fetchResult = assetsFetchResultBlock?() collectionViewDataSource.layoutModel = LayoutModel(configuration: layoutConfiguration, assets: collectionViewDataSource.assetsModel.fetchResult.count) - case .restricted, .denied: + case .restricted, .denied, .limited: if let view = overlayView ?? dataSource?.imagePicker(controller: self, viewForAuthorizationStatus: status), view.superview != collectionView { collectionView.backgroundView = view overlayView = view @@ -288,6 +288,8 @@ open class ImagePickerController : UIViewController { self.reloadData(basedOnAuthorizationStatus: status) } }) + @unknown default: break + } } @@ -338,6 +340,7 @@ open class ImagePickerController : UIViewController { switch layoutConfiguration.scrollDirection { case .horizontal: collectionView.alwaysBounceHorizontal = true case .vertical: collectionView.alwaysBounceVertical = true + @unknown default: break } if #available(iOS 11.0, *) { diff --git a/ImagePicker/ImagePickerLayout.swift b/ImagePicker/ImagePickerLayout.swift index 31d5094..9a6fa53 100755 --- a/ImagePicker/ImagePickerLayout.swift +++ b/ImagePicker/ImagePickerLayout.swift @@ -43,6 +43,7 @@ final class ImagePickerLayout { itemWidth -= (CGFloat(numberOfItemsInRow) - 1) * configuration.interitemSpacing itemWidth /= CGFloat(numberOfItemsInRow) return CGSize(width: itemWidth, height: preferredWidthOrHeight ?? itemWidth) + @unknown default: return CGSize(width: collectionView.frame.width, height: collectionView.frame.height) } } @@ -115,6 +116,7 @@ final class ImagePickerLayout { switch layout.scrollDirection { case .horizontal: return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: inset) case .vertical: return UIEdgeInsets(top: 0, left: 0, bottom: inset, right: 0) + @unknown default: return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) } } diff --git a/ImagePicker/Info.plist b/ImagePicker/Info.plist index d9b1acd..ec0cc7b 100755 --- a/ImagePicker/Info.plist +++ b/ImagePicker/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.7 + $(MARKETING_VERSION) CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/ImagePicker/Miscellaneous.swift b/ImagePicker/Miscellaneous.swift index 4b6ec97..893323b 100755 --- a/ImagePicker/Miscellaneous.swift +++ b/ImagePicker/Miscellaneous.swift @@ -34,6 +34,7 @@ extension UIInterfaceOrientation : CustomDebugStringConvertible { case .portraitUpsideDown: return "portrait upside down" case .landscapeRight: return "landscape right" case .landscapeLeft: return "landscape left" + @unknown default: return "unknown" } } @@ -43,6 +44,7 @@ func differencesBetweenRects(_ old: CGRect, _ new: CGRect, _ scrollDirection: UI switch scrollDirection { case .horizontal: return differencesBetweenRectsHorizontal(old, new) case .vertical: return differencesBetweenRectsVertical(old, new) + @unknown default: return differencesBetweenRects(old, new, scrollDirection) } }