mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
iOS: Fix Force Touch shortcuts not working on first launch.
Also makes them continue to work when you change the bundle identifier (necessary if you want to keep a self-compiled version of NewsBlur at the same time as the official version).
This commit is contained in:
parent
b04b7c7832
commit
603468d297
2 changed files with 20 additions and 11 deletions
|
@ -380,6 +380,8 @@
|
|||
}
|
||||
if (storiesCollection.inSearch && storiesCollection.searchQuery) {
|
||||
[self.searchBar setText:storiesCollection.searchQuery];
|
||||
[self.storyTitlesTable setContentOffset:CGPointMake(0, 0)];
|
||||
[self.searchBar becomeFirstResponder];
|
||||
} else {
|
||||
[self.searchBar setText:@""];
|
||||
}
|
||||
|
|
|
@ -250,20 +250,27 @@
|
|||
|
||||
- (BOOL)handleShortcutItem:(UIApplicationShortcutItem *)shortcutItem {
|
||||
NSString *type = shortcutItem.type;
|
||||
NSString *prefix = [[NSBundle mainBundle].bundleIdentifier stringByAppendingString:@"."];
|
||||
BOOL handled = YES;
|
||||
|
||||
if (!self.dictFeeds) {
|
||||
if (!self.activeUsername) {
|
||||
handled = NO;
|
||||
} else if ([type isEqualToString:@"com.newsblur.NewsBlur.AddFeed"]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
[self performSelector:@selector(delayedAddSite) withObject:nil afterDelay:0.0];
|
||||
} else if ([type isEqualToString:@"com.newsblur.NewsBlur.AllStories"]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
[self.feedsViewController didSelectSectionHeaderWithTag:2];
|
||||
} else if ([type isEqualToString:@"com.newsblur.NewsBlur.Search"]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
[self.feedsViewController didSelectSectionHeaderWithTag:2];
|
||||
[self.feedDetailViewController.searchBar performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.5];
|
||||
} else if ([type startsWith:prefix]) {
|
||||
type = [type substringFromIndex:[prefix length]];
|
||||
if ([type isEqualToString:@"AddFeed"]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
[self performSelector:@selector(delayedAddSite) withObject:nil afterDelay:0.0];
|
||||
} else if ([type isEqualToString:@"AllStories"]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
[self.feedsViewController didSelectSectionHeaderWithTag:2];
|
||||
} else if ([type isEqualToString:@"Search"]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
[self.feedsViewController didSelectSectionHeaderWithTag:2];
|
||||
self.feedDetailViewController.storiesCollection.searchQuery = @"";
|
||||
self.feedDetailViewController.storiesCollection.inSearch = YES;
|
||||
} else {
|
||||
handled = NO;
|
||||
}
|
||||
} else {
|
||||
handled = NO;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue