Skip to content

Commit

Permalink
Update for Xcode 12
Browse files Browse the repository at this point in the history
- Lower macOS min target to 10.10
- Match example project with min target in podspec
  • Loading branch information
ApolloZhu committed Nov 4, 2020
1 parent 9cc65d7 commit 2313b0c
Show file tree
Hide file tree
Showing 17 changed files with 109 additions and 116 deletions.
26 changes: 13 additions & 13 deletions EFQRCode.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions EFQRCode.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1210;
ORGANIZATIONNAME = EyreFree;
TargetAttributes = {
4CF626EE1BA7CB3E0011A099 = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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";
Expand Down
28 changes: 12 additions & 16 deletions EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,8 +40,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8111E3219A95C8B0040E7D1"
BuildableName = "EFQRCode.framework"
BlueprintName = "EFQRCode iOS"
ReferencedContainer = "container:EFQRCode.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -54,17 +63,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8111E3219A95C8B0040E7D1"
BuildableName = "EFQRCode.framework"
BlueprintName = "EFQRCode iOS"
ReferencedContainer = "container:EFQRCode.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down Expand Up @@ -92,8 +90,6 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
28 changes: 12 additions & 16 deletions EFQRCode.xcodeproj/xcshareddata/xcschemes/EFQRCode tvOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,8 +40,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4CF626EE1BA7CB3E0011A099"
BuildableName = "EFQRCode.framework"
BlueprintName = "EFQRCode tvOS"
ReferencedContainer = "container:EFQRCode.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -54,17 +63,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4CF626EE1BA7CB3E0011A099"
BuildableName = "EFQRCode.framework"
BlueprintName = "EFQRCode tvOS"
ReferencedContainer = "container:EFQRCode.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down Expand Up @@ -92,8 +90,6 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:EFQRCode.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
12 changes: 8 additions & 4 deletions Examples/iOS/GeneratorController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ enum CustomPhotoAlbum {

static func save(image: EFImage, finish: @escaping ((_ error: String?) -> Void)) {
switch PHPhotoLibrary.authorizationStatus() {
case .authorized:
case .authorized, .limited:
if let assetCollection = fetchAssetCollectionForAlbum() {
save(image: image, to: assetCollection, finish: finish)
} else {
Expand Down Expand Up @@ -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):
Expand Down
8 changes: 6 additions & 2 deletions Examples/iOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down
Loading

0 comments on commit 2313b0c

Please sign in to comment.