Skip to content

Commit 0a79cd5

Browse files
committed
Moved AccountActionButton into Views, added methods to style the button
1 parent 3d63159 commit 0a79cd5

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

BitStore.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@
9292
9A9D588019D1F63200EA940A /* Keys.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A19022C19A0FAD7008D928B /* Keys.m */; };
9393
9A9D588319D1F73800EA940A /* SharedUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D588219D1F73800EA940A /* SharedUser.m */; };
9494
9A9D588419D1F8F200EA940A /* SharedUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D588219D1F73800EA940A /* SharedUser.m */; };
95-
9A9D588519D20FA700EA940A /* AccountActionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ACA5B711969F037005C7BF8 /* AccountActionButton.m */; };
9695
9A9D588819D484C900EA940A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A9D588A19D484C900EA940A /* Localizable.strings */; };
96+
9A9D588E19D4867400EA940A /* AccountActionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D588D19D4867400EA940A /* AccountActionButton.m */; };
97+
9A9D588F19D4867700EA940A /* AccountActionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D588D19D4867400EA940A /* AccountActionButton.m */; };
9798
9AA466BC1972D82A00A7B562 /* Color.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AA466BB1972D82A00A7B562 /* Color.m */; };
9899
9AA6C44C1986FAFA0035A430 /* HTAutocompleteTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AA6C44B1986FAFA0035A430 /* HTAutocompleteTextField.m */; };
99100
9AAAC41E19D092FE00994EB6 /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AAAC41D19D092FE00994EB6 /* NotificationCenter.framework */; };
@@ -112,7 +113,6 @@
112113
9ABC072F198318D100EC87A3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9ABC072E198318D100EC87A3 /* SystemConfiguration.framework */; };
113114
9ABC07311983191E00EC87A3 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9ABC07301983191E00EC87A3 /* MobileCoreServices.framework */; };
114115
9ABC073419831C8900EC87A3 /* ReceiveAmountViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC073319831C8900EC87A3 /* ReceiveAmountViewController.m */; };
115-
9ACA5B721969F037005C7BF8 /* AccountActionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ACA5B711969F037005C7BF8 /* AccountActionButton.m */; };
116116
9ADFAD57194F8116009427DF /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9ADFAD56194F8116009427DF /* AVFoundation.framework */; };
117117
9AFC4A14197F0F8400EAF46B /* KeysViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AFC4A13197F0F8400EAF46B /* KeysViewController.m */; };
118118
A423E0B434094809ABF9EF1D /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBA31FE505D94F7097170EA0 /* libPods.a */; };
@@ -318,6 +318,8 @@
318318
9A9D588219D1F73800EA940A /* SharedUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SharedUser.m; sourceTree = "<group>"; };
319319
9A9D588919D484C900EA940A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
320320
9A9D588B19D484CE00EA940A /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
321+
9A9D588C19D4867400EA940A /* AccountActionButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccountActionButton.h; sourceTree = "<group>"; };
322+
9A9D588D19D4867400EA940A /* AccountActionButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccountActionButton.m; sourceTree = "<group>"; };
321323
9AA466BA1972D82A00A7B562 /* Color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Color.h; sourceTree = "<group>"; };
322324
9AA466BB1972D82A00A7B562 /* Color.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Color.m; sourceTree = "<group>"; };
323325
9AA6C44A1986FAFA0035A430 /* HTAutocompleteTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTAutocompleteTextField.h; sourceTree = "<group>"; };
@@ -353,8 +355,6 @@
353355
9ABC073219831C8900EC87A3 /* ReceiveAmountViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReceiveAmountViewController.h; sourceTree = "<group>"; };
354356
9ABC073319831C8900EC87A3 /* ReceiveAmountViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReceiveAmountViewController.m; sourceTree = "<group>"; };
355357
9ABC073519832FD100EC87A3 /* ReceiveAmountDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReceiveAmountDelegate.h; sourceTree = "<group>"; };
356-
9ACA5B701969F037005C7BF8 /* AccountActionButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccountActionButton.h; sourceTree = "<group>"; };
357-
9ACA5B711969F037005C7BF8 /* AccountActionButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccountActionButton.m; sourceTree = "<group>"; };
358358
9ADFAD56194F8116009427DF /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
359359
9AF0C4F5196B3A0200F62DB5 /* iOSFix.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iOSFix.h; sourceTree = "<group>"; };
360360
9AF0C4F6196B3C3400F62DB5 /* BitStore.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = BitStore.entitlements; sourceTree = "<group>"; };
@@ -590,8 +590,6 @@
590590
children = (
591591
9ABC07171983171000EC87A3 /* Receive */,
592592
9ABC071C1983171000EC87A3 /* Send */,
593-
9ACA5B701969F037005C7BF8 /* AccountActionButton.h */,
594-
9ACA5B711969F037005C7BF8 /* AccountActionButton.m */,
595593
9A67A6F01950D70A001FCE32 /* AccountNavigationController.h */,
596594
9A67A6F11950D70A001FCE32 /* AccountNavigationController.m */,
597595
9A67A6F21950D70A001FCE32 /* AccountViewController.h */,
@@ -848,6 +846,8 @@
848846
9ABC07291983173300EC87A3 /* Views */ = {
849847
isa = PBXGroup;
850848
children = (
849+
9A9D588C19D4867400EA940A /* AccountActionButton.h */,
850+
9A9D588D19D4867400EA940A /* AccountActionButton.m */,
851851
9ABC072A1983174100EC87A3 /* AmountView.h */,
852852
9ABC072B1983174100EC87A3 /* AmountView.m */,
853853
9ABC072D1983175300EC87A3 /* AmountViewDelegate.h */,
@@ -1101,7 +1101,6 @@
11011101
9A1DAEC1197BD72900BB9DF7 /* Job.m in Sources */,
11021102
9A8D3C50195E248C00E88A1C /* ChangeCurrencyViewController.m in Sources */,
11031103
9A67A77B1950D70A001FCE32 /* qrspec.c in Sources */,
1104-
9ACA5B721969F037005C7BF8 /* AccountActionButton.m in Sources */,
11051104
9ABC07241983171000EC87A3 /* ReceiveNavigationController.m in Sources */,
11061105
9A67A7761950D70A001FCE32 /* bitstream.c in Sources */,
11071106
9A67A75D1950D70A001FCE32 /* ChooseContactsViewController.m in Sources */,
@@ -1152,6 +1151,7 @@
11521151
9A8D3C46195E246D00E88A1C /* ShopsNavigationController.m in Sources */,
11531152
9A67A75F1950D70A001FCE32 /* ContactsViewController.m in Sources */,
11541153
9A67A76A1950D70A001FCE32 /* RequestHelper.m in Sources */,
1154+
9A9D588E19D4867400EA940A /* AccountActionButton.m in Sources */,
11551155
9A67A7561950D70A001FCE32 /* AppDelegate.m in Sources */,
11561156
9ABC071619830FB800EC87A3 /* Listeners.m in Sources */,
11571157
);
@@ -1172,7 +1172,7 @@
11721172
9A9D588019D1F63200EA940A /* Keys.m in Sources */,
11731173
9AAAC42419D092FE00994EB6 /* TodayViewController.m in Sources */,
11741174
9A9D588419D1F8F200EA940A /* SharedUser.m in Sources */,
1175-
9A9D588519D20FA700EA940A /* AccountActionButton.m in Sources */,
1175+
9A9D588F19D4867700EA940A /* AccountActionButton.m in Sources */,
11761176
);
11771177
runOnlyForDeploymentPostprocessing = 0;
11781178
};

BitStore/Controller/Account/AccountActionButton.h renamed to BitStore/Views/AccountActionButton.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@property (nonatomic) CGFloat padding;
1414

1515
- (id)initWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage;
16+
- (void)setTintColor:(UIColor *)tintColor;
17+
- (void)setSelectedTintColor:(UIColor *)selectedTintColor;
1618

1719
- (id)init UNAVAILABLE_ATTRIBUTE;
1820
- (id)initWithCoder:(NSCoder *)aDecoder UNAVAILABLE_ATTRIBUTE;

BitStore/Controller/Account/AccountActionButton.m renamed to BitStore/Views/AccountActionButton.m

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,23 @@ - (id)initWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIIm
1717
[self setImage:selected forState:UIControlStateHighlighted];
1818
[self setImage:selected forState:UIControlStateSelected];
1919
[self setTitle:title forState:UIControlStateNormal];
20-
self.tintColor = [UIColor colorWithWhite:0.6 alpha:1.0];
21-
[self setTitleColor:self.tintColor forState:UIControlStateNormal];
22-
[self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
23-
[self setTitleColor:[UIColor grayColor] forState:UIControlStateSelected];
20+
[self setTintColor:[UIColor colorWithWhite:0.6 alpha:1.0]];
21+
[self setSelectedTintColor:[UIColor colorWithWhite:0.5 alpha:1.0]];
2422
self.titleLabel.font = [UIFont systemFontOfSize:12];
2523
}
2624
return self;
2725
}
2826

27+
- (void)setTintColor:(UIColor *)tintColor {
28+
[super setTintColor:tintColor];
29+
[self setTitleColor:tintColor forState:UIControlStateNormal];
30+
}
31+
32+
- (void)setSelectedTintColor:(UIColor *)selectedTintColor {
33+
[self setTitleColor:selectedTintColor forState:UIControlStateHighlighted];
34+
[self setTitleColor:selectedTintColor forState:UIControlStateSelected];
35+
}
36+
2937
- (void)layoutSubviews {
3038
[super layoutSubviews];
3139

0 commit comments

Comments
 (0)