Skip to content

Commit 351f4c2

Browse files
committed
Changed access to frame width and height to recommended methods.
Added AppCode files to gitignore.
1 parent 81a3b61 commit 351f4c2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ ehthumbs.db
88
Thumbs.db
99
xcuserdata/
1010
*.xcuserstate
11-
12-
*.xcuserstate
11+
.idea

Classes/BEMCheckBox.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,15 @@ - (void)initAnimationManager {
8181
}
8282

8383
- (void)layoutSubviews {
84-
self.pathManager.size = self.frame.size.height;
84+
self.pathManager.size = CGRectGetHeight(self.frame);
8585

8686
[super layoutSubviews];
8787
}
8888

89+
- (CGSize)intrinsicContentSize {
90+
return self.frame.size;
91+
}
92+
8993
- (void)reload {
9094
[self.offBoxLayer removeFromSuperlayer];
9195
self.offBoxLayer = nil;
@@ -181,8 +185,8 @@ - (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent *)event;
181185
BOOL found = [super pointInside:point withEvent:event];
182186

183187
CGSize minimumSize = self.minimumTouchSize;
184-
CGFloat width = self.bounds.size.width;
185-
CGFloat height = self.bounds.size.height;
188+
CGFloat width = CGRectGetWidth(self.bounds);
189+
CGFloat height = CGRectGetHeight(self.bounds);
186190

187191
if (found == NO && (width < minimumSize.width || height < minimumSize.height)) {
188192
CGFloat increaseWidth = minimumSize.width - width;
@@ -205,7 +209,7 @@ - (void)drawRect:(CGRect)rect {
205209
*/
206210
- (void)drawEntireCheckBox {
207211
if (!self.hideBox) {
208-
if (!self.offBoxLayer || CGPathGetBoundingBox(self.offBoxLayer.path).size.height == 0.0) {
212+
if (!self.offBoxLayer || CGRectGetHeight(CGPathGetBoundingBox(self.offBoxLayer.path)) == 0.0) {
209213
[self drawOffBox];
210214
}
211215
if (self.on) {

0 commit comments

Comments
 (0)