forked from organicmaps/organicmaps
[ios] Updated osm links to open inside app.
This commit is contained in:
parent
9f1bedd78a
commit
8ab852cdd2
4 changed files with 12 additions and 11 deletions
|
@ -152,10 +152,7 @@ using namespace osm_auth_ios;
|
|||
|
||||
- (IBAction)osmTap
|
||||
{
|
||||
NSURL * url = [NSURL URLWithString:@"https://wiki.openstreetmap.org/wiki/Main_Page"];
|
||||
UIApplication * app = [UIApplication sharedApplication];
|
||||
if ([app canOpenURL:url])
|
||||
[app openURL:url];
|
||||
[self openUrl:[NSURL URLWithString:@"https://wiki.openstreetmap.org/wiki/Main_Page"]];
|
||||
}
|
||||
|
||||
- (void)logout
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@interface MWMEditorNotesFooter : UIView
|
||||
|
||||
+ (instancetype)footer;
|
||||
+ (instancetype)footerForController:(UIViewController *)controller;
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
#import "MWMEditorNotesFooter.h"
|
||||
|
||||
@interface MWMEditorNotesFooter ()
|
||||
|
||||
@property (weak, nonatomic) UIViewController * controller;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMEditorNotesFooter
|
||||
|
||||
+ (instancetype)footer
|
||||
+ (instancetype)footerForController:(UIViewController *)controller
|
||||
{
|
||||
MWMEditorNotesFooter * f = [[[NSBundle mainBundle] loadNibNamed:[MWMEditorNotesFooter className] owner:nil options:nil]
|
||||
firstObject];
|
||||
f.controller = controller;
|
||||
[f setNeedsLayout];
|
||||
[f layoutIfNeeded];
|
||||
NSAssert(f.subviews.firstObject, @"Subviews can't be empty!");
|
||||
|
@ -15,10 +22,7 @@
|
|||
|
||||
- (IBAction)osmTap
|
||||
{
|
||||
NSURL * url = [NSURL URLWithString:@"https://wiki.openstreetmap.org/wiki/Main_Page"];
|
||||
UIApplication * app = [UIApplication sharedApplication];
|
||||
if ([app canOpenURL:url])
|
||||
[app openURL:url];
|
||||
[self.controller openUrl:[NSURL URLWithString:@"https://wiki.openstreetmap.org/wiki/Main_Page"]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -360,7 +360,7 @@ void registerCellsForTableView(vector<MWMPlacePageCellType> const & cells, UITab
|
|||
- (MWMEditorNotesFooter *)notesFooter
|
||||
{
|
||||
if (!_notesFooter)
|
||||
_notesFooter = [MWMEditorNotesFooter footer];
|
||||
_notesFooter = [MWMEditorNotesFooter footerForController:self];
|
||||
return _notesFooter;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue