diff --git a/EFQRCode.podspec b/EFQRCode.podspec index b726ddc3..29d6fef9 100644 --- a/EFQRCode.podspec +++ b/EFQRCode.podspec @@ -15,29 +15,29 @@ Pod::Spec.new do |s| s.social_media_url = 'https://twitter.com/EyreFree777' s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' + s.osx.deployment_target = '10.10' s.tvos.deployment_target = '9.0' s.swift_version = '5.0' s.requires_arc = true s.frameworks = 'ImageIO', 'CoreGraphics', 'Foundation' - s.ios.framework = 'CoreImage' - s.osx.framework = 'CoreImage' - s.tvos.framework = 'CoreImage' + s.ios.framework = 'CoreImage' + s.osx.framework = 'CoreImage' + s.tvos.framework = 'CoreImage' s.default_subspec = 'Core' s.subspec 'Core' do |core| core.source_files = 'Source/**/*.{h,swift}' - end + end - s.subspec 'watchOS' do |watchos| - watchos.ios.deployment_target = '9.0' - watchos.osx.deployment_target = '10.11' + s.subspec 'watchOS' do |watchos| + watchos.ios.deployment_target = '9.0' + watchos.osx.deployment_target = '10.10' watchos.tvos.deployment_target = '9.0' - watchos.watchos.deployment_target = '2.0' - - watchos.source_files = 'Source/**/*.{h,swift}' - watchos.dependency 'swift_qrcodejs', '~> 1.2.0' - end + watchos.watchos.deployment_target = '2.0' + + watchos.source_files = 'Source/**/*.{h,swift}' + watchos.dependency 'swift_qrcodejs', '~> 1.2.0' + end end diff --git a/EFQRCode.xcodeproj/project.pbxproj b/EFQRCode.xcodeproj/project.pbxproj index eba1f6ef..77daedb6 100755 --- a/EFQRCode.xcodeproj/project.pbxproj +++ b/EFQRCode.xcodeproj/project.pbxproj @@ -597,7 +597,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1210; ORGANIZATIONNAME = EyreFree; TargetAttributes = { 4CF626EE1BA7CB3E0011A099 = { @@ -1169,6 +1169,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; @@ -1196,7 +1197,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1234,6 +1235,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; @@ -1254,7 +1256,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode iOS.xcscheme b/EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode iOS.xcscheme index 9388f045..6e9fa5f9 100644 --- a/EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode iOS.xcscheme +++ b/EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode iOS.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + @@ -54,17 +63,6 @@ - - - - - - - - + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + @@ -54,17 +63,6 @@ - - - - - - - - - - - - Void)) { switch PHPhotoLibrary.authorizationStatus() { - case .authorized: + case .authorized, .limited: if let assetCollection = fetchAssetCollectionForAlbum() { save(image: image, to: assetCollection, finish: finish) } else { @@ -1315,12 +1315,16 @@ enum CustomPhotoAlbum { let assetChangeRequest: PHAssetChangeRequest? switch image { case .gif(let data): - guard let documentsDirectoryURL: URL? = try? FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true), - let fileURL: URL = documentsDirectoryURL?.appendingPathComponent("EFQRCode_temp.gif") else { - finish(NSLocalizedString("Can't create a temporary gif file for export", comment: "FileURL is nil")) + guard let documentsDirectoryURL = try? FileManager.default + .url(for: .documentDirectory, in: .userDomainMask, + appropriateFor: nil, create: true) + else { + finish(NSLocalizedString("Can't create a temporary gif file for export", + comment: "FileURL is nil")) errored = true return } + let fileURL = documentsDirectoryURL.appendingPathComponent("EFQRCode_temp.gif") try? data.write(to: fileURL) assetChangeRequest = .creationRequestForAssetFromImage(atFileURL: fileURL) case .normal(let image): diff --git a/Examples/iOS/ViewController.swift b/Examples/iOS/ViewController.swift index 0166e6e0..2a5e8f3b 100644 --- a/Examples/iOS/ViewController.swift +++ b/Examples/iOS/ViewController.swift @@ -105,10 +105,14 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour make.width.equalTo(view) } } - + @objc func openBlog() { if let tryUrl = URL(string: "https://github.com/EFPrefix/EFQRCode") { - UIApplication.shared.open(tryUrl) + if #available(iOS 10.0, tvOS 10.0, *) { + UIApplication.shared.open(tryUrl) + } else { + UIApplication.shared.openURL(tryUrl) + } } } diff --git a/Examples/iOS/iOS Example.xcodeproj/project.pbxproj b/Examples/iOS/iOS Example.xcodeproj/project.pbxproj index 91af1365..9d198eb2 100755 --- a/Examples/iOS/iOS Example.xcodeproj/project.pbxproj +++ b/Examples/iOS/iOS Example.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 120AAA942193323E00F0783B /* swift_qrcodejs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 120AAA932193323E00F0783B /* swift_qrcodejs.framework */; }; 120B77FF1EA395EC00D34440 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 120B77FD1EA395EC00D34440 /* Main.storyboard */; }; 120B78011EA3960D00D34440 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 120B78001EA3960D00D34440 /* LaunchScreen.xib */; }; 120B78031EA3968700D34440 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 120B78021EA3968700D34440 /* ViewController.swift */; }; @@ -376,6 +375,11 @@ 528EFA7322965AC80026663C /* Localized.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localized.swift; sourceTree = ""; }; 52B3BFB6229625760035D5EC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "Resources/zh-Hans.lproj/Main.strings"; sourceTree = ""; }; 52B3BFB7229625760035D5EC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Interface.strings"; sourceTree = ""; }; + D21D361C2552A465006E45E8 /* swift_qrcodejs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = swift_qrcodejs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D21D361D2552A465006E45E8 /* swift_qrcodejs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = swift_qrcodejs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D21D36232552A48A006E45E8 /* swift_qrcodejs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = swift_qrcodejs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D21D36252552A495006E45E8 /* swift_qrcodejs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = swift_qrcodejs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D21D36272552A4B8006E45E8 /* swift_qrcodejs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = swift_qrcodejs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D27FDFA4235AB5DB0033ACFF /* EFFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = EFFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F8111E0519A951050040E7D1 /* EFQRCode.iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EFQRCode.iOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -385,7 +389,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 120AAA942193323E00F0783B /* swift_qrcodejs.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -411,6 +414,11 @@ 120AAA922193323E00F0783B /* Frameworks */ = { isa = PBXGroup; children = ( + D21D36272552A4B8006E45E8 /* swift_qrcodejs.framework */, + D21D36252552A495006E45E8 /* swift_qrcodejs.framework */, + D21D36232552A48A006E45E8 /* swift_qrcodejs.framework */, + D21D361C2552A465006E45E8 /* swift_qrcodejs.framework */, + D21D361D2552A465006E45E8 /* swift_qrcodejs.framework */, D27FDFA4235AB5DB0033ACFF /* EFFoundation.framework */, 120AAA932193323E00F0783B /* swift_qrcodejs.framework */, ); @@ -759,7 +767,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1210; ORGANIZATIONNAME = EyreFree; TargetAttributes = { 5282BCE21FF3AD9000DFB36B = { @@ -1074,6 +1082,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; IBSC_MODULE = watchOS_Example_Extension; INFOPLIST_FILE = "watchOS Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = AppStore.EFQRCode.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -1101,6 +1110,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; IBSC_MODULE = watchOS_Example_Extension; INFOPLIST_FILE = "watchOS Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = AppStore.EFQRCode.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -1185,6 +1195,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; @@ -1210,7 +1221,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1218,7 +1229,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; @@ -1246,6 +1257,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; @@ -1264,13 +1276,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TVOS_DEPLOYMENT_TARGET = 9.0; + TVOS_DEPLOYMENT_TARGET = 12.0; VALIDATE_PRODUCT = YES; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -1283,7 +1295,7 @@ CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = AppStore.EFQRCode; PRODUCT_NAME = EFQRCode.iOS; @@ -1300,7 +1312,7 @@ CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Resources/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = AppStore.EFQRCode; PRODUCT_NAME = EFQRCode.iOS; diff --git a/Examples/iOS/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Examples/iOS/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme index 4bba75f0..b18c7a72 100755 --- a/Examples/iOS/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ b/Examples/iOS/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - - - - - + + - - - - - - - - - - + + - - - - - - + + - - Swift 3.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ | | 4.x | Xcode 9.0+
Swift 4.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+ | | 5.x | Xcode 11.1+
Swift 5.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+| +| 6.x | Xcode 12.0+
Swift 5.0+
iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+| ## Installation diff --git a/README_CN.md b/README_CN.md index 83769d99..c3b0d18c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -99,6 +99,7 @@ git clone git@github.com:EFPrefix/EFQRCode.git; cd EFQRCode; sh Startup.sh; open | 1.x | Xcode 8.0+
Swift 3.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ | | 4.x | Xcode 9.0+
Swift 4.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+ | | 5.x | Xcode 11.1+
Swift 5.0+
iOS 8.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+| +| 6.x | Xcode 12.0+
Swift 5.0+
iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+| ## 安装