summaryrefslogtreecommitdiffstats
path: root/QuickActions/QuickActionsPrefs
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-12-30 14:14:31 -0500
committerCameron Katri <me@cameronkatri.com>2021-12-30 14:14:31 -0500
commit0a51fcb19809e59c108883462fda6739164db4c9 (patch)
tree13c14da5dba0e7949686892f645c730469a4c5d7 /QuickActions/QuickActionsPrefs
parentdbb81e49619702f4dc8aea826439cff80cbcdfd4 (diff)
downloadtweaks-0a51fcb19809e59c108883462fda6739164db4c9.tar.gz
tweaks-0a51fcb19809e59c108883462fda6739164db4c9.tar.zst
tweaks-0a51fcb19809e59c108883462fda6739164db4c9.zip
Fixes requested by Chariz
Diffstat (limited to 'QuickActions/QuickActionsPrefs')
-rw-r--r--QuickActions/QuickActionsPrefs/QASAppSelectorController.h1
-rw-r--r--QuickActions/QuickActionsPrefs/QASAppSelectorController.m20
-rw-r--r--QuickActions/QuickActionsPrefs/Resources/Root.plist16
3 files changed, 28 insertions, 9 deletions
diff --git a/QuickActions/QuickActionsPrefs/QASAppSelectorController.h b/QuickActions/QuickActionsPrefs/QASAppSelectorController.h
index f439fcb..0a3937e 100644
--- a/QuickActions/QuickActionsPrefs/QASAppSelectorController.h
+++ b/QuickActions/QuickActionsPrefs/QASAppSelectorController.h
@@ -17,6 +17,7 @@ typedef enum {
UISearchResultsUpdating, UISearchBarDelegate> {
UISearchController *_searchController;
NSString *_searchKey;
+ UISelectionFeedbackGenerator *_feedback;
}
@property (nonatomic) UITableView *tableView;
@property (nonatomic) NSMutableArray<NSString *> *enabled;
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 <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <Preferences/PSSpecifier.h>
+#import <AudioToolbox/AudioToolbox.h>
#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];
diff --git a/QuickActions/QuickActionsPrefs/Resources/Root.plist b/QuickActions/QuickActionsPrefs/Resources/Root.plist
index 1eb8853..60f36c2 100644
--- a/QuickActions/QuickActionsPrefs/Resources/Root.plist
+++ b/QuickActions/QuickActionsPrefs/Resources/Root.plist
@@ -31,8 +31,8 @@
<string>LeftOffsetX</string>
<key>defaults</key>
<string>com.cameronkatri.quickactions</string>
- <key>isDecimalPad</key>
- <true/>
+ <key>keyboard</key>
+ <string>numbers</string>
<key>placeholder</key>
<string>0</string>
</dict>
@@ -45,8 +45,8 @@
<string>LeftOffsetY</string>
<key>defaults</key>
<string>com.cameronkatri.quickactions</string>
- <key>isDecimalPad</key>
- <true/>
+ <key>keyboard</key>
+ <string>numbers</string>
<key>placeholder</key>
<string>0</string>
</dict>
@@ -77,8 +77,8 @@
<string>RightOffsetX</string>
<key>defaults</key>
<string>com.cameronkatri.quickactions</string>
- <key>isDecimalPad</key>
- <true/>
+ <key>keyboard</key>
+ <string>numbers</string>
<key>placeholder</key>
<string>0</string>
</dict>
@@ -91,8 +91,8 @@
<string>RightOffsetY</string>
<key>defaults</key>
<string>com.cameronkatri.quickactions</string>
- <key>isDecimalPad</key>
- <true/>
+ <key>keyboard</key>
+ <string>numbers</string>
<key>placeholder</key>
<string>0</string>
</dict>