Skip to content

Commit

Permalink
fixed issue with tagged strings
Browse files Browse the repository at this point in the history
  • Loading branch information
howelse committed Sep 21, 2015
1 parent a7c2e26 commit ef45369
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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

0 comments on commit ef45369

Please sign in to comment.