From 0a51fcb19809e59c108883462fda6739164db4c9 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Thu, 30 Dec 2021 14:14:31 -0500 Subject: Fixes requested by Chariz --- .../QuickActionsPrefs/QASAppSelectorController.m | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'QuickActions/QuickActionsPrefs/QASAppSelectorController.m') diff --git a/QuickActions/QuickActionsPrefs/QASAppSelectorController.m b/QuickActions/QuickActionsPrefs/QASAppSelectorController.m index cadca5c..fb3aba4 100644 --- a/QuickActions/QuickActionsPrefs/QASAppSelectorController.m +++ b/QuickActions/QuickActionsPrefs/QASAppSelectorController.m @@ -1,6 +1,7 @@ #import #import #import +#import #import "QASAppSelectorController.h" #import "LSApplicationProxy+AltList.h" @@ -40,7 +41,8 @@ ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]]]; - _searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; + if (_searchController == nil) + _searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; _searchController.searchResultsUpdater = self; _searchController.obscuresBackgroundDuringPresentation = NO; _searchController.searchBar.delegate = self; @@ -49,6 +51,11 @@ self.navigationItem.hidesSearchBarWhenScrolling = NO; self.definesPresentationContext = YES; + + + if (_feedback == nil) + _feedback = [[UISelectionFeedbackGenerator alloc] init]; + [_feedback prepare]; } -(void)updateSearchResultsForSearchController:(UISearchController *)searchController { @@ -233,6 +240,17 @@ } else if (editingStyle == UITableViewCellEditingStyleInsert) { [self.enabled insertObject:item atIndex:self.enabled.count]; [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:([self.enabled count] - 1) inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; + + switch ([(NSNumber *)[[UIDevice currentDevice] valueForKey:@"_feedbackSupportLevel"] intValue]) { + case 2: + [_feedback selectionChanged]; + break; + case 1: + AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); + break; + default: + break; + } } [tableView endUpdates]; -- cgit v1.2.3-56-ge451