From d79004bedfa53a19df7ce105f608c11315d352d6 Mon Sep 17 00:00:00 2001 From: Max Seelemann Date: Wed, 4 May 2022 10:51:34 +0200 Subject: [PATCH 1/2] Enable extension-safe API --- ShortcutRecorder.xcodeproj/project.pbxproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShortcutRecorder.xcodeproj/project.pbxproj b/ShortcutRecorder.xcodeproj/project.pbxproj index 3d0b1f14..066d4968 100644 --- a/ShortcutRecorder.xcodeproj/project.pbxproj +++ b/ShortcutRecorder.xcodeproj/project.pbxproj @@ -440,7 +440,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1010; + LastUpgradeCheck = 1330; TargetAttributes = { 9398377F0DA42965007F53F3 = { LastSwiftMigration = 1000; @@ -830,6 +830,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ANALYZER_GCD_PERFORMANCE = YES; CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; @@ -851,6 +852,7 @@ CLANG_WARN_OBJC_INTERFACE_IVARS = YES_ERROR; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES_AGGRESSIVE; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; @@ -886,6 +888,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ANALYZER_GCD_PERFORMANCE = YES; CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; @@ -907,6 +910,7 @@ CLANG_WARN_OBJC_INTERFACE_IVARS = YES_ERROR; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES_AGGRESSIVE; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; From 7eec7528ae67488106ca739f7125d1f01f62d6ed Mon Sep 17 00:00:00 2001 From: Max Seelemann Date: Thu, 5 May 2022 08:46:32 +0200 Subject: [PATCH 2/2] Fix Xcode compile warnings. --- .../ShortcutRecorder/SRRecorderControlStyle.m | 18 ------------------ Sources/ShortcutRecorder/SRShortcut.m | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/Sources/ShortcutRecorder/SRRecorderControlStyle.m b/Sources/ShortcutRecorder/SRRecorderControlStyle.m index ab6f037c..e10e4912 100644 --- a/Sources/ShortcutRecorder/SRRecorderControlStyle.m +++ b/Sources/ShortcutRecorder/SRRecorderControlStyle.m @@ -320,8 +320,6 @@ - (NSComparisonResult)compare:(SRRecorderControlStyleComponents *)anOtherCompone relativeToComponents:(SRRecorderControlStyleComponents *)anIdealComponents { static NSDictionary *> *AppearanceOrderMap = nil; - static NSDictionary *> *TintOrderMap = nil; - static NSDictionary *> *DirectionOrderMap = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ AppearanceOrderMap = @{ @@ -346,22 +344,6 @@ - (NSComparisonResult)compare:(SRRecorderControlStyleComponents *)anOtherCompone @(SRRecorderControlStyleComponentsAppearanceAqua), @(SRRecorderControlStyleComponentsAppearanceUnspecified)] }; - - TintOrderMap = @{ - @(SRRecorderControlStyleComponentsTintBlue): @[@(SRRecorderControlStyleComponentsTintBlue), - @(SRRecorderControlStyleComponentsTintGraphite), - @(SRRecorderControlStyleComponentsTintUnspecified)], - @(SRRecorderControlStyleComponentsTintGraphite): @[@(SRRecorderControlStyleComponentsTintGraphite), - @(SRRecorderControlStyleComponentsTintBlue), - @(SRRecorderControlStyleComponentsTintUnspecified)] - }; - - DirectionOrderMap = @{ - @(SRRecorderControlStyleComponentsLayoutDirectionLeftToRight): @[@(SRRecorderControlStyleComponentsLayoutDirectionLeftToRight), - @(SRRecorderControlStyleComponentsLayoutDirectionRightToLeft)], - @(SRRecorderControlStyleComponentsLayoutDirectionRightToLeft): @[@(SRRecorderControlStyleComponentsLayoutDirectionRightToLeft), - @(SRRecorderControlStyleComponentsLayoutDirectionLeftToRight)] - }; }); __auto_type CompareEnum = ^(NSUInteger a, NSUInteger b, NSArray *order) { diff --git a/Sources/ShortcutRecorder/SRShortcut.m b/Sources/ShortcutRecorder/SRShortcut.m index 07707bfe..76f1972a 100644 --- a/Sources/ShortcutRecorder/SRShortcut.m +++ b/Sources/ShortcutRecorder/SRShortcut.m @@ -421,7 +421,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder + (instancetype)new { [self doesNotRecognizeSelector:_cmd]; - return nil; + return [super new]; } - (instancetype)init