From 92addfe0e712956ece0f86a7f76474b44519c191 Mon Sep 17 00:00:00 2001 From: David Benko Date: Wed, 14 May 2014 16:25:16 -0400 Subject: [PATCH] Fix to orientation change drawing issues removes old columns before drawing new ones in layoutSubviews: --- KLScrollSelect/KLScrollSelect/KLScrollSelect.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KLScrollSelect/KLScrollSelect/KLScrollSelect.m b/KLScrollSelect/KLScrollSelect/KLScrollSelect.m index dd854cc..36d6044 100644 --- a/KLScrollSelect/KLScrollSelect/KLScrollSelect.m +++ b/KLScrollSelect/KLScrollSelect/KLScrollSelect.m @@ -71,6 +71,11 @@ -(void) synchronizeColumnsForMainDriver { [self synchronizeContentOffsetsWithDriver: self.driver]; } -(void) populateColumns { + + for(KLScrollingColumn *column in self.columns){ + [column removeFromSuperview]; + } + NSInteger numberOfColumns = [self numberOfColumnsInScrollSelect:self]; NSMutableArray* columns = [[NSMutableArray alloc] initWithCapacity:numberOfColumns]; CGFloat columnWidth = self.frame.size.width/[self numberOfColumnsInScrollSelect:self]; @@ -428,4 +433,4 @@ -(NSInteger) row return self->_innerIndexPath.row; } -@end \ No newline at end of file +@end