Commit 382a54cb authored by Felix Paul Kühne's avatar Felix Paul Kühne

tap twice gesture recognizer: remove target before it stops to exist

parent 7cb22d72
......@@ -41,11 +41,17 @@
UISearchDisplayController *_searchDisplayController;
UIRefreshControl *_refreshControl;
UIBarButtonItem *_menuButton;
UITapGestureRecognizer *_tapTwiceGestureRecognizer;
}
@end
@implementation VLCLocalPlexFolderListViewController
- (void)dealloc
{
[_tapTwiceGestureRecognizer removeTarget:self action:NULL];
}
- (void)loadView
{
_tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
......@@ -107,9 +113,9 @@
//self.tableView.tableHeaderView = _searchBar;
//self.tableView.contentOffset = CGPointMake(0, CGRectGetHeight(_searchBar.frame)); // -> hide search bar to load
UITapGestureRecognizer *tapTwiceGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[tapTwiceGesture setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:tapTwiceGesture];
_tapTwiceGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[_tapTwiceGestureRecognizer setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:_tapTwiceGestureRecognizer];
// Active le Pull down to refresh
_refreshControl = [[UIRefreshControl alloc] init];
......
......@@ -21,12 +21,18 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
NSMutableArray *_searchData;
UISearchBar *_searchBar;
UISearchDisplayController *_searchDisplayController;
UITapGestureRecognizer *_tapTwiceGestureRecognizer;
}
@end
@implementation VLCNetworkListViewController
- (void)dealloc
{
[_tapTwiceGestureRecognizer removeTarget:self action:NULL];
}
- (void)loadView
{
_tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
......@@ -63,9 +69,9 @@ NSString *VLCNetworkListCellIdentifier = @"VLCNetworkListCellIdentifier";
_searchBar.delegate = self;
_searchBar.hidden = YES;
UITapGestureRecognizer *tapTwiceGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[tapTwiceGesture setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:tapTwiceGesture];
_tapTwiceGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[_tapTwiceGestureRecognizer setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:_tapTwiceGestureRecognizer];
self.navigationItem.rightBarButtonItem = [UIBarButtonItem themedRevealMenuButtonWithTarget:self andSelector:@selector(menuButtonAction:)];
......
......@@ -56,6 +56,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
LXReorderableCollectionViewFlowLayout *_reorderLayout;
BOOL _inFolder;
UILongPressGestureRecognizer *_longPressGestureRecognizer;
UITapGestureRecognizer *_tapTwiceGestureRecognizer;
NSMutableArray *_searchData;
UISearchBar *_searchBar;
......@@ -75,6 +76,11 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
@implementation VLCPlaylistViewController
- (void)dealloc
{
[_tapTwiceGestureRecognizer removeTarget:self action:NULL];
}
+ (void)initialize
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
......@@ -200,9 +206,9 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
_searchBar.delegate = self;
_searchBar.hidden = YES;
UITapGestureRecognizer *tapTwiceGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[tapTwiceGesture setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:tapTwiceGesture];
_tapTwiceGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[_tapTwiceGestureRecognizer setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:_tapTwiceGestureRecognizer];
_searchData = [[NSMutableArray alloc] init];
}
......
......@@ -35,11 +35,17 @@
UISearchDisplayController *_searchDisplayController;
UIRefreshControl *_refreshControl;
UIBarButtonItem *_menuButton;
UITapGestureRecognizer *_tapTwiceGestureRecognizer;
}
@end
@implementation VLCSharedLibraryListViewController
- (void)dealloc
{
[_tapTwiceGestureRecognizer removeTarget:self action:NULL];
}
- (void)loadView
{
_tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
......@@ -101,9 +107,9 @@
_searchBar.delegate = self;
_searchBar.hidden = YES;
UITapGestureRecognizer *tapTwiceGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[tapTwiceGesture setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:tapTwiceGesture];
_tapTwiceGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTwiceGestureAction:)];
[_tapTwiceGestureRecognizer setNumberOfTapsRequired:2];
[self.navigationController.navigationBar addGestureRecognizer:_tapTwiceGestureRecognizer];
// Active le Pull down to refresh
_refreshControl = [[UIRefreshControl alloc] init];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment