diff --git a/Demo/LGPlusButtonsViewDemo.xcodeproj/project.pbxproj b/Demo/LGPlusButtonsViewDemo.xcodeproj/project.pbxproj index defa14d..b70915a 100644 --- a/Demo/LGPlusButtonsViewDemo.xcodeproj/project.pbxproj +++ b/Demo/LGPlusButtonsViewDemo.xcodeproj/project.pbxproj @@ -148,6 +148,7 @@ 84C5B7C41A9F22C800EEEB24 /* Frameworks */, 84C5B7C51A9F22C800EEEB24 /* Resources */, 92F9790D16709FEEE544F8D3 /* Copy Pods Resources */, + F9E826B8E08EA21BF3C0A16C /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -164,7 +165,7 @@ 84C5B7BF1A9F22C800EEEB24 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Grigory Lutkov"; TargetAttributes = { 84C5B7C61A9F22C800EEEB24 = { @@ -232,6 +233,21 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; + F9E826B8E08EA21BF3C0A16C /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LGPlusButtonsViewDemo/Pods-LGPlusButtonsViewDemo-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -271,6 +287,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -340,6 +357,7 @@ INFOPLIST_FILE = LGPlusButtonsViewDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.test.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -355,6 +373,7 @@ INFOPLIST_FILE = LGPlusButtonsViewDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.test.$(PRODUCT_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/Demo/LGPlusButtonsViewDemo.xcworkspace/xcshareddata/LGPlusButtonsViewDemo.xcscmblueprint b/Demo/LGPlusButtonsViewDemo.xcworkspace/xcshareddata/LGPlusButtonsViewDemo.xcscmblueprint new file mode 100644 index 0000000..f76229f --- /dev/null +++ b/Demo/LGPlusButtonsViewDemo.xcworkspace/xcshareddata/LGPlusButtonsViewDemo.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "112560B489B85D419BBDB1910B347435FE176202", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "8C7BAE8A443A6327026687B5FEAD2A6BED527DDD" : 0, + "112560B489B85D419BBDB1910B347435FE176202" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "FD3D3D87-9EF8-43C4-A508-88C3E1ECD2E3", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "8C7BAE8A443A6327026687B5FEAD2A6BED527DDD" : "LGDrawer", + "112560B489B85D419BBDB1910B347435FE176202" : "LGPlusButtonsView" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "LGPlusButtonsViewDemo", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Demo\/LGPlusButtonsViewDemo.xcworkspace", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Friend-LGA\/LGPlusButtonsView.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "112560B489B85D419BBDB1910B347435FE176202" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Friend-LGA\/LGDrawer.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8C7BAE8A443A6327026687B5FEAD2A6BED527DDD" + } + ] +} \ No newline at end of file diff --git a/Demo/LGPlusButtonsViewDemo/Info.plist b/Demo/LGPlusButtonsViewDemo/Info.plist index 493646a..7c961f8 100644 --- a/Demo/LGPlusButtonsViewDemo/Info.plist +++ b/Demo/LGPlusButtonsViewDemo/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.test.$(PRODUCT_NAME) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index b247723..59d7e30 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -1,19 +1,17 @@ PODS: - LGDrawer (1.0.0) - - LGPlusButtonsView (1.0.0) + - LGPlusButtonsView (1.0.4) DEPENDENCIES: - - LGDrawer (from `../../LGDrawer`) + - LGDrawer (~> 1.0.0) - LGPlusButtonsView (from `../`) EXTERNAL SOURCES: - LGDrawer: - :path: ../../LGDrawer LGPlusButtonsView: :path: ../ SPEC CHECKSUMS: - LGDrawer: 7ceea97b27a6b23e8eb691210ca180c897025513 - LGPlusButtonsView: a3a7d0c47f99dcce30911541f8d2d255244ab645 + LGDrawer: 14fa657d7e21842797a6187c44d5a913841d34a8 + LGPlusButtonsView: 7a913d5c6670ade0924073b68c482b2f013980c6 -COCOAPODS: 0.37.2 +COCOAPODS: 0.39.0 diff --git a/LGPlusButtonsView.podspec b/LGPlusButtonsView.podspec index daad9a6..ea79f29 100644 --- a/LGPlusButtonsView.podspec +++ b/LGPlusButtonsView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'LGPlusButtonsView' - s.version = '1.0.3' + s.version = '1.0.4' s.platform = :ios, '6.0' s.license = 'MIT' s.homepage = 'https://github.com/Friend-LGA/LGPlusButtonsView' diff --git a/LGPlusButtonsView/LGPlusButtonsView.h b/LGPlusButtonsView/LGPlusButtonsView.h index e36fb35..ae3ba08 100644 --- a/LGPlusButtonsView/LGPlusButtonsView.h +++ b/LGPlusButtonsView/LGPlusButtonsView.h @@ -141,8 +141,11 @@ LGPlusButtonAnimationType; - (void)setButtonsTitles:(NSArray *)titles forState:(UIControlState)state; - (void)setButtonsTitleColor:(UIColor *)titleColor forState:(UIControlState)state; - (void)setButtonsImage:(UIImage *)image forState:(UIControlState)state; +- (void)setButtonsImages:(NSArray *)images forState:(UIControlState)state; - (void)setButtonsBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state; +- (void)setButtonsBackgroundImages:(NSArray *)backgroundImages forState:(UIControlState)state; - (void)setButtonsBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state; +- (void)setButtonsBackgroundColors:(NSArray *)backgroundColors forState:(UIControlState)state; - (void)setButtonsTitleFont:(UIFont *)font; #pragma mark - diff --git a/LGPlusButtonsView/LGPlusButtonsView.m b/LGPlusButtonsView/LGPlusButtonsView.m index d5b658b..f0feeae 100644 --- a/LGPlusButtonsView/LGPlusButtonsView.m +++ b/LGPlusButtonsView/LGPlusButtonsView.m @@ -383,18 +383,58 @@ - (void)setButtonsImage:(UIImage *)image forState:(UIControlState)state if (isChanged) [self layoutInvalidate]; } +- (void)setButtonsImages:(NSArray *)images forState:(UIControlState)state +{ + BOOL isChanged = NO; + + for (NSUInteger i=0; i<_buttons.count; i++) + { + LGPlusButton *button = _buttons[i]; + UIImage *image = images[i]; + + if (!CGSizeEqualToSize(button.imageView.image.size, image.size)) + isChanged = YES; + + [button setImage:image forState:state]; + } + + if (isChanged) [self layoutInvalidate]; +} + - (void)setButtonsBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state { for (LGPlusButton *button in _buttons) [button setBackgroundImage:backgroundImage forState:state]; } +- (void)setButtonsBackgroundImages:(NSArray *)backgroundImages forState:(UIControlState)state +{ + for (NSUInteger i=0; i<_buttons.count; i++) + { + LGPlusButton *button = _buttons[i]; + UIImage *backgroundImage = backgroundImages[i]; + + [button setBackgroundImage:backgroundImage forState:state]; + } +} + - (void)setButtonsBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state { for (LGPlusButton *button in _buttons) [button setBackgroundColor:backgroundColor forState:state]; } +- (void)setButtonsBackgroundColors:(NSArray *)backgroundColors forState:(UIControlState)state +{ + for (NSUInteger i=0; i<_buttons.count; i++) + { + LGPlusButton *button = _buttons[i]; + UIColor *backgroundColor = backgroundColors[i]; + + [button setBackgroundColor:backgroundColor forState:state]; + } +} + - (void)setButtonsTitleFont:(UIFont *)font { BOOL isChanged = NO; @@ -878,6 +918,8 @@ - (void)updatePosition selfOrigin = CGPointMake(parentInset.left+parentOffset.x, parentInset.top+parentOffset.y); } + selfOrigin.x += _offset.x; + selfOrigin.y += _offset.y; CGRect selfFrame = CGRectMake(selfOrigin.x, selfOrigin.y, self.frame.size.width, self.frame.size.height); if ([UIScreen mainScreen].scale == 1.f) selfFrame = CGRectIntegral(selfFrame);