Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
GMRouter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMRouter
Commits
88570107
Commit
88570107
authored
Sep 07, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
8025d79d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
Podfile.lock
Example/Podfile.lock
+2
-2
GMRouter+gm.h
GMRouter/Classes/GMRouter+gm.h
+8
-0
GMRouter+gm.m
GMRouter/Classes/GMRouter+gm.m
+6
-1
No files found.
Example/Podfile.lock
View file @
88570107
...
@@ -5,7 +5,7 @@ PODS:
...
@@ -5,7 +5,7 @@ PODS:
- GMCache
- GMCache
- MagicalRecord
- MagicalRecord
- MJExtension
- MJExtension
- GMRouter (0.
2.8
):
- GMRouter (0.
3.0
):
- GMPhobos
- GMPhobos
- MJExtension
- MJExtension
- MagicalRecord (2.3.2):
- MagicalRecord (2.3.2):
...
@@ -33,7 +33,7 @@ EXTERNAL SOURCES:
...
@@ -33,7 +33,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
SPEC CHECKSUMS:
GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMPhobos: 981b9c9509945eaa28b4ad6a5376eb78f3fd54b5
GMPhobos: 981b9c9509945eaa28b4ad6a5376eb78f3fd54b5
GMRouter:
6ff1e7dd9fab33e3cdaed8c3d51b99bc93e0dfe8
GMRouter:
dde008e5b3b65e03671e7e71f89a34e6ef548abe
MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755
MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
...
...
GMRouter/Classes/GMRouter+gm.h
View file @
88570107
...
@@ -31,6 +31,14 @@ extern NSString *const GMRouterProtocolPrefix;
...
@@ -31,6 +31,14 @@ extern NSString *const GMRouterProtocolPrefix;
*/
*/
-
(
id
)
pushScheme
:(
NSString
*
)
urlScheme
;
-
(
id
)
pushScheme
:(
NSString
*
)
urlScheme
;
/**
* 通过协议 跳转到对应的vc
* @param urlScheme 协议名字 建议使用例如:welfaredetail
* params {@"service_id": @"".}
* @return vc的实例
*/
-
(
id
)
pushScheme
:(
NSString
*
)
urlScheme
params
:(
NSDictionary
*
)
params
;
/**
/**
* 通过协议 跳转到对应的vc
* 通过协议 跳转到对应的vc
* @param urlScheme 协议名字
* @param urlScheme 协议名字
...
...
GMRouter/Classes/GMRouter+gm.m
View file @
88570107
...
@@ -39,15 +39,20 @@ static NSMutableDictionary *routeMap = nil;
...
@@ -39,15 +39,20 @@ static NSMutableDictionary *routeMap = nil;
return
[
self
pushScheme
:
urlScheme
completeBlock
:
NULL
];
return
[
self
pushScheme
:
urlScheme
completeBlock
:
NULL
];
}
}
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
params
:
(
NSDictionary
*
)
params
{
return
[
self
pushScheme
:
urlScheme
params
:
params
completeBlock
:
NULL
];
}
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
completeBlock
:
(
GMRouterCompleteBlock
)
completeBlock
{
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
completeBlock
:
(
GMRouterCompleteBlock
)
completeBlock
{
return
[
self
pushScheme
:
urlScheme
params
:@{}
completeBlock
:
completeBlock
];
return
[
self
pushScheme
:
urlScheme
params
:@{}
completeBlock
:
completeBlock
];
}
}
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
params
:
(
NSDictionary
*
)
params
completeBlock
:
(
GMRouterCompleteBlock
)
completeBlock
{
-
(
id
)
pushScheme
:
(
NSString
*
)
urlScheme
params
:
(
NSDictionary
*
)
params
completeBlock
:
(
GMRouterCompleteBlock
)
completeBlock
{
if
(
!
urlScheme
.
length
)
{
return
nil
;
}
if
(
!
[
urlScheme
hasPrefix
:
GMRouterProtocolPrefix
])
{
if
(
!
[
urlScheme
hasPrefix
:
GMRouterProtocolPrefix
])
{
urlScheme
=
[
NSString
stringWithFormat
:
@"%@%@"
,
GMRouterProtocolPrefix
,
urlScheme
];
urlScheme
=
[
NSString
stringWithFormat
:
@"%@%@"
,
GMRouterProtocolPrefix
,
urlScheme
];
}
}
if
(
!
urlScheme
.
length
)
{
return
nil
;
}
NSMutableDictionary
*
allParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
params
];
NSMutableDictionary
*
allParams
=
[
NSMutableDictionary
dictionaryWithDictionary
:
params
];
NSString
*
encodeUrlScheme
=
[
self
URLEncodeString
:
urlScheme
];
NSString
*
encodeUrlScheme
=
[
self
URLEncodeString
:
urlScheme
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment