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
fcc2cd96
Commit
fcc2cd96
authored
Aug 10, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
edffb438
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
44 deletions
+14
-44
Podfile.lock
Example/Podfile.lock
+2
-2
GMRouter+gm.h
GMRouter/Classes/GMRouter+gm.h
+6
-4
GMRouter+gm.m
GMRouter/Classes/GMRouter+gm.m
+6
-0
UIViewController+router.h
GMRouter/Classes/UIViewController+router.h
+0
-17
UIViewController+router.m
GMRouter/Classes/UIViewController+router.m
+0
-21
No files found.
Example/Podfile.lock
View file @
fcc2cd96
...
...
@@ -5,7 +5,7 @@ PODS:
- GMCache
- MagicalRecord
- MJExtension
- GMRouter (0.
1.9
):
- GMRouter (0.
2.1
):
- GMPhobos
- MJExtension
- MagicalRecord (2.3.2):
...
...
@@ -33,7 +33,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMPhobos: 981b9c9509945eaa28b4ad6a5376eb78f3fd54b5
GMRouter:
5816ada735703b351c3bfbb0e68743dcb37ec4a6
GMRouter:
e11d4416f0070fe3a93180acded1403d0200ad61
MagicalRecord: 53bed74b4323b930992a725be713e53b37d19755
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
...
...
GMRouter/Classes/GMRouter+gm.h
View file @
fcc2cd96
...
...
@@ -6,7 +6,7 @@
//
#import "GMRouter.h"
#import "UI
ViewControll
er+router.h"
#import "UI
Respond
er+router.h"
NS_ASSUME_NONNULL_BEGIN
...
...
@@ -20,14 +20,16 @@ extern NSString *const GMRouterProtocolPrefix;
/**
* 通过协议 跳转到对应的vc
* @param urlScheme 协议名字 * 例如gengmei://welfare_special?service_id=5930&is_new_special=0
* @param urlScheme 协议名字
* 例如gengmei://welfare_special?service_id=5930&is_new_special=0
* @return vc的实例
*/
-
(
id
)
pushScheme
:(
NSString
*
)
urlScheme
;
/**
* 通过协议 跳转到对应的vc
* @param urlScheme 协议名字 * 例如gengmei://welfare_special?service_id=5930&is_new_special=0
* @param urlScheme 协议名字
* 例如gengmei://welfare_special?service_id=5930&is_new_special=0
* @param routerBlock 需要回调的block
* @return vc的实例
*/
...
...
@@ -41,7 +43,7 @@ extern NSString *const GMRouterProtocolPrefix;
* {@"service_id": @"5930",@"is_new_special": @0}
* @return vc的实例
*/
-
(
id
)
pushScheme
:(
NSString
*
)
urlScheme
params
:(
NSDictionary
*
)
params
complete
Block
:(
GMRouterBlock
)
routerBlock
;
-
(
id
)
pushScheme
:(
NSString
*
)
urlScheme
params
:(
NSDictionary
*
)
params
router
Block
:(
GMRouterBlock
)
routerBlock
;
/**
* 初始化Map
...
...
GMRouter/Classes/GMRouter+gm.m
View file @
fcc2cd96
...
...
@@ -72,6 +72,12 @@ static NSMutableDictionary *routeMap = nil;
[
self
vcAutoIsPushWith
:
vc
params
:
params
];
VC
.
routerBlock
=
routerBlock
;
}
// 赋值回调过程
if
([
vc
isKindOfClass
:[
UIResponder
class
]])
{
UIResponder
*
VC
=
(
UIResponder
*
)
vc
;
VC
.
routerBlock
=
routerBlock
;
}
return
vc
;
}
...
...
GMRouter/Classes/UIViewController+router.h
deleted
100644 → 0
View file @
edffb438
//
// UIViewController+router.h
// GMCache
//
// Created by Q14 on 2020/8/10.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef
void
(
^
GMRouterBlock
)(
NSDictionary
*
params
);
@interface
UIViewController
(
router
)
@property
(
nonatomic
,
copy
)
GMRouterBlock
routerBlock
;
@end
NS_ASSUME_NONNULL_END
GMRouter/Classes/UIViewController+router.m
deleted
100644 → 0
View file @
edffb438
//
// UIViewController+router.m
// GMCache
//
// Created by Q14 on 2020/8/10.
//
#import "UIViewController+router.h"
#import <objc/runtime.h>
@implementation
UIViewController
(
router
)
-
(
GMRouterBlock
)
routerBlock
{
return
objc_getAssociatedObject
(
self
,
@selector
(
routerBlock
));
}
-
(
void
)
setRouterBlock
:
(
GMRouterBlock
)
routerBlock
{
objc_setAssociatedObject
(
self
,
@selector
(
routerBlock
),
routerBlock
,
OBJC_ASSOCIATION_COPY_NONATOMIC
);
}
@end
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