From c48de571667a184fa68d572d7c0ead74150dffde Mon Sep 17 00:00:00 2001 From: Matteo Gazzato Date: Thu, 18 Feb 2016 12:27:37 +0100 Subject: [PATCH] Left utility buttons visible on first load As described in this issue https://github.com/CEWendel/SWTableViewCell/issues/353, on the first load of the view, cells show the left utility buttons. This solve the problem --- SWTableViewCell/PodFiles/SWTableViewCell.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SWTableViewCell/PodFiles/SWTableViewCell.m b/SWTableViewCell/PodFiles/SWTableViewCell.m index 3daceac..89aa0ec 100644 --- a/SWTableViewCell/PodFiles/SWTableViewCell.m +++ b/SWTableViewCell/PodFiles/SWTableViewCell.m @@ -301,8 +301,16 @@ - (void)didMoveToSuperview - (void)layoutSubviews { - [super layoutSubviews]; - + + BOOL isPad = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad; + if (isPad == YES) { + layoutUpdating = YES; + [super layoutSubviews]; + layoutUpdating = NO; + } else { + [super layoutSubviews]; + } + // Offset the contentView origin so that it appears correctly w/rt the enclosing scroll view (to which we moved it). CGRect frame = self.contentView.frame; frame.origin.x = [self leftUtilityButtonsWidth];