0

My goal is to create a Segment control with two rows.

Here is an image to paint a picture of my words. enter image description here

I've tried viewing the properties of the UISegmentControl and I thought there would something likes rows or lines, but I can't seem to find anything of the sort. Is this in the scope of a SegmentControl, or is this something that I would have to do in a custom view?

I looked through OBJ C code, but I'm slightly confused as to what he is doing.

[_segmentedControl.subviews enumerateObjectsUsingBlock:^(UIView * obj,     NSUInteger idx, BOOL *stop) {
[obj.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
    if ([obj isKindOfClass:[UILabel class]]) {
        UILabel *_tempLabel = (UILabel *)obj;
        [_tempLabel setNumberOfLines:0];
    }
 }];     
}];

I don't see anything called enumerateObjectsusingBlock, or setNumberOfLines as properties of Segmentcontrol.

bradford gray
  • 537
  • 2
  • 5
  • 18
  • This is a custom control, not UISegmentControl. – KrishnaCA Feb 16 '17 at 20:06
  • Can try creating a view with 6 buttons... – Mr. Xcoder Feb 16 '17 at 20:08
  • @JAL This question was not answered in Swift, only OBJ C. So I don't think it is a duplicate – bradford gray Feb 16 '17 at 20:49
  • @bradfordgray Either way, your question is too broad and not a good fit for Stack Overflow, since you posted an image and asked "How do I build this?" If you edit your question to show your attempt at solving the problem and what specifically isn't working, I will consider reopening your question. – JAL Feb 16 '17 at 20:51
  • Sure, I will give more detail. I just wanted to get straight to the point, but I get you are saying. – bradford gray Feb 16 '17 at 20:53

0 Answers0