diff --git a/iOS/offlineguides/ArticleVC.h b/iOS/offlineguides/ArticleVC.h index 5ccd2b2..6a37d4b 100644 --- a/iOS/offlineguides/ArticleVC.h +++ b/iOS/offlineguides/ArticleVC.h @@ -7,6 +7,7 @@ @interface ArticleVC : UITableViewController @property (nonatomic, assign) id delegate; +@property (nonatomic, strong) NSString * currentName; //uses on start of application -(NSString *)getDefaultArticle; -(NSString *)updateView:(NSString *)htmlId; diff --git a/iOS/offlineguides/ArticleVC.mm b/iOS/offlineguides/ArticleVC.mm index c71d5ac..af5b74d 100644 --- a/iOS/offlineguides/ArticleVC.mm +++ b/iOS/offlineguides/ArticleVC.mm @@ -23,7 +23,6 @@ @property (nonatomic, strong) UISearchBar * searchBar; @property (nonatomic, strong) CLLocationManager * locationManager; -@property (nonatomic, strong) NSString * currentName; @property (nonatomic, strong) NSString * currentSubtitle; @end @@ -181,6 +180,7 @@ [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; ArticleInfo const * info = [self infoByIndexPath:indexPath]; NSString * url = [NSString stringWithUTF8String:info->GetUrl().c_str()]; + self.currentName = [NSString stringWithUTF8String:info->GetTitle().c_str()]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) [self loadGuideAndPushToNavigationController:url]; [self.delegate selectHtmlPageUrl:url]; diff --git a/iOS/offlineguides/GuideVC.mm b/iOS/offlineguides/GuideVC.mm index a24abf3..0791041 100644 --- a/iOS/offlineguides/GuideVC.mm +++ b/iOS/offlineguides/GuideVC.mm @@ -72,7 +72,7 @@ UITextAttributeTextColor : [UIColor colorWithRed:253.f/255.f green:241.f/255.f blue:43.f/255.f alpha:1.f], UITextAttributeTextShadowColor : [UIColor clearColor] }; - self.navigationItem.title = [self getAppName]; + [self updateArticleTitle]; } - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request @@ -246,6 +246,7 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG [[self getArticleController] updateView:[htmlId substringFromIndex:slashLocation.location + 1]]; else [[self getArticleController] updateView:htmlId]; + [self updateArticleTitle]; } } } @@ -272,9 +273,9 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG return YES; } --(NSString *)getAppName +-(void)updateArticleTitle { - return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; + self.navigationItem.title = [self getArticleController].currentName; } @end