Q: Test if object is an instance of class UISegment So I'm doing some ugly hacks to modify the appearance of individual segments in a UISegmentedControl. When I walk down the UISegmentedControl's subview array and print each immediate subview's class name, I can see there are instances of UISegment for each segment in the control:
for (UIView *view in [[self segments] subviews])
{
    NSLog(@"%@", NSStringFromClass([view class]));
}

Now apparently Xcode can't resolve this class, so I can't use the familiar [view isKindOfClass:[UISegment class]]. 
I assumed I was just missing a header to include, but I also can't find any docs for it on Apple's developer reference site.
So how would I go about testing if an object is an instance of UISegment? And what exactly is this class - whose name can be resolved at run-time but not at compile-time?

edit
What I'm trying to achieve is a clear indication that a particular segment is enabled or disabled. For instance, when I disable an entire UISegmentedControl, the following works great to update both selected and unselected segment colors/fonts:
- (void)setIsEnabled:(BOOL)isEnabled
{
    [super setIsEnabled:isEnabled];

    // be careful and ensure you use the isEnabled getter because it takes isEnabledForConfiguration into account
    [[self segments] setUserInteractionEnabled:[self isEnabled]];

    [[self segments] setTintColor:[self interactionColor]];

    [[self segments] setTitleTextAttributes:[NSDictionary dictionaryWithObject:[self enabledTextColor]
                                                                        forKey:NSForegroundColorAttributeName]
                                   forState:UIControlStateNormal];
}

But sometimes only a subset of the segments should be disabled, and I would like to visually make that apparent (the -(void)setEnabled:forSegmentAtIndex: method doesn't seem to have any visible effect).
So I've found that I can modify these UISegment subviews to achieve the visual updates (nasty hack, isn't guaranteed to work in the future, I know...). 
To try protecting against those future API changes, I've done my best to implement a flexible way to grab a reference to the UISegment objects by segment index. 
First, I grab the title of the segment at the input segment index, then traverse all the way down the UISegmentedControl view hierarchy until I find something that responds to the text selector and whose text value equals the title. That view always seems to be a UISegmentLabel (which is another private class!), and his superview is the UISegment I'm looking for. So I've come up with:
- (UIView *)getSegmentAtIndex:(NSInteger)index
{
    NSString *title = [[self segments] titleForSegmentAtIndex:index];
    id segment = nil;

    if (nil != title && 0 < [[EFBGlobalUtil trimWhitespace:title] length])
    {
        segment = [[EFBGlobalUtil viewWithCondition:^BOOL(UIView *view)
        {
            return [view respondsToSelector:@selector(text)] && [title isEqualToString:[view valueForKey:NSStringize(text)]];
        }
        inView:[self segments]] /* this dude -> */superview];
    }
    return segment;
}

The question really stems from that superview getter I stuck on the end. I would like to verify the superview is actually a UISegment, but the solution to that will also help me check for UISegmentLabel objects as well (instead of the text selector).

And for reference, here's the +(void)viewWithCondition:inView: utility routine:
+ (UIView *)viewWithCondition:(BOOL (^)(UIView *view))condition inView:(UIView *)view
{
    // non-recursive BFS traversal of a view hierarchy until specified UIView matching condition is found

    NSMutableArray<UIView *> *stack = [[NSMutableArray alloc] initWithObjects:view, nil];
    UIView *curr;

    while ([stack count] > 0)
    {
        curr = [stack firstObject];
        [stack removeObject:curr];

        if (condition((UIView *)curr))
        {
            return (UIView *)curr;
        }

        [stack addObjectsFromArray:[curr subviews]];
    }

    return nil;
}

