From c5b40d302aaf4e8c58e1217e804d0c76b122c393 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 25 Jul 2017 18:59:35 +0800 Subject: [PATCH 1/2] Change the deployment target to iOS 9.0 --- CHANGELOG.md | 5 + Example/Pickle.xcodeproj/project.pbxproj | 9 +- Example/Podfile | 2 +- Example/Podfile.lock | 4 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 272 ++++++++++---------- Pickle.podspec | 2 +- README.md | 5 +- 7 files changed, 153 insertions(+), 146 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af35ef8..f490cde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## Next Release + +* Drop iOS 8 support [#13](https://github.com/carousell/pickle/pull/13) +* Rename `imagePickerController(_:didDeselectImageAsset:)` [#12](https://github.com/carousell/pickle/pull/12) + ## v1.1.0 * Add a configuration for the photo albums navigation bar shadow color [#9](https://github.com/carousell/pickle/pull/9) diff --git a/Example/Pickle.xcodeproj/project.pbxproj b/Example/Pickle.xcodeproj/project.pbxproj index 78fcaed..14e2c76 100644 --- a/Example/Pickle.xcodeproj/project.pbxproj +++ b/Example/Pickle.xcodeproj/project.pbxproj @@ -454,7 +454,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -494,7 +494,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -509,7 +509,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Pickle/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "com.carousell.pickle-example"; @@ -525,7 +525,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Pickle/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "com.carousell.pickle-example"; @@ -600,6 +600,7 @@ B56351631F06278E00B5A46D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Example/Podfile b/Example/Podfile index 0377c9d..46cbfc3 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,4 +1,4 @@ -platform :ios, '8.0' +platform :ios, '9.0' use_frameworks! target 'PickleExample' do diff --git a/Example/Podfile.lock b/Example/Podfile.lock index e5029e8..bd07007 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -11,9 +11,9 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Pickle: 1482e432a75aa9454d254916765f6079668e51c1 + Pickle: 5cc73fe4845a18e9ae521f72e53950cff1c10316 SwiftLint: b467d08f5b25dc3b3cfed243d8e1b74b91714c67 -PODFILE CHECKSUM: deb6efd06d1eb162719911e286f38d05b1590fdb +PODFILE CHECKSUM: 83c0411086be0ec4861900c45c98a441a46c6431 COCOAPODS: 1.2.1 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 9a41b20..c45fe30 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -550,7 +550,41 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 34FE9531DA9AF2820790339988D5FF41 /* Release */ = { + 2002F3264F31A1F4A61FE6F2AE5E8CAA /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0A6F8155B4C512BF12EEF385C7F952C8 /* Pickle.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Pickle/Pickle-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Pickle/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Pickle/Pickle.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = Pickle; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 4E487F173E6C9664F4E9E26B9635D23C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -573,37 +607,41 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", "$(inherited)", ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; }; - name = Release; + name = Debug; }; - 375F6B52C9965209A31949BEEC6B098C /* Debug */ = { + 52D50CEC05E91BD62F9F9239F1534B8E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 76B4861993B48BBC765083E38466115F /* Pods-PickleExample.debug.xcconfig */; + baseConfigurationReference = 6CC7FCBEBF788A7820C94F0179BDE37F /* Pods-PickleExample.release.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -612,11 +650,11 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Target Support Files/Pods-PickleExample/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-PickleExample/Pods-PickleExample.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; @@ -624,51 +662,15 @@ PRODUCT_NAME = Pods_PickleExample; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 3E3170BB4324FE341F0DBEDC92D0DF66 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0A6F8155B4C512BF12EEF385C7F952C8 /* Pickle.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Pickle/Pickle-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Pickle/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Pickle/Pickle.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Pickle; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 52965118B720BF1E0D2CDAA911605216 /* Debug */ = { + B166E96670A6E639B5BB7BCCE200927F /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 439FFED25A474CEFE36ABAA1340B1417 /* Pods-PickleUITests.debug.xcconfig */; buildSettings = { @@ -686,7 +688,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Target Support Files/Pods-PickleUITests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-PickleUITests/Pods-PickleUITests.modulemap"; @@ -704,45 +706,86 @@ }; name = Debug; }; - 637B309D111773D15C02068DC899F868 /* Release */ = { + BDD0139D6EB93FA375F887ABD62DAB2E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6CC7FCBEBF788A7820C94F0179BDE37F /* Pods-PickleExample.release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C751603426257BAD9105FD5561D34AA2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0A6F8155B4C512BF12EEF385C7F952C8 /* Pickle.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-PickleExample/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Pickle/Pickle-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Pickle/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PickleExample/Pods-PickleExample.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_PickleExample; + MODULEMAP_FILE = "Target Support Files/Pickle/Pickle.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = Pickle; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - AB0B0461D5F33D9BAF9D0E41A7EAAAF6 /* Release */ = { + EF764FC0AC5717A9623528EADEB11ED2 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = D9A1AB08F443FEBD010DCBF0F3B723BB /* Pods-PickleUITests.release.xcconfig */; buildSettings = { @@ -760,7 +803,7 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Target Support Files/Pods-PickleUITests/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-PickleUITests/Pods-PickleUITests.modulemap"; @@ -778,87 +821,44 @@ }; name = Release; }; - C104F7F091290C3D1E248192F07FE689 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - C4D13EC6649ACA25AC2E0C18EEBABD68 /* Release */ = { + F5EF5B402E12E9A531008F83957EA257 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0A6F8155B4C512BF12EEF385C7F952C8 /* Pickle.xcconfig */; + baseConfigurationReference = 76B4861993B48BBC765083E38466115F /* Pods-PickleExample.debug.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Pickle/Pickle-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Pickle/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-PickleExample/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Pickle/Pickle.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Pickle; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-PickleExample/Pods-PickleExample.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_PickleExample; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; /* End XCBuildConfiguration section */ @@ -866,8 +866,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - C104F7F091290C3D1E248192F07FE689 /* Debug */, - 34FE9531DA9AF2820790339988D5FF41 /* Release */, + 4E487F173E6C9664F4E9E26B9635D23C /* Debug */, + BDD0139D6EB93FA375F887ABD62DAB2E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -875,8 +875,8 @@ B212423ACE5784865CE2F821FD3137CC /* Build configuration list for PBXNativeTarget "Pickle" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3E3170BB4324FE341F0DBEDC92D0DF66 /* Debug */, - C4D13EC6649ACA25AC2E0C18EEBABD68 /* Release */, + C751603426257BAD9105FD5561D34AA2 /* Debug */, + 2002F3264F31A1F4A61FE6F2AE5E8CAA /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -884,8 +884,8 @@ D7B45722C0095E70D5A6B1A700C098AB /* Build configuration list for PBXNativeTarget "Pods-PickleExample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 375F6B52C9965209A31949BEEC6B098C /* Debug */, - 637B309D111773D15C02068DC899F868 /* Release */, + F5EF5B402E12E9A531008F83957EA257 /* Debug */, + 52D50CEC05E91BD62F9F9239F1534B8E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -893,8 +893,8 @@ FD3B0BBFA75E9E3B5DB0AA84D92DE383 /* Build configuration list for PBXNativeTarget "Pods-PickleUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 52965118B720BF1E0D2CDAA911605216 /* Debug */, - AB0B0461D5F33D9BAF9D0E41A7EAAAF6 /* Release */, + B166E96670A6E639B5BB7BCCE200927F /* Debug */, + EF764FC0AC5717A9623528EADEB11ED2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pickle.podspec b/Pickle.podspec index 2c18949..ddd3edc 100644 --- a/Pickle.podspec +++ b/Pickle.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/carousell/pickle.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/thecarousell' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' s.ios.framework = 'Photos' s.source_files = 'Pickle/Classes/**/*' s.resources = 'Pickle/Assets/**/*' diff --git a/README.md b/README.md index fc6c03a..270d782 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ let picker = ImagePickerController( Pickle | iOS | Xcode | Swift ---------- | :--: | :---: | :---: `~> 1.0.0` | 8.0+ | 8.3.3 | ![Swift 3.1](https://img.shields.io/badge/Swift-3.1-orange.svg) +`~> 1.2.0` | 9.0+ | 8.3.3 | ![Swift 3.1](https://img.shields.io/badge/Swift-3.1-orange.svg) ## Installation @@ -103,10 +104,10 @@ Pickle | iOS | Xcode | Swift Create a `Podfile` with the following specification and run `pod install`. ```rb -platform :ios, '8.0' +platform :ios, '9.0' use_frameworks! -pod 'Pickle', '~> 1.0.0' +pod 'Pickle', '~> 1.2.0' ``` ### Use [Carthage](https://github.com/Carthage/Carthage) From 2a1190d05e13ce427bb248590a7f2e3d092423f8 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 25 Jul 2017 19:06:29 +0800 Subject: [PATCH 2/2] Remove iOS 8 related code --- Pickle/Classes/PhotoAlbumCell.swift | 141 +++--------------- Pickle/Classes/PhotoAlbumTitleButton.swift | 30 +--- Pickle/Classes/PhotoGalleryCameraCell.swift | 24 +-- .../Classes/PhotoGalleryCameraIconView.swift | 38 +---- Pickle/Classes/PhotoGalleryCell.swift | 31 +--- ...ontroller+UIViewControllerPreviewing.swift | 10 +- .../Classes/PhotoGalleryViewController.swift | 38 ++--- Pickle/Classes/UIFont+Style.swift | 6 +- 8 files changed, 52 insertions(+), 266 deletions(-) diff --git a/Pickle/Classes/PhotoAlbumCell.swift b/Pickle/Classes/PhotoAlbumCell.swift index 6a41ca6..c7f3864 100644 --- a/Pickle/Classes/PhotoAlbumCell.swift +++ b/Pickle/Classes/PhotoAlbumCell.swift @@ -91,7 +91,6 @@ internal final class PhotoAlbumCell: UITableViewCell { }) } - // swiftlint:disable function_body_length private func setUpSubviews() { accessoryType = .disclosureIndicator textLabel?.removeFromSuperview() @@ -105,134 +104,30 @@ internal final class PhotoAlbumCell: UITableViewCell { $0.translatesAutoresizingMaskIntoConstraints = false } - if #available(iOS 9.0, *) { - imageViews[0].leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 15).isActive = true - imageViews[0].topAnchor.constraint(equalTo: contentView.topAnchor, constant: 10).isActive = true - imageViews[0].bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -10).isActive = true - imageViews[0].widthAnchor.constraint(equalTo: imageViews[0].heightAnchor).isActive = true + imageViews[0].leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 15).isActive = true + imageViews[0].topAnchor.constraint(equalTo: contentView.topAnchor, constant: 10).isActive = true + imageViews[0].bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -10).isActive = true + imageViews[0].widthAnchor.constraint(equalTo: imageViews[0].heightAnchor).isActive = true - for (index, imageView) in imageViews.enumerated() { - guard index != 0 else { - continue - } - - imageView.widthAnchor.constraint(equalTo: imageViews[0].widthAnchor, constant: -2 * CGFloat(index)).isActive = true - imageView.heightAnchor.constraint(equalTo: imageViews[0].heightAnchor, constant: -2 * CGFloat(index)).isActive = true - imageView.centerXAnchor.constraint(equalTo: imageViews[0].centerXAnchor).isActive = true - imageView.centerYAnchor.constraint(equalTo: imageViews[0].centerYAnchor, constant: -4 * CGFloat(index)).isActive = true - } - } else { - contentView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:|-15-[image]", - options: [], - metrics: nil, - views: ["image": imageViews[0]] - )) - contentView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "V:|-10-[image]-10-|", - options: [], - metrics: nil, - views: ["image": imageViews[0]] - )) - imageViews[0].addConstraint(NSLayoutConstraint( - item: imageViews[0], - attribute: .width, - relatedBy: .equal, - toItem: imageViews[0], - attribute: .height, - multiplier: 1, - constant: 0 - )) - - for (index, imageView) in imageViews.enumerated() { - guard index != 0 else { - continue - } - - contentView.addConstraint(NSLayoutConstraint( - item: imageView, - attribute: .width, - relatedBy: .equal, - toItem: imageViews[0], - attribute: .width, - multiplier: 1, - constant: -2 * CGFloat(index) - )) - contentView.addConstraint(NSLayoutConstraint( - item: imageView, - attribute: .height, - relatedBy: .equal, - toItem: imageViews[0], - attribute: .height, - multiplier: 1, - constant: -2 * CGFloat(index) - )) - contentView.addConstraint(NSLayoutConstraint( - item: imageView, - attribute: .centerX, - relatedBy: .equal, - toItem: imageViews[0], - attribute: .centerX, - multiplier: 1, - constant: 0 - )) - contentView.addConstraint(NSLayoutConstraint( - item: imageView, - attribute: .centerY, - relatedBy: .equal, - toItem: imageViews[0], - attribute: .centerY, - multiplier: 1, - constant: -4 * CGFloat(index) - )) + for (index, imageView) in imageViews.enumerated() { + guard index != 0 else { + continue } + imageView.widthAnchor.constraint(equalTo: imageViews[0].widthAnchor, constant: -2 * CGFloat(index)).isActive = true + imageView.heightAnchor.constraint(equalTo: imageViews[0].heightAnchor, constant: -2 * CGFloat(index)).isActive = true + imageView.centerXAnchor.constraint(equalTo: imageViews[0].centerXAnchor).isActive = true + imageView.centerYAnchor.constraint(equalTo: imageViews[0].centerYAnchor, constant: -4 * CGFloat(index)).isActive = true } titleLabel.translatesAutoresizingMaskIntoConstraints = false - subtitleLabel.translatesAutoresizingMaskIntoConstraints = false + titleLabel.leadingAnchor.constraint(equalTo: imageViews[0].trailingAnchor, constant: 15).isActive = true + titleLabel.trailingAnchor.constraint(greaterThanOrEqualTo: contentView.trailingAnchor, constant: 15).isActive = true + titleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: -10).isActive = true - if #available(iOS 9.0, *) { - titleLabel.leadingAnchor.constraint(equalTo: imageViews[0].trailingAnchor, constant: 15).isActive = true - titleLabel.trailingAnchor.constraint(greaterThanOrEqualTo: contentView.trailingAnchor, constant: 15).isActive = true - titleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: -10).isActive = true - - subtitleLabel.leadingAnchor.constraint(equalTo: imageViews[0].trailingAnchor, constant: 15).isActive = true - subtitleLabel.trailingAnchor.constraint(greaterThanOrEqualTo: contentView.trailingAnchor, constant: 15).isActive = true - subtitleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: 10).isActive = true - } else { - contentView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:[image]-15-[title]-(>=15)-|", - options: [], - metrics: nil, - views: ["image": imageViews[0], "title": titleLabel] - )) - contentView.addConstraint(NSLayoutConstraint( - item: titleLabel, - attribute: .centerY, - relatedBy: .equal, - toItem: contentView, - attribute: .centerY, - multiplier: 1, - constant: -10 - )) - - contentView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:[image]-15-[subtitle]-(>=15)-|", - options: [], - metrics: nil, - views: ["image": imageViews[0], "subtitle": subtitleLabel] - )) - contentView.addConstraint(NSLayoutConstraint( - item: subtitleLabel, - attribute: .centerY, - relatedBy: .equal, - toItem: contentView, - attribute: .centerY, - multiplier: 1, - constant: 10 - )) - } + subtitleLabel.translatesAutoresizingMaskIntoConstraints = false + subtitleLabel.leadingAnchor.constraint(equalTo: imageViews[0].trailingAnchor, constant: 15).isActive = true + subtitleLabel.trailingAnchor.constraint(greaterThanOrEqualTo: contentView.trailingAnchor, constant: 15).isActive = true + subtitleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: 10).isActive = true } - // swiftlint:enable } diff --git a/Pickle/Classes/PhotoAlbumTitleButton.swift b/Pickle/Classes/PhotoAlbumTitleButton.swift index 6ebe8de..6842c0d 100644 --- a/Pickle/Classes/PhotoAlbumTitleButton.swift +++ b/Pickle/Classes/PhotoAlbumTitleButton.swift @@ -100,30 +100,14 @@ internal final class PhotoAlbumTitleButton: UIControl { addSubview(arrowIcon) titleLabel.translatesAutoresizingMaskIntoConstraints = false - arrowIcon.translatesAutoresizingMaskIntoConstraints = false + titleLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 15).isActive = true + arrowIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 5).isActive = true + arrowIcon.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -10).isActive = true - if #available(iOS 9.0, *) { - titleLabel.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 15).isActive = true - arrowIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 5).isActive = true - arrowIcon.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -10).isActive = true - - titleLabel.topAnchor.constraint(equalTo: topAnchor, constant: 3).isActive = true - titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -3).isActive = true - titleLabel.centerYAnchor.constraint(equalTo: arrowIcon.centerYAnchor).isActive = true - } else { - addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:|-15-[title]-5-[arrow]-10-|", - options: [.alignAllCenterY], - metrics: nil, - views: ["title": titleLabel, "arrow": arrowIcon] - )) - addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "V:|-3-[title]-3-|", - options: [], - metrics: nil, - views: ["title": titleLabel] - )) - } + arrowIcon.translatesAutoresizingMaskIntoConstraints = false + titleLabel.topAnchor.constraint(equalTo: topAnchor, constant: 3).isActive = true + titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -3).isActive = true + titleLabel.centerYAnchor.constraint(equalTo: arrowIcon.centerYAnchor).isActive = true } } diff --git a/Pickle/Classes/PhotoGalleryCameraCell.swift b/Pickle/Classes/PhotoGalleryCameraCell.swift index 94a008d..fbaea12 100644 --- a/Pickle/Classes/PhotoGalleryCameraCell.swift +++ b/Pickle/Classes/PhotoGalleryCameraCell.swift @@ -29,26 +29,10 @@ internal final class PhotoGalleryCameraCell: UICollectionViewCell { contentView.addSubview(cameraIconView) cameraIconView.translatesAutoresizingMaskIntoConstraints = false - - if #available(iOS 9.0, *) { - cameraIconView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor).isActive = true - cameraIconView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor).isActive = true - cameraIconView.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true - cameraIconView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor).isActive = true - } else { - contentView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:|[icon]|", - options: [], - metrics: nil, - views: ["icon": cameraIconView] - )) - contentView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "V:|[icon]|", - options: [], - metrics: nil, - views: ["icon": cameraIconView] - )) - } + cameraIconView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor).isActive = true + cameraIconView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor).isActive = true + cameraIconView.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true + cameraIconView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor).isActive = true } } diff --git a/Pickle/Classes/PhotoGalleryCameraIconView.swift b/Pickle/Classes/PhotoGalleryCameraIconView.swift index 32c0de4..8175313 100644 --- a/Pickle/Classes/PhotoGalleryCameraIconView.swift +++ b/Pickle/Classes/PhotoGalleryCameraIconView.swift @@ -41,40 +41,12 @@ internal final class PhotoGalleryCameraIconView: UIView { addSubview(textLabel) imageView.translatesAutoresizingMaskIntoConstraints = false - textLabel.translatesAutoresizingMaskIntoConstraints = false - - if #available(iOS 9.0, *) { - imageView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true - imageView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: -10).isActive = true + imageView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true + imageView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: -10).isActive = true - textLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true - textLabel.topAnchor.constraint(equalTo: imageView.bottomAnchor, constant: 10).isActive = true - } else { - addConstraint(NSLayoutConstraint( - item: imageView, - attribute: .centerX, - relatedBy: .equal, - toItem: self, - attribute: .centerX, - multiplier: 1, - constant: 0 - )) - addConstraint(NSLayoutConstraint( - item: imageView, - attribute: .centerY, - relatedBy: .equal, - toItem: self, - attribute: .centerY, - multiplier: 1, - constant: -10 - )) - addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "V:[image]-10-[text]", - options: [.alignAllCenterX], - metrics: nil, - views: ["image": imageView, "text": textLabel] - )) - } + textLabel.translatesAutoresizingMaskIntoConstraints = false + textLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true + textLabel.topAnchor.constraint(equalTo: imageView.bottomAnchor, constant: 10).isActive = true } } diff --git a/Pickle/Classes/PhotoGalleryCell.swift b/Pickle/Classes/PhotoGalleryCell.swift index 73b30eb..47501bd 100644 --- a/Pickle/Classes/PhotoGalleryCell.swift +++ b/Pickle/Classes/PhotoGalleryCell.swift @@ -100,34 +100,9 @@ internal final class PhotoGalleryCell: UICollectionViewCell { overlayView.autoresizingMask = [.flexibleWidth, .flexibleHeight] tagLabel.translatesAutoresizingMaskIntoConstraints = false - - if #available(iOS 9.0, *) { - tagLabel.widthAnchor.constraint(equalTo: tagLabel.heightAnchor).isActive = true - tagLabel.topAnchor.constraint(equalTo: overlayView.topAnchor, constant: 10).isActive = true - tagLabel.trailingAnchor.constraint(equalTo: overlayView.trailingAnchor, constant: -10).isActive = true - } else { - tagLabel.addConstraint(NSLayoutConstraint( - item: tagLabel, - attribute: .width, - relatedBy: .equal, - toItem: tagLabel, - attribute: .height, - multiplier: 1, - constant: 0 - )) - overlayView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:[tag]-10-|", - options: [], - metrics: nil, - views: ["tag": tagLabel] - )) - overlayView.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "V:|-10-[tag]", - options: [], - metrics: nil, - views: ["tag": tagLabel] - )) - } + tagLabel.widthAnchor.constraint(equalTo: tagLabel.heightAnchor).isActive = true + tagLabel.topAnchor.constraint(equalTo: overlayView.topAnchor, constant: 10).isActive = true + tagLabel.trailingAnchor.constraint(equalTo: overlayView.trailingAnchor, constant: -10).isActive = true } } diff --git a/Pickle/Classes/PhotoGalleryViewController+UIViewControllerPreviewing.swift b/Pickle/Classes/PhotoGalleryViewController+UIViewControllerPreviewing.swift index b40f27f..24ee421 100644 --- a/Pickle/Classes/PhotoGalleryViewController+UIViewControllerPreviewing.swift +++ b/Pickle/Classes/PhotoGalleryViewController+UIViewControllerPreviewing.swift @@ -28,12 +28,10 @@ extension PhotoGalleryViewController: UIViewControllerPreviewingDelegate { let asset = fetchResult[index] let detailViewController = PhotoDetailViewController(asset: asset) - if #available(iOS 9.0, *) { - let width = previewingContext.sourceRect.width - let ratio = CGFloat(asset.pixelHeight) / CGFloat(asset.pixelWidth) - detailViewController.preferredContentSize = CGSize(width: width, height: width * ratio) - previewingContext.sourceRect = cell.frame - } + let width = previewingContext.sourceRect.width + let ratio = CGFloat(asset.pixelHeight) / CGFloat(asset.pixelWidth) + detailViewController.preferredContentSize = CGSize(width: width, height: width * ratio) + previewingContext.sourceRect = cell.frame return detailViewController } diff --git a/Pickle/Classes/PhotoGalleryViewController.swift b/Pickle/Classes/PhotoGalleryViewController.swift index 24c4a57..399b959 100644 --- a/Pickle/Classes/PhotoGalleryViewController.swift +++ b/Pickle/Classes/PhotoGalleryViewController.swift @@ -119,10 +119,8 @@ internal final class PhotoGalleryViewController: UIViewController, setUpSubviews() showEmptyViewIfNeeded() - if #available(iOS 9.0, *) { - if traitCollection.forceTouchCapability == .available { - registerForPreviewing(with: self, sourceView: collectionView) - } + if traitCollection.forceTouchCapability == .available { + registerForPreviewing(with: self, sourceView: collectionView) } } @@ -235,31 +233,15 @@ internal final class PhotoGalleryViewController: UIViewController, view.addSubview(collectionView) hintLabel.translatesAutoresizingMaskIntoConstraints = false - collectionView.translatesAutoresizingMaskIntoConstraints = false - - if #available(iOS 9.0, *) { - hintLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - hintLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - hintLabel.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor).isActive = true + hintLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + hintLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + hintLabel.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor).isActive = true - collectionView.topAnchor.constraint(equalTo: hintLabel.bottomAnchor).isActive = true - collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - } else { - view.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "H:|[hint]|", - options: [], - metrics: nil, - views: ["hint": hintLabel] - )) - view.addConstraints(NSLayoutConstraint.constraints( - withVisualFormat: "V:[top][hint][gallery]|", - options: [.alignAllLeading, .alignAllTrailing], - metrics: nil, - views: ["top": topLayoutGuide, "hint": hintLabel, "gallery": collectionView] - )) - } + collectionView.translatesAutoresizingMaskIntoConstraints = false + collectionView.topAnchor.constraint(equalTo: hintLabel.bottomAnchor).isActive = true + collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true + collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true + collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true } private func showEmptyViewIfNeeded() { diff --git a/Pickle/Classes/UIFont+Style.swift b/Pickle/Classes/UIFont+Style.swift index 001d38d..aea21b7 100644 --- a/Pickle/Classes/UIFont+Style.swift +++ b/Pickle/Classes/UIFont+Style.swift @@ -29,11 +29,7 @@ internal extension UIFont { } private static func systemSemiBoldFont(ofSize fontSize: CGFloat) -> UIFont { - if #available(iOS 8.2, *) { - return UIFont.systemFont(ofSize: fontSize, weight: UIFontWeightSemibold) - } else { - return UIFont.systemFont(ofSize: fontSize) - } + return UIFont.systemFont(ofSize: fontSize, weight: UIFontWeightSemibold) } }