Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
|
|
@ -0,0 +1,17 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import "MWMRouterType.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class MWMRoutePoint;
|
||||
@interface DeepLinkRouteStrategyAdapter : NSObject
|
||||
|
||||
@property(nonatomic, readonly) MWMRoutePoint* p1;
|
||||
@property(nonatomic, readonly) MWMRoutePoint* p2;
|
||||
@property(nonatomic, readonly) MWMRouterType type;
|
||||
|
||||
- (nullable instancetype)init:(NSURL*)url;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#import "DeepLinkRouteStrategyAdapter.h"
|
||||
#import <CoreApi/Framework.h>
|
||||
#import "MWMCoreRouterType.h"
|
||||
#import "MWMRoutePoint+CPP.h"
|
||||
|
||||
@implementation DeepLinkRouteStrategyAdapter
|
||||
|
||||
- (instancetype)init:(NSURL *)url {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
auto const parsedData = GetFramework().GetParsedRoutingData();
|
||||
auto const points = parsedData.m_points;
|
||||
|
||||
if (points.size() == 2) {
|
||||
_p1 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.front()
|
||||
type:MWMRoutePointTypeStart
|
||||
intermediateIndex:0];
|
||||
_p2 = [[MWMRoutePoint alloc] initWithURLSchemeRoutePoint:points.back()
|
||||
type:MWMRoutePointTypeFinish
|
||||
intermediateIndex:0];
|
||||
_type = routerType(parsedData.m_type);
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
Loading…
Add table
Add a link
Reference in a new issue