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
6f7d0a6a
Commit
6f7d0a6a
authored
Dec 12, 2019
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add commons
parent
8e52ca96
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
0 deletions
+81
-0
Target_commons.h
GMRouter/Classes/Target_commons.h
+18
-0
Target_commons.m
GMRouter/Classes/Target_commons.m
+22
-0
UIViewController+Router.h
GMRouter/Classes/UIViewController+Router.h
+16
-0
UIViewController+Router.m
GMRouter/Classes/UIViewController+Router.m
+25
-0
No files found.
GMRouter/Classes/Target_commons.h
0 → 100644
View file @
6f7d0a6a
//
// Target_commons.h
// GMRouter
//
// Created by Q14 on 2019/11/28.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
extern
NSString
*
const
GMRouterTargetCommons
;
@interface
Target_commons
:
NSObject
// 自定义push方法
-
(
UIViewController
*
)
push_CommonViewController
:(
NSString
*
)
stringVCName
params
:(
NSDictionary
*
)
params
;
@end
NS_ASSUME_NONNULL_END
GMRouter/Classes/Target_commons.m
0 → 100644
View file @
6f7d0a6a
//
// Target_commons.m
// GMRouter
//
// Created by Q14 on 2019/11/28.
//
#import "Target_commons.h"
NSString
*
const
GMRouterTargetCommons
=
@"commons"
;
@implementation
Target_commons
// 自定义push方法
-
(
UIViewController
*
)
push_CommonViewController
:(
NSString
*
)
stringVCName
params
:(
NSDictionary
*
)
params
{
// 因为action是从属于ModuleA的,所以action直接可以使用ModuleA里的所有声明
Class
class
=
NSClassFromString
(
stringVCName
);
UIViewController
*
controller
=
[[
class
alloc
]
init
];
return
controller
;
}
@end
GMRouter/Classes/UIViewController+Router.h
0 → 100644
View file @
6f7d0a6a
//
// UIViewController+Router.h
// GMRouter
//
// Created by Q14 on 2019/11/28.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
UIViewController
(
Router
)
-
(
id
)
createVC
:(
NSDictionary
*
)
dict
;
@end
NS_ASSUME_NONNULL_END
GMRouter/Classes/UIViewController+Router.m
0 → 100644
View file @
6f7d0a6a
//
// UIViewController+Router.m
// GMRouter
//
// Created by Q14 on 2019/11/28.
//
#import "UIViewController+Router.h"
#import "GMRouter+gm.h"
@implementation
UIViewController
(
Router
)
-
(
id
)
createVC
:(
NSDictionary
*
)
dict
{
Class
class
=
getClassFromAtcion
(
_cmd
);
if
(
class
)
{
UIViewController
*
doc
=
self
;
doc
=
[[
class
alloc
]
init
];
// doc = [doc mj_setKeyValues:dict];
return
doc
;
}
return
nil
;
}
@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