Here is my code.
UIApplicationShortcutItem *bookmarksShortcutItem = [[UIApplicationShortcutItem alloc] initWithType:@"bookmarks" localizedTitle:@"Bookmarks" localizedSubtitle:@"test" icon:[UIApplicationShortcutIcon iconWithType:UIApplicationShortcutIconTypeBookmark] userInfo:@{@"type":@"bookmarks"}];
So can I add my custom icon instead of UIApplicationShortcutIconTypeBookmark?
Thanks in advance.
This is how you do it:
UIApplicationShortcutIcon *shortcutIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"IMAGE_NAME"];
UIMutableApplicationShortcutItem *option = [[UIMutableApplicationShortcutItem alloc] initWithType:@"uniqueIdentifier"
localizedTitle:@"title"
localizedSubtitle:nil
icon:shortcutIcon
userInfo:nil];
[UIApplication sharedApplication].shortcutItems = @[option];