Skip to content

Commit

Permalink
Merge branch 'itomych-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Romero Zurbuchen committed Sep 21, 2015
2 parents 5d8a0f6 + ef45369 commit 3a76cdf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/DZNSegmentedControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,11 @@ - (void)setItems:(NSArray *)items

id firstItem = [items firstObject];

NSPredicate *classPredicate = [NSPredicate predicateWithFormat:@"self isKindOfClass: %@", [firstItem class]];
NSAssert([items filteredArrayUsingPredicate:classPredicate].count == items.count, @"Cannot include different objects in the array. Please make sure to either pass an array of NSString or UIImage objects.");

_imageMode = [firstItem isKindOfClass:[UIImage class]];

NSPredicate *classPredicate = [NSPredicate predicateWithFormat:@"self isKindOfClass: %@", _imageMode ? [UIImage class] : [NSString class]];
NSAssert([items filteredArrayUsingPredicate:classPredicate].count == items.count, @"Cannot include different objects in the array. Please make sure to either pass an array of NSString or UIImage objects.");

_items = [NSArray arrayWithArray:items];

if (!self.imageMode) {
Expand Down Expand Up @@ -727,7 +727,7 @@ - (void)setDisplayCount:(BOOL)count

- (void)setFont:(UIFont *)font
{
if ([self.font.fontName isEqualToString:font.fontName]) {
if ( [self.font.fontName isEqualToString:font.fontName] && self.font.pointSize == font.pointSize ) {
return;
}

Expand Down

0 comments on commit 3a76cdf

Please sign in to comment.