[ios] Add iosapp Settings.app force touch quick action shortcut
This commit is contained in:
@@ -2,24 +2,11 @@
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "settings.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "settings@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
"filename" : "settings.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
||||
BIN
platform/ios/app/Assets.xcassets/settings.imageset/settings.pdf
vendored
Normal file
BIN
platform/ios/app/Assets.xcassets/settings.imageset/settings.pdf
vendored
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 528 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -51,5 +51,16 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIApplicationShortcutItems</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UIApplicationShortcutItemTitle</key>
|
||||
<string>Settings</string>
|
||||
<key>UIApplicationShortcutItemType</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).settings</string>
|
||||
<key>UIApplicationShortcutItemIconFile</key>
|
||||
<string>settings</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -26,4 +26,22 @@ NSString * const MBXMapboxAccessTokenDefaultsKey = @"MBXMapboxAccessToken";
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Quick actions
|
||||
|
||||
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler {
|
||||
completionHandler([self handleShortcut:shortcutItem]);
|
||||
}
|
||||
|
||||
- (BOOL)handleShortcut:(UIApplicationShortcutItem *)shortcut {
|
||||
if ([[shortcut.type componentsSeparatedByString:@"."].lastObject isEqual:@"settings"]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
|
||||
});
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user