forked from 2359media/STXDynamicTableView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTXButton.m
More file actions
71 lines (55 loc) · 1.21 KB
/
STXButton.m
File metadata and controls
71 lines (55 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// STXButton.m
// STXDynamicTableView
//
// Created by Jesse Armand on 4/2/14.
// Copyright (c) 2014 2359 Media. All rights reserved.
//
#import "STXButton.h"
@interface STXButton ()
@property (strong, nonatomic) UIImage *stx_highlightedImage;
@property (strong, nonatomic) UIImage *stx_normalImage;
@end
@implementation STXButton
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self stx_setupAppearance];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self stx_setupAppearance];
}
return self;
}
- (void)awakeFromNib
{
[super awakeFromNib];
[self stx_setupAppearance];
}
- (void)layoutSubviews
{
[super layoutSubviews];
// Keep the image for each state initially when laying out subviews
if (self.stx_normalImage == nil) {
self.stx_normalImage = [self imageForState:UIControlStateNormal];
}
if (self.stx_highlightedImage == nil) {
self.stx_highlightedImage = [self imageForState:UIControlStateHighlighted];
}
}
- (void)stx_setupAppearance
{
}
- (void)stx_reverseButtonStateAppearance
{
}
- (void)stx_resetButtonStateAppearance
{
}
@end