Skip to content

Commit 82c3b40

Browse files
committed
After setting utility buttons, call layoutIfNeeded on button view
This fixes button width not being set correctly in some cases on iOS 8. Fixes CEWendel#237
1 parent 3c091c1 commit 82c3b40

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

SWTableViewCell/PodFiles/SWTableViewCell.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ - (void)setLeftUtilityButtons:(NSArray *)leftUtilityButtons
242242
_leftUtilityButtons = leftUtilityButtons;
243243

244244
self.leftUtilityButtonsView.utilityButtons = leftUtilityButtons;
245-
245+
246+
[self.leftUtilityButtonsView layoutIfNeeded];
246247
[self layoutIfNeeded];
247248
}
248249
}
@@ -252,7 +253,8 @@ - (void)setLeftUtilityButtons:(NSArray *)leftUtilityButtons WithButtonWidth:(CGF
252253
_leftUtilityButtons = leftUtilityButtons;
253254

254255
[self.leftUtilityButtonsView setUtilityButtons:leftUtilityButtons WithButtonWidth:width];
255-
256+
257+
[self.leftUtilityButtonsView layoutIfNeeded];
256258
[self layoutIfNeeded];
257259
}
258260

@@ -262,7 +264,8 @@ - (void)setRightUtilityButtons:(NSArray *)rightUtilityButtons
262264
_rightUtilityButtons = rightUtilityButtons;
263265

264266
self.rightUtilityButtonsView.utilityButtons = rightUtilityButtons;
265-
267+
268+
[self.rightUtilityButtonsView layoutIfNeeded];
266269
[self layoutIfNeeded];
267270
}
268271
}
@@ -272,7 +275,8 @@ - (void)setRightUtilityButtons:(NSArray *)rightUtilityButtons WithButtonWidth:(C
272275
_rightUtilityButtons = rightUtilityButtons;
273276

274277
[self.rightUtilityButtonsView setUtilityButtons:rightUtilityButtons WithButtonWidth:width];
275-
278+
279+
[self.rightUtilityButtonsView layoutIfNeeded];
276280
[self layoutIfNeeded];
277281
}
278282

0 commit comments

Comments
 (0)