samvermette/SVSegmentedControl — Issue #11: SVSegmentedControl.m
Author: jrespuny
Created: 2011-11-15 11:03:53+00:00
State: open

- (void)willMoveToSuperview:(UIView *)newSuperview {

if(newSuperview == nil)
return;

int c = [self.titlesArray count];
int i = 0;

// self.segmentWidth = 0;

self.segmentWidth = (([UIScreen mainScreen].bounds.size.width) / (([self.titlesArray count] == 0)?1:[self.titlesArray count]));