Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Remove UIButton-ANDYHighlighted #548

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@
148AAC211BEA5A26007AB12F /* FORMCustomStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FORMCustomStyle.h; sourceTree = "<group>"; };
148AAC221BEA5A26007AB12F /* FORMCustomStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FORMCustomStyle.m; sourceTree = "<group>"; };
148AAC241BEA5A3A007AB12F /* forms.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = forms.json; sourceTree = "<group>"; };
148B812C1DB7FFF500381A95 /* UIColor+FORMImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIColor+FORMImage.h"; sourceTree = "<group>"; };
148B812D1DB7FFF500381A95 /* UIColor+FORMImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+FORMImage.m"; sourceTree = "<group>"; };
14B0B2421C24BC1D003633BD /* SubtitleField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubtitleField.swift; sourceTree = "<group>"; };
14BD55DE1BEA538C0043A673 /* HYPImageFormFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HYPImageFormFieldCell.h; sourceTree = "<group>"; };
14BD55DF1BEA538C0043A673 /* HYPImageFormFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HYPImageFormFieldCell.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -722,6 +724,8 @@
140803C91BEA50AB0098C288 /* UIDevice+HYPRealOrientation.m */,
140803CA1BEA50AB0098C288 /* UIViewController+HYPTopViewController.h */,
140803CB1BEA50AB0098C288 /* UIViewController+HYPTopViewController.m */,
148B812C1DB7FFF500381A95 /* UIColor+FORMImage.h */,
148B812D1DB7FFF500381A95 /* UIColor+FORMImage.m */,
);
path = Others;
sourceTree = "<group>";
Expand Down
1 change: 0 additions & 1 deletion Form.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ Pod::Spec.new do |s|
s.dependency 'NSString-HYPRelationshipParser', '~> 0.4.1'
s.dependency 'NSString-HYPWordExtractor', '~> 1.2'
s.dependency 'NSString-ZENInflections', '~> 1.2'
s.dependency 'UIButton-ANDYHighlighted', '~> 1.0.0'
s.dependency 'UIViewController-HYPKeyboardToolbar', '~> 0.1'
end
7 changes: 2 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Form (3.11.0):
- Form (3.12.0):
- Hex (~> 5.0.0)
- HYP8601 (~> 0.7.2)
- HYPMathParser (~> 0.4.1)
Expand All @@ -14,7 +14,6 @@ PODS:
- NSString-HYPRelationshipParser (~> 0.4.1)
- NSString-HYPWordExtractor (~> 1.2)
- NSString-ZENInflections (~> 1.2)
- UIButton-ANDYHighlighted (~> 1.0.0)
- UIViewController-HYPKeyboardToolbar (~> 0.1)
- Hex (5.0.0)
- HYP8601 (0.7.2)
Expand All @@ -35,7 +34,6 @@ PODS:
- NSString-HYPRelationshipParser (0.4.1)
- NSString-HYPWordExtractor (1.2)
- NSString-ZENInflections (1.2)
- UIButton-ANDYHighlighted (1.0.0)
- UIViewController-HYPKeyboardToolbar (0.1)

DEPENDENCIES:
Expand All @@ -49,7 +47,7 @@ EXTERNAL SOURCES:
:path: "."

SPEC CHECKSUMS:
Form: 40f309d8de442d457eef47f4100c18c7c5bb266a
Form: 2f32510ab694bf22e95471b385be9899efaf6c27
Hex: 024e4dba5d5a9351e7817713f3dee61553258dcd
HYP8601: 0118757c1332620748c75e7218e7b6b849686d06
HYPImagePicker: 5c6e463ec15ae6b647355eb11f3f310342616fbf
Expand All @@ -67,7 +65,6 @@ SPEC CHECKSUMS:
NSString-HYPRelationshipParser: 7fa231131e408f26b3b72a41157aa6620a195b4d
NSString-HYPWordExtractor: 7484da8d2d23e41b24b0bdb218293ab349f9f650
NSString-ZENInflections: 35ae6d02981b1def07bd6dc8e6455e827453bc29
UIButton-ANDYHighlighted: da99b536b0b4a3c8d86c15c9b38cb10fddb09be6
UIViewController-HYPKeyboardToolbar: d5cb85447caeaf9e0e7ed575ce3b1576c7d53dd8

PODFILE CHECKSUM: 0cd0340ed2ef2438b11e00aca5204da977f80e34
Expand Down
11 changes: 7 additions & 4 deletions Source/Cells/Button/FORMButtonFieldCell.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "FORMButtonFieldCell.h"
#import "UIButton+ANDYHighlighted.h"
@import Hex;
#import "UIColor+FORMImage.h"

static NSString * const FORMButtonTitleLabelFontKey = @"font";
static NSString * const FORMButtonTitleLabelFontSizeKey = @"font_size";
Expand Down Expand Up @@ -129,7 +129,8 @@ - (void)setHighlightedTitleColor:(UIColor *)highlightedTitleColor {
if ([style length] > 0) {
highlightedTitleColor = [[UIColor alloc] initWithHex:style];
}
self.button.highlightedTitleColor = highlightedTitleColor;

[self.button setTitleColor:highlightedTitleColor forState:UIControlStateHighlighted];
}

- (void)setBorderColor:(UIColor *)borderColor {
Expand All @@ -145,15 +146,17 @@ - (void)setHighlightedBackgroundColor:(UIColor *)highlightedBackgroundColor {
if ([style length] > 0) {
highlightedBackgroundColor = [[UIColor alloc] initWithHex:style];
}
self.button.highlightedBackgroundColor = highlightedBackgroundColor;

[self.button setBackgroundImage:[highlightedBackgroundColor form_image] forState:UIControlStateHighlighted];
}

- (void)setTitleColor:(UIColor *)titleColor {
NSString *style = [self.field.styles valueForKey:FORMButtonTitleColorKey];
if ([style length] > 0) {
titleColor = [[UIColor alloc] initWithHex:style];
}
self.button.titleColor = titleColor;

[self.button setTitleColor:titleColor forState:UIControlStateNormal];
}

- (void)setBackgroundColor:(UIColor *)backgroundColor {
Expand Down
7 changes: 7 additions & 0 deletions Source/Others/UIColor+FORMImage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import UIKit;

@interface UIColor (FORMImage)

- (UIColor *)form_image;

@end
20 changes: 20 additions & 0 deletions Source/Others/UIColor+FORMImage.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@import UIKit;

#import "UIColor+FORMImage.h"

@implementation UIColor (FORMImage)

- (UIColor *)form_image {
CGRect rect = CGRectMake(0, 0, 1, 1);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [self CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

return image;
}

@end