Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-29-2010, 11:25 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 15
orca is on a distinguished road
Default How to add my swipe code to UISearchDisplayController's SearchResultsTableView

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: Open Source

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:-

Code:
-(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:-

Code:
@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
orca is offline   Reply With Quote
Old 08-30-2010, 07:50 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 15
orca is on a distinguished road
Default

Bump!

Anyone has an advice on this? Is there a possibility to implement a uitableviewcontroller subclasss to the search results table?

Thanks,
Afzal Khan
orca is offline   Reply With Quote
Old 08-30-2010, 04:53 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 15
orca is on a distinguished road
Default

Ok. some progress.
When i add the following code, i can swipe the search results but can not scroll them. Any ideas whats going on here?

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 
if(tableView == self.searchDisplayController.searchResultsTableView){ 
tableView.hidden = YES; 
} 
... 
}

Last edited by orca; 08-30-2010 at 04:53 PM. Reason: formatting
orca is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone-sdk, swipe, uisearchdisplaycontroller, uitableviewcontroller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 350
6 members and 344 guests
dre, freewind, hain, HemiMG, lendo, Newbie123
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:00 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0