BASequenceControl to complement UISegmentedControl

I recently needed something like UISegmentedControl but with "direction" theme. As a result BaseAppKit got a new control—BASequenceControl. I've tried to mimic API of the UISegmentedControl and basically it's the same except that now I support only strings in segments.

BASequenceControl

It's customizable; you can provide these two images to completely change the theme of the control:

ba-sequence-item-passive.png


ba-sequence-item-active.png

As selected segment got changed the BASequenceControl sends UIControlEventValueChanged event just like the UISegmentedControl.

  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • LinkedIn
  • E-mail this story to a friend!
  • Print this article!

  • http://johntmcintosh.com John M

    Hi - thanks so much for sharing this control! I'm hoping to utilize it in one of the projects that I'm currently working on. Quick question... I was hoping to setup the control like the "Alpha, Beta, Gamma" version you have shown in your screenshot. However, when I attempt to, it appears like the image I've attached, without showing the "tails" of the arrow in the highlight. I would greatly appreciate any quick insight you could give me on what I'm doing wrong.

        BASequenceControl *sequenceControl = [[BASequenceControl alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];

        [sequenceControl addSegmentWithTitle:@"One" animated:NO];
        [sequenceControl addSegmentWithTitle:@"Two" animated:NO];
        [sequenceControl addSegmentWithTitle:@"Three" animated:NO];    [self.view addSubview:sequenceControl];Thanks!

  • http://www.dimzzy.com/ dimzzy

    You have to set overlapWidth property on it; look at the sample code in BADemo project (search for BADemo on github).

  • http://johntmcintosh.com John M

    Perfect. Many thanks for the insight and the quick reply!

  • http://www.dimzzy.com/ dimzzy

    My pleasure )))

blog comments powered by Disqus