diff --git a/Example/LabelConfigurator.xcodeproj/project.pbxproj b/Example/LabelConfigurator.xcodeproj/project.pbxproj index c96db82..ce5b847 100644 --- a/Example/LabelConfigurator.xcodeproj/project.pbxproj +++ b/Example/LabelConfigurator.xcodeproj/project.pbxproj @@ -30,7 +30,7 @@ /* Begin PBXFileReference section */ 0421EC3F8234E10541F1216B /* Pods_LabelConfigurator_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LabelConfigurator_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 191D3E4F2ACE4532F207D5C2 /* Pods_LabelConfigurator_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LabelConfigurator_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 40D27FFCA4F7CCB6A59BBB2B /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; + 40D27FFCA4F7CCB6A59BBB2B /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 415C584FA32087130A683C5A /* Pods-LabelConfigurator_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LabelConfigurator_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LabelConfigurator_Example/Pods-LabelConfigurator_Example.debug.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* LabelConfigurator_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LabelConfigurator_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -42,11 +42,11 @@ 607FACE51AFB9204008FA782 /* LabelConfigurator_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LabelConfigurator_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; - 6098F51071747D0039238E3E /* LabelConfigurator.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = LabelConfigurator.podspec; path = ../LabelConfigurator.podspec; sourceTree = ""; }; + 6098F51071747D0039238E3E /* LabelConfigurator.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LabelConfigurator.podspec; path = ../LabelConfigurator.podspec; sourceTree = ""; }; 6F1188B12FD2691C659B28D0 /* Pods-LabelConfigurator_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LabelConfigurator_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LabelConfigurator_Tests/Pods-LabelConfigurator_Tests.release.xcconfig"; sourceTree = ""; }; 7827A5EDAD5FD5362FE148AE /* Pods-LabelConfigurator_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LabelConfigurator_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LabelConfigurator_Tests/Pods-LabelConfigurator_Tests.debug.xcconfig"; sourceTree = ""; }; 7ABC6A551991980CF3B788E6 /* Pods-LabelConfigurator_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LabelConfigurator_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-LabelConfigurator_Example/Pods-LabelConfigurator_Example.release.xcconfig"; sourceTree = ""; }; - BCB3ED5542E7533581FB0A55 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = ""; }; + BCB3ED5542E7533581FB0A55 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -466,6 +466,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -511,6 +512,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -521,12 +523,13 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = LabelConfigurator/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -536,12 +539,13 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = LabelConfigurator/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -562,7 +566,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -579,7 +583,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 0b722c4..2f3773f 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -541,7 +541,7 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 079A5EF990EFF7E6D3D7B1BDCF6FF72C /* Debug */ = { + 07A95C29B8FA3DCBF3E87DC19C3EF6F7 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = DADAF30F2D84FDAAD2ADD2D50C1F40DF /* FBSnapshotTestCase.xcconfig */; buildSettings = { @@ -564,15 +564,50 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 1354FFA35B87F30A5A575B4ABA640571 /* Release */ = { + 55313F600BC08B00EA814B1C4C532595 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C319B1B4BF81CA4122D98870C84EC7FC /* Pods-LabelConfigurator_Tests.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; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + 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-LabelConfigurator_Tests/Pods-LabelConfigurator_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LabelConfigurator_Tests; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 59212FF961477C8F8F758D7414A345FC /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = DADAF30F2D84FDAAD2ADD2D50C1F40DF /* FBSnapshotTestCase.xcconfig */; buildSettings = { @@ -595,16 +630,15 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - 33DA7F43A1D2FA3C74A8C8FC246E1FA6 /* Debug */ = { + 6F9224530522DD3C735EC96CF142642E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -635,16 +669,13 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", + "POD_CONFIGURATION_RELEASE=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -653,20 +684,18 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SYMROOT = "${SRCROOT}/../build"; }; - name = Debug; + name = Release; }; - 4AF46FC8C834DA5051E0FD7C6321C085 /* Debug */ = { + 6FA7590D4BCC6691D926A015144AA354 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 30C7746823A8647E577BAE3429D401AC /* Pods-LabelConfigurator_Tests.debug.xcconfig */; + baseConfigurationReference = 74217E57C58436F68A2EC7ED3F7312AB /* LabelConfigurator.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -677,62 +706,25 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/LabelConfigurator/LabelConfigurator-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/LabelConfigurator/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/Pods-LabelConfigurator_Tests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_LabelConfigurator_Tests; + MODULEMAP_FILE = "Target Support Files/LabelConfigurator/LabelConfigurator.modulemap"; + PRODUCT_NAME = LabelConfigurator; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 70ABC15E61FA0D7A3B18F1EEFD773FEE /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C319B1B4BF81CA4122D98870C84EC7FC /* Pods-LabelConfigurator_Tests.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; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/Pods-LabelConfigurator_Tests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_LabelConfigurator_Tests; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 731DC216E1A58545B559F6E0A2418060 /* Release */ = { + B57951D085A1B98A97F8A1062A5E5C5B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -763,13 +755,16 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -778,18 +773,20 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SYMROOT = "${SRCROOT}/../build"; }; - name = Release; + name = Debug; }; - 73C707B4D9B26133360FDC9044CF9923 /* Release */ = { + C1F5157359F780C938A5D843DAD1FA75 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BA95ACB711982154901A35DDC02547FD /* Pods-LabelConfigurator_Example.release.xcconfig */; + baseConfigurationReference = 74217E57C58436F68A2EC7ED3F7312AB /* LabelConfigurator.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -800,20 +797,18 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Example/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/LabelConfigurator/LabelConfigurator-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/LabelConfigurator/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-LabelConfigurator_Example/Pods-LabelConfigurator_Example.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_LabelConfigurator_Example; + MODULEMAP_FILE = "Target Support Files/LabelConfigurator/LabelConfigurator.modulemap"; + PRODUCT_NAME = LabelConfigurator; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -821,7 +816,7 @@ }; name = Release; }; - 85DD2DF4E40828D2CD191BB118620897 /* Debug */ = { + C4CD62A2FFCE87F89469765F6C6C954C /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7B9494A263A7E942D67F933834DC8502 /* Pods-LabelConfigurator_Example.debug.xcconfig */; buildSettings = { @@ -836,7 +831,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Example/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + 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-LabelConfigurator_Example/Pods-LabelConfigurator_Example.modulemap"; @@ -855,9 +850,9 @@ }; name = Debug; }; - C58F80A2F77E7EC2E95510931D9A48AA /* Debug */ = { + D1DC4784F568E5D1AF6CA3A9C016F7A2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 74217E57C58436F68A2EC7ED3F7312AB /* LabelConfigurator.xcconfig */; + baseConfigurationReference = BA95ACB711982154901A35DDC02547FD /* Pods-LabelConfigurator_Example.release.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -868,27 +863,30 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/LabelConfigurator/LabelConfigurator-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/LabelConfigurator/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Example/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/LabelConfigurator/LabelConfigurator.modulemap"; - PRODUCT_NAME = LabelConfigurator; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LabelConfigurator_Example/Pods-LabelConfigurator_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LabelConfigurator_Example; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - D2D48098E66EC5D75D339DB8C8C39D90 /* Release */ = { + DB1D176A6D685F31BEAD23AED850C7DB /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 74217E57C58436F68A2EC7ED3F7312AB /* LabelConfigurator.xcconfig */; + baseConfigurationReference = 30C7746823A8647E577BAE3429D401AC /* Pods-LabelConfigurator_Tests.debug.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -899,24 +897,26 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/LabelConfigurator/LabelConfigurator-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/LabelConfigurator/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/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/LabelConfigurator/LabelConfigurator.modulemap"; - PRODUCT_NAME = LabelConfigurator; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LabelConfigurator_Tests/Pods-LabelConfigurator_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_LabelConfigurator_Tests; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; /* End XCBuildConfiguration section */ @@ -924,8 +924,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 33DA7F43A1D2FA3C74A8C8FC246E1FA6 /* Debug */, - 731DC216E1A58545B559F6E0A2418060 /* Release */, + B57951D085A1B98A97F8A1062A5E5C5B /* Debug */, + 6F9224530522DD3C735EC96CF142642E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -933,8 +933,8 @@ 9ACC4682995976B1D466ADCB4CDF6488 /* Build configuration list for PBXNativeTarget "Pods-LabelConfigurator_Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 4AF46FC8C834DA5051E0FD7C6321C085 /* Debug */, - 70ABC15E61FA0D7A3B18F1EEFD773FEE /* Release */, + DB1D176A6D685F31BEAD23AED850C7DB /* Debug */, + 55313F600BC08B00EA814B1C4C532595 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -942,8 +942,8 @@ C4EA367B134C42F00267C2905384F9E7 /* Build configuration list for PBXNativeTarget "Pods-LabelConfigurator_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - 85DD2DF4E40828D2CD191BB118620897 /* Debug */, - 73C707B4D9B26133360FDC9044CF9923 /* Release */, + C4CD62A2FFCE87F89469765F6C6C954C /* Debug */, + D1DC4784F568E5D1AF6CA3A9C016F7A2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -951,8 +951,8 @@ CF26A8367ED018EBD79EFD79BB340251 /* Build configuration list for PBXNativeTarget "LabelConfigurator" */ = { isa = XCConfigurationList; buildConfigurations = ( - C58F80A2F77E7EC2E95510931D9A48AA /* Debug */, - D2D48098E66EC5D75D339DB8C8C39D90 /* Release */, + 6FA7590D4BCC6691D926A015144AA354 /* Debug */, + C1F5157359F780C938A5D843DAD1FA75 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -960,8 +960,8 @@ F28097D43AF5CD8DA838ABD52A053790 /* Build configuration list for PBXNativeTarget "FBSnapshotTestCase" */ = { isa = XCConfigurationList; buildConfigurations = ( - 079A5EF990EFF7E6D3D7B1BDCF6FF72C /* Debug */, - 1354FFA35B87F30A5A575B4ABA640571 /* Release */, + 59212FF961477C8F8F758D7414A345FC /* Debug */, + 07A95C29B8FA3DCBF3E87DC19C3EF6F7 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/LabelConfigurator.podspec b/LabelConfigurator.podspec index eb55729..b764bad 100644 --- a/LabelConfigurator.podspec +++ b/LabelConfigurator.podspec @@ -1,15 +1,8 @@ -# -# Be sure to run `pod lib lint LabelConfigurator.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# Pod::Spec.new do |s| s.name = 'LabelConfigurator' s.version = '0.1.0' - s.summary = 'A short description of LabelConfigurator.' + s.summary = 'The most simple way to configure your UILabels in one go' # This description is used to generate tags and improve search results. # * Think: What does it do? Why did you write it? What is the focus? @@ -18,25 +11,20 @@ Pod::Spec.new do |s| # * Finally, don't worry about the indent, CocoaPods strips it! s.description = <<-DESC -TODO: Add long description of the pod here. +The most simple way to configure your UILabels in one go. +This Library was created to help on the configuration of UILabels on iOS apps. +With this, you can set all your configurations like UIFonts, spacings, UITextColors and so on in one command. +It also helps on the hard task of adding different style to substrings. DESC s.homepage = 'https://github.com/fabioalmeida/LabelConfigurator' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'fabioalmeida' => 'fabio.almeida@farfetch.com' } s.source = { :git => 'https://github.com/fabioalmeida/LabelConfigurator.git', :tag => s.version.to_s } - # s.social_media_url = 'https://twitter.com/' + s.social_media_url = 'https://twitter.com/fabioacalmeida' s.ios.deployment_target = '8.0' + s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' } s.source_files = 'LabelConfigurator/Classes/**/*' - - # s.resource_bundles = { - # 'LabelConfigurator' => ['LabelConfigurator/Assets/*.png'] - # } - - # s.public_header_files = 'Pod/Classes/**/*.h' - # s.frameworks = 'UIKit', 'MapKit' - # s.dependency 'AFNetworking', '~> 2.3' end diff --git a/NSAttributedStringBuilder.swift b/NSAttributedStringBuilder.swift new file mode 100644 index 0000000..95a9ce2 --- /dev/null +++ b/NSAttributedStringBuilder.swift @@ -0,0 +1,209 @@ +// +// NSAttributedStringBuilder.swift +// LabelConfigurator +// +// Created by Fábio Almeida on 12/11/17. +// Copyright (c) 2017 Fábio Almeida. All rights reserved. +// + +import Foundation + +private struct SubstringAttribute { + + let substring: String + let attribute: String + let value: AnyObject +} + +private struct RangeAttribute { + + let range: NSRange + let attribute: String + let value: AnyObject +} + +open class NSAttributedStringBuilder: NSObject { + + // MARK: Properties + fileprivate let string: String + fileprivate var textColor: UIColor? + fileprivate var textFont: UIFont? + fileprivate var fontTracking: CGFloat? + fileprivate var textAlignment: NSTextAlignment? + fileprivate var lineSpacing: CGFloat? + fileprivate var substringAttributes: [SubstringAttribute]? + fileprivate var rangeAttributes: [RangeAttribute]? + + public init(withString string: String) { + + self.string = string + } + + // MARK: Public + + open func attributedString() -> NSAttributedString { + + return self.generateAttributedString() + } + + @discardableResult + @objc(setTextColor:) + open func set(textColor color: UIColor) -> NSAttributedStringBuilder { + + self.textColor = color + return self + } + + @discardableResult + @objc(setFont:) + open func set(font: UIFont) -> NSAttributedStringBuilder { + + self.textFont = font + return self + } + + @discardableResult + @objc(setFontTracking:) + open func set(fontTracking tracking: CGFloat) -> NSAttributedStringBuilder { + + self.fontTracking = tracking + return self + } + + @discardableResult + @objc(setTextAlignment:) + open func set(textAlignment alignment: NSTextAlignment) -> NSAttributedStringBuilder { + + self.textAlignment = alignment + return self + } + + @discardableResult + @objc(setLineSpacing:) + open func set(lineSpacing spacing: CGFloat) -> NSAttributedStringBuilder { + + self.lineSpacing = spacing + return self + } + + @discardableResult + @objc(setFont:onSubstring:) + open func set(font: UIFont?, onSubstring substring: String?) -> NSAttributedStringBuilder { + + return self.set(attribute: NSFontAttributeName, value: font, onSubstring: substring) + } + + @discardableResult + @objc(setTextColor:onSubstring:) + open func set(textColor color: UIColor?, onSubstring substring: String?) -> NSAttributedStringBuilder { + + return self.set(attribute: NSForegroundColorAttributeName, value: color, onSubstring: substring) + } + + @discardableResult + @objc(setAttribute:value:onSubstring:) + open func set(attribute: String?, value: AnyObject?, onSubstring substring: String?) -> NSAttributedStringBuilder { + + if let attribute = attribute, let value = value, let substring = substring { + + let substringAttribute = SubstringAttribute(substring: substring, attribute: attribute, value: value) + + if self.substringAttributes == nil { + + self.substringAttributes = [SubstringAttribute]() + } + + self.substringAttributes?.append(substringAttribute) + } + + return self + } + + @discardableResult + @objc(setAttribute:value:onRange:) + open func set(attribute: String?, value: AnyObject?, onRange range: NSRange) -> NSAttributedStringBuilder { + + if let attribute = attribute, let value = value { + + let rangeAttribute = RangeAttribute(range: range, attribute: attribute, value: value) + + if self.rangeAttributes == nil { + + self.rangeAttributes = [RangeAttribute]() + } + + self.rangeAttributes?.append(rangeAttribute) + } + + return self + } +} + + +// MARK: - Private +private extension NSAttributedStringBuilder { + + func generateAttributedString() -> NSAttributedString { + + let stringText = NSString(string: self.string) + let fullRange = NSMakeRange(0, stringText.length) + let attributedString = NSMutableAttributedString(string: self.string) + + if let textColor = self.textColor { + + attributedString.addAttribute(NSForegroundColorAttributeName, value: textColor, range: fullRange) + } + + if let textFont = self.textFont { + + attributedString.addAttribute(NSFontAttributeName, value: textFont, range: fullRange) + } + + if let fontTracking = self.fontTracking { + + attributedString.addAttribute(NSKernAttributeName, value: fontTracking, range: fullRange) + } + + var paragraphStyle: NSMutableParagraphStyle? + + if let lineSpacing = self.lineSpacing { + + paragraphStyle = NSMutableParagraphStyle() + paragraphStyle?.lineSpacing = lineSpacing + } + + if let textAlignment = self.textAlignment { + + if (paragraphStyle == nil) { + + paragraphStyle = NSMutableParagraphStyle() + } + + paragraphStyle?.alignment = textAlignment + } + + if let paragraphStyle = paragraphStyle { + + attributedString.addAttribute(NSParagraphStyleAttributeName, value: paragraphStyle, range: fullRange) + } + + if let substringAttributes = self.substringAttributes { + + substringAttributes.forEach({ (attribute: SubstringAttribute) in + + let range = stringText.range(of: attribute.substring) + attributedString.addAttribute(attribute.attribute, value: attribute.value, range: range) + }) + } + + if let rangeAttributes = self.rangeAttributes { + + rangeAttributes.forEach({ (attribute: RangeAttribute) in + + attributedString.addAttribute(attribute.attribute, value: attribute.value, range: attribute.range) + }) + } + + return attributedString + } +} diff --git a/UILabel+LabelConfigurator.swift b/UILabel+LabelConfigurator.swift new file mode 100644 index 0000000..deb1fa8 --- /dev/null +++ b/UILabel+LabelConfigurator.swift @@ -0,0 +1,17 @@ +// +// UILabel+LabelConfigurator.swift +// LabelConfigurator +// +// Created by Fábio Almeida on 12/11/17. +// Copyright (c) 2017 Fábio Almeida. All rights reserved. +// + +import Foundation + +public extension UILabel { + + public func setLabelText(_ text: String?) -> UILabelBuilder { + + return UILabelBuilder(withLabel: self, text: text ?? "") + } +} diff --git a/UILabelBuilder.swift b/UILabelBuilder.swift new file mode 100644 index 0000000..7f0eff4 --- /dev/null +++ b/UILabelBuilder.swift @@ -0,0 +1,187 @@ +// +// UILabelBuilder.swift +// LabelConfigurator +// +// Created by Fábio Almeida on 12/11/17. +// Copyright (c) 2017 Fábio Almeida. All rights reserved. +// + +import Foundation + +open class UILabelBuilder: NSObject { + + // MARK: Properties + fileprivate let label: UILabel + fileprivate let text: String + fileprivate var textColor: UIColor? + fileprivate var backgroundColor: UIColor? + fileprivate var font: UIFont? + fileprivate var minimumFontSize: CGFloat? + fileprivate var textAlignment: NSTextAlignment? + fileprivate var shouldSetAttributedText: Bool + fileprivate lazy var attributedStringBuilder: NSAttributedStringBuilder = { + + return NSAttributedStringBuilder(withString: self.text) + }() + + init(withLabel label: UILabel, text: String) { + + self.label = label + self.text = text + self.shouldSetAttributedText = false + super.init() + } + + // MARK: Public + + open func configure() { + + self.configureLabel() + } + + @discardableResult + @objc(setTextColor:) + open func set(textColor color: UIColor) -> UILabelBuilder { + + self.textColor = color + return self + } + + @discardableResult + @objc(setBackgroundColor:) + open func set(backgroundColor color: UIColor) -> UILabelBuilder { + + self.backgroundColor = color + return self + } + + @discardableResult + @objc(setFont:) + open func set(font: UIFont) -> UILabelBuilder { + + self.font = font + return self + } + + @discardableResult + @objc(setAlignment:) + open func set(alignment: NSTextAlignment) -> UILabelBuilder { + + self.textAlignment = alignment + return self + } + + @discardableResult + @objc(setMinimumFontSize:) + open func set(minimumFontSize size: CGFloat) -> UILabelBuilder { + + self.minimumFontSize = size + return self + } + + @discardableResult + @objc(setFontTracking:) + open func set(fontTracking tracking: CGFloat) -> UILabelBuilder { + + self.attributedStringBuilder.set(fontTracking: tracking) + self.shouldSetAttributedText = true + return self + } + + @discardableResult + @objc(setLineSpacing:) + open func set(lineSpacing spacing: CGFloat) -> UILabelBuilder { + + self.attributedStringBuilder.set(lineSpacing: spacing) + self.shouldSetAttributedText = true + return self + } + + @discardableResult + @objc(setFont:onSubstring:) + open func set(font: UIFont, onSubstring substring: String) -> UILabelBuilder { + + self.attributedStringBuilder.set(font: font, onSubstring: substring) + self.shouldSetAttributedText = true + return self + } + + @discardableResult + @objc(setTextColor:onSubstring:) + open func set(textColor color: UIColor, onSubstring substring: String) -> UILabelBuilder { + + self.attributedStringBuilder.set(textColor: color, onSubstring: substring) + self.shouldSetAttributedText = true + return self + } + + @discardableResult + @objc(setAttribute:value:onSubstring:) + open func set(attribute: String, value: AnyObject, onSubstring substring: String) -> UILabelBuilder { + + self.attributedStringBuilder.set(attribute: attribute, value: value, onSubstring: substring) + self.shouldSetAttributedText = true + return self + } + + @discardableResult + @objc(setAttribute:value:onRange:) + open func set(attribute: String, value: AnyObject, onRange range: NSRange) -> UILabelBuilder { + + self.attributedStringBuilder.set(attribute: attribute, value: value, onRange: range) + self.shouldSetAttributedText = true + return self + } +} + + +// MARK: - Private +private extension UILabelBuilder { + + func configureLabel() { + + if let textAlignment = self.textAlignment { + + if self.shouldSetAttributedText { + + self.attributedStringBuilder.set(textAlignment: textAlignment) + + } else { + + self.label.textAlignment = textAlignment + } + } + + if !self.shouldSetAttributedText { + + self.label.text = self.text + } + + if let textColor = self.textColor { + + self.label.textColor = textColor + } + + if let backgroundColor = self.backgroundColor { + + self.label.backgroundColor = backgroundColor + } + + if let font = self.font { + + self.label.font = font + + if let minimumFontSize = self.minimumFontSize { + + self.label.adjustsFontSizeToFitWidth = true + self.label.minimumScaleFactor = minimumFontSize/font.pointSize + } + } + + if self.shouldSetAttributedText { + + let attributedString = self.attributedStringBuilder.attributedString() + self.label.attributedText = attributedString + } + } +}