From 2bdc7345edfb331928d9c590f941963380db4a92 Mon Sep 17 00:00:00 2001 From: Toland Hon Date: Sun, 30 Jul 2017 16:09:22 -0700 Subject: [PATCH 1/4] update project settings --- .../project.pbxproj | 18 ++++++++++++++---- .../NSAttributedStringFormat.xcscheme | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/NSAttributedStringFormat.xcodeproj/project.pbxproj b/NSAttributedStringFormat.xcodeproj/project.pbxproj index db476d2..30eb245 100644 --- a/NSAttributedStringFormat.xcodeproj/project.pbxproj +++ b/NSAttributedStringFormat.xcodeproj/project.pbxproj @@ -8,9 +8,9 @@ /* Begin PBXBuildFile section */ 279E6DC21BB8855B0043DDC9 /* NSAttributedStringFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 279E6DC11BB8855B0043DDC9 /* NSAttributedStringFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 279E6DC91BB8855B0043DDC9 /* NSAttributedStringFormat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 279E6DBE1BB8855B0043DDC9 /* NSAttributedStringFormat.framework */; settings = {ASSET_TAGS = (); }; }; - 279E6DD91BB8857A0043DDC9 /* NSAttributedString+CCLFormatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 279E6DD81BB8857A0043DDC9 /* NSAttributedString+CCLFormatTests.m */; settings = {ASSET_TAGS = (); }; }; - 279E6DDB1BB885AF0043DDC9 /* NSAttributedString+CCLFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 279E6DDA1BB885AF0043DDC9 /* NSAttributedString+CCLFormat.m */; settings = {ASSET_TAGS = (); }; }; + 279E6DC91BB8855B0043DDC9 /* NSAttributedStringFormat.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 279E6DBE1BB8855B0043DDC9 /* NSAttributedStringFormat.framework */; }; + 279E6DD91BB8857A0043DDC9 /* NSAttributedString+CCLFormatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 279E6DD81BB8857A0043DDC9 /* NSAttributedString+CCLFormatTests.m */; }; + 279E6DDB1BB885AF0043DDC9 /* NSAttributedString+CCLFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 279E6DDA1BB885AF0043DDC9 /* NSAttributedString+CCLFormat.m */; }; 279E6DDD1BB885BF0043DDC9 /* NSAttributedString+CCLFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 279E6DDC1BB885BF0043DDC9 /* NSAttributedString+CCLFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ @@ -165,11 +165,12 @@ 279E6DB51BB8855B0043DDC9 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0830; ORGANIZATIONNAME = Cocode; TargetAttributes = { 279E6DBD1BB8855B0043DDC9 = { CreatedOnToolsVersion = 7.0; + LastSwiftMigration = 0830; }; 279E6DC71BB8855B0043DDC9 = { CreatedOnToolsVersion = 7.0; @@ -252,8 +253,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 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_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; @@ -297,8 +300,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 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_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; @@ -326,6 +331,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 279E6DE21BB8A4CB0043DDC9 /* UniversalFramework_Framework.xcconfig */; buildSettings = { + CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -338,6 +344,8 @@ PRODUCT_BUNDLE_IDENTIFIER = org.cocode.NSAttributedStringFormat; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -345,6 +353,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 279E6DE21BB8A4CB0043DDC9 /* UniversalFramework_Framework.xcconfig */; buildSettings = { + CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -357,6 +366,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.cocode.NSAttributedStringFormat; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme b/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme index f9363f1..8a6a397 100644 --- a/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme +++ b/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme @@ -1,6 +1,6 @@ Date: Sun, 30 Jul 2017 17:18:26 -0700 Subject: [PATCH 2/4] add nullability to header file replace NSDictionary with id to avoid ambiguous init for Swift --- .../NSAttributedString+CCLFormat.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/NSAttributedStringFormat/NSAttributedString+CCLFormat.h b/NSAttributedStringFormat/NSAttributedString+CCLFormat.h index 71779f6..5341b05 100644 --- a/NSAttributedStringFormat/NSAttributedString+CCLFormat.h +++ b/NSAttributedStringFormat/NSAttributedString+CCLFormat.h @@ -1,5 +1,7 @@ #import +NS_ASSUME_NONNULL_BEGIN + /** Attributed string extension for creating attributed strings from a format string. */ @interface NSAttributedString (CCLFormat) @@ -16,7 +18,7 @@ @param arguments list of arguments to substitute into format. @return An attributed string created by using format as a template into which the remaining argument values are substituted. */ -+ (instancetype)attributedStringWithAttributes:(NSDictionary *)attributes format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); ++ (instancetype)attributedStringWithAttributes:(nullable id)attributes format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); /** Returns an attributed string created by using a given format string as a template into which the remaining argument values are substituted. @param format A format string. This value must not be nil. @@ -31,7 +33,7 @@ @param arguments list of arguments to substitute into format. @return An attributed string created by using format as a template into which the remaining argument values are substituted. */ -+ (instancetype)attributedStringWithAttributes:(NSDictionary *)attributes format:(NSString *)format arguments:(va_list)arguments NS_FORMAT_FUNCTION(2,0); ++ (instancetype)attributedStringWithAttributes:(nullable id)attributes format:(NSString *)format arguments:(va_list)arguments NS_FORMAT_FUNCTION(2,0); /** Returns an attributed string created by using a given format string as a template into which the remaining argument values are substituted. @param format A format string. This value must not be nil. @@ -46,7 +48,7 @@ @param ... A comma-separated list of arguments to substitute into format. @return An attributed string created by using format as a template into which the remaining argument values are substituted. */ -- (instancetype)initWithAttributes:(NSDictionary *)attributes format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); +- (instancetype)initWithAttributes:(nullable id)attributes format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); /** Returns an attributed string created by using a given format string as a template into which the remaining argument values are substituted. @param format A format string. This value must not be nil. @@ -61,7 +63,9 @@ @param arguments list of arguments to substitute into format. @return An attributed string created by using format as a template into which the remaining argument values are substituted. */ -- (instancetype)initWithAttributes:(NSDictionary *)attributes format:(NSString *)format arguments:(va_list)arguments NS_FORMAT_FUNCTION(2,0); +- (instancetype)initWithAttributes:(nullable id)attributes format:(NSString *)format arguments:(va_list)arguments NS_FORMAT_FUNCTION(2,0); @end + +NS_ASSUME_NONNULL_END From c9749c3b3f770e247d67094539c8626a55015db3 Mon Sep 17 00:00:00 2001 From: Toland Hon Date: Tue, 10 Oct 2017 11:45:21 -0700 Subject: [PATCH 3/4] disable build active architecture only --- .../project.pbxproj | 17 +++++++++++++---- .../xcschemes/NSAttributedStringFormat.xcscheme | 4 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/NSAttributedStringFormat.xcodeproj/project.pbxproj b/NSAttributedStringFormat.xcodeproj/project.pbxproj index 30eb245..7f404f5 100644 --- a/NSAttributedStringFormat.xcodeproj/project.pbxproj +++ b/NSAttributedStringFormat.xcodeproj/project.pbxproj @@ -165,7 +165,7 @@ 279E6DB51BB8855B0043DDC9 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Cocode; TargetAttributes = { 279E6DBD1BB8855B0043DDC9 = { @@ -248,14 +248,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -280,8 +286,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -295,14 +299,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -321,7 +331,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme b/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme index 8a6a397..a18dcec 100644 --- a/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme +++ b/NSAttributedStringFormat.xcodeproj/xcshareddata/xcschemes/NSAttributedStringFormat.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 10 Oct 2017 14:58:07 -0700 Subject: [PATCH 4/4] select universal architecture and lower iOS deployment target to 10.3 to support 32-bit --- NSAttributedStringFormat.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NSAttributedStringFormat.xcodeproj/project.pbxproj b/NSAttributedStringFormat.xcodeproj/project.pbxproj index 7f404f5..b921cf5 100644 --- a/NSAttributedStringFormat.xcodeproj/project.pbxproj +++ b/NSAttributedStringFormat.xcodeproj/project.pbxproj @@ -284,6 +284,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -329,6 +330,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; VERSIONING_SYSTEM = "apple-generic"; @@ -340,6 +342,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 279E6DE21BB8A4CB0043DDC9 /* UniversalFramework_Framework.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -362,6 +365,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 279E6DE21BB8A4CB0043DDC9 /* UniversalFramework_Framework.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES;