views:

76

answers:

0

Hello All,

I have implemented the Tweetie like swipe action on a UITableViewController which has custom drawn cells using a UITableViewCell subclass.

For this I have used the code provided here: http://thermoglobalnuclearwar.com/opensource/

My UITableViewController has a UISearchDisplayController implemented and the searches are working fine and so is the swipe action. However, the search results table does not receive any swipe action and hence the swipe view is not activated in the search results table.

I have added the code as follows

UITableViewController .m file:-

-(void)viewDidLoad {
//swipe init start
TGNWSwipeableTableView * aTableView = [[TGNWSwipeableTableView alloc] initWithFrame:self.tableView.frame style:self.tableView.style];
[aTableView setDelegate:self];
[aTableView setDataSource:self];

[aTableView setSwipeDelegate:self];
[self setTableView:aTableView];

[aTableView release];

[self setAudioPlayers:[NSMutableArray array]];


//swipe init end

searchBar = [[UISearchBar alloc] initWithFrame:self.tableView.bounds];


searchBar.placeholder = @"Search...";
[searchBar sizeToFit];
self.tableView.tableHeaderView = searchBar;

self.tableView.backgroundColor = [UIColor clearColor];


searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
[searchDisplayController setDelegate:self];
[searchDisplayController setSearchResultsDataSource:self];



// Restore search term
if (searchIsActive){

if ([self savedSearchTerm])
{
 [[[self searchDisplayController] searchBar] setText:[self savedSearchTerm]];
}
}
else{
searchIsActive = NO;
}

...

}

UITableViewController .h file:-

@interface MyListTableViewController : UITableViewController <NSFetchedResultsControllerDelegate, UISearchDisplayDelegate, UISearchBarDelegate, TGNWSwipeableTableViewDelegate, AVAudioPlayerDelegate>{
...
}

Please suggest how I could send the swipe gesture action to the search results tableview.

Thanks, Afzal Khan