Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Reordered the tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangrimm committed Apr 6, 2012
1 parent 2481dae commit 29ff9c6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Controllers/MLWFilterViewController.m
Expand Up @@ -81,7 +81,7 @@ - (void)loadView {
[self.loadingView addSubview:spinner];
[spinner release];

self.tabs = [[[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Track", @"Speaker", @"Keyword", nil]] autorelease];
self.tabs = [[[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Keyword", @"Track", @"Speaker", nil]] autorelease];
self.tabs.tintColor = [UIColor colorWithWhite:0.5 alpha:1];
self.tabs.segmentedControlStyle = UISegmentedControlStyleBar;
self.tabs.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
Expand Down Expand Up @@ -131,15 +131,15 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *) tableView {
}

- (NSInteger)tableView:(UITableView *) tableView numberOfRowsInSection:(NSInteger) section {
if(self.tabs.selectedSegmentIndex == 2) {
if(self.tabs.selectedSegmentIndex == 0) {
return 1;
}
return [self resultsForCurrentFacet].count;
}

- (UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *) indexPath {
NSString *cellIdentifier = @"Cell";
if(self.tabs.selectedSegmentIndex == 2) {
if(self.tabs.selectedSegmentIndex == 0) {
cellIdentifier = @"SearchCell";
}

Expand All @@ -152,14 +152,14 @@ - (UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(

cell.accessoryType = UITableViewCellAccessoryNone;

if(self.tabs.selectedSegmentIndex != 2) {
if(self.tabs.selectedSegmentIndex != 0) {
NSArray *results = [self resultsForCurrentFacet];
CCFacetResult *facetResult = [results objectAtIndex:indexPath.row];
cell.textLabel.text = facetResult.label;
if(self.tabs.selectedSegmentIndex == 0 && [facetResult.label isEqualToString:@""]) {
if(self.tabs.selectedSegmentIndex == 1 && [facetResult.label isEqualToString:@""]) {
cell.textLabel.text = @"Unspecified";
}
if(self.tabs.selectedSegmentIndex == 0) {
if(self.tabs.selectedSegmentIndex == 1) {
cell.detailTextLabel.text = [NSString stringWithFormat:@"%i", facetResult.count];
}
else {
Expand Down Expand Up @@ -249,10 +249,10 @@ - (void)doneFiltering:(UIBarButtonItem *)sender {
}

- (NSString *)facetNameForCurrentFacet {
if(self.tabs.selectedSegmentIndex == 0) {
if(self.tabs.selectedSegmentIndex == 1) {
return @"track";
}
if(self.tabs.selectedSegmentIndex == 1) {
if(self.tabs.selectedSegmentIndex == 2) {
return @"speaker";
}
return nil;
Expand Down

0 comments on commit 29ff9c6

Please sign in to comment.