From 955a31502601e2491b67973a6cb7a86ccd4d2a26 Mon Sep 17 00:00:00 2001 From: Mahesh Shanbhag Date: Thu, 19 Mar 2015 13:14:50 +0530 Subject: [PATCH] Flexibility to choose color for individual texts in VENTokenField --- Podfile.lock | 2 +- VENTokenField.xcodeproj/project.pbxproj | 7 ++++++- .../xcshareddata/xcschemes/VENTokenField.xcscheme | 6 +++++- VENTokenField/VENToken.h | 1 + VENTokenField/VENToken.m | 4 ++++ VENTokenFieldSample/VENTokenFieldSample-Info.plist | 2 +- .../VENTokenFieldSampleTests-Info.plist | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 4066b5e..aeda1c9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -19,4 +19,4 @@ SPEC CHECKSUMS: KIF: ef1691e54e1d969c3b4fd0b5b56a3d7ddf37f216 VENTokenField: b944ad8c46c59fe05376d940919cb56a993db8e0 -COCOAPODS: 0.36.3 +COCOAPODS: 0.37.2 diff --git a/VENTokenField.xcodeproj/project.pbxproj b/VENTokenField.xcodeproj/project.pbxproj index 1931315..4db1800 100644 --- a/VENTokenField.xcodeproj/project.pbxproj +++ b/VENTokenField.xcodeproj/project.pbxproj @@ -248,7 +248,7 @@ B6173DF41952760200E293BB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = Venmo; TargetAttributes = { B692A48B1954D9CA00344E36 = { @@ -441,6 +441,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_TEST_COVERAGE_FILES = YES; @@ -514,6 +515,7 @@ "$(inherited)", ); INFOPLIST_FILE = "VENTokenFieldSample/VENTokenFieldSample-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.venmo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -533,6 +535,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VENTokenFieldSample/VENTokenFieldSample-Prefix.pch"; INFOPLIST_FILE = "VENTokenFieldSample/VENTokenFieldSample-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.venmo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -555,6 +558,7 @@ "$(inherited)", ); INFOPLIST_FILE = "VENTokenFieldSampleTests/VENTokenFieldSampleTests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.venmo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; @@ -574,6 +578,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "VENTokenFieldSample/VENTokenFieldSample-Prefix.pch"; INFOPLIST_FILE = "VENTokenFieldSampleTests/VENTokenFieldSampleTests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "com.venmo.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; diff --git a/VENTokenField.xcodeproj/xcshareddata/xcschemes/VENTokenField.xcscheme b/VENTokenField.xcodeproj/xcshareddata/xcschemes/VENTokenField.xcscheme index cc20cdb..d6114e4 100644 --- a/VENTokenField.xcodeproj/xcshareddata/xcschemes/VENTokenField.xcscheme +++ b/VENTokenField.xcodeproj/xcshareddata/xcschemes/VENTokenField.xcscheme @@ -1,6 +1,7 @@ + LastUpgradeVersion = "0700" + version = "1.8"> @@ -47,6 +48,8 @@ ReferencedContainer = "container:VENTokenField.xcodeproj"> + + diff --git a/VENTokenField/VENToken.h b/VENTokenField/VENToken.h index 21768cb..8c6d41e 100644 --- a/VENTokenField/VENToken.h +++ b/VENTokenField/VENToken.h @@ -27,6 +27,7 @@ @property (assign, nonatomic) BOOL highlighted; @property (copy, nonatomic) void (^didTapTokenBlock) (void); @property (strong, nonatomic) UIColor *colorScheme; +@property (strong, nonatomic, readonly) NSString *title; - (void)setTitleText:(NSString *)text; diff --git a/VENTokenField/VENToken.m b/VENTokenField/VENToken.m index 0b353ab..d06040f 100644 --- a/VENTokenField/VENToken.m +++ b/VENTokenField/VENToken.m @@ -73,6 +73,10 @@ - (void)setColorScheme:(UIColor *)colorScheme [self setHighlighted:_highlighted]; } +- (NSString *)title { + return self.titleLabel.text; +} + #pragma mark - Private diff --git a/VENTokenFieldSample/VENTokenFieldSample-Info.plist b/VENTokenFieldSample/VENTokenFieldSample-Info.plist index 386e5e8..6667e41 100644 --- a/VENTokenFieldSample/VENTokenFieldSample-Info.plist +++ b/VENTokenFieldSample/VENTokenFieldSample-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.venmo.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/VENTokenFieldSampleTests/VENTokenFieldSampleTests-Info.plist b/VENTokenFieldSampleTests/VENTokenFieldSampleTests-Info.plist index 3c4e571..169b6f7 100644 --- a/VENTokenFieldSampleTests/VENTokenFieldSampleTests-Info.plist +++ b/VENTokenFieldSampleTests/VENTokenFieldSampleTests-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.venmo.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType