Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMBase
Commits
e6ffac3d
Commit
e6ffac3d
authored
Dec 26, 2019
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add WMFetchDataViewModel+GMRequest.h
parent
23b71a2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
WMFetchDataViewModel+GMRequest.h
GMBase/Classes/WMFetchDataViewModel+GMRequest.h
+21
-0
WMFetchDataViewModel+GMRequest.m
GMBase/Classes/WMFetchDataViewModel+GMRequest.m
+30
-0
No files found.
GMBase/Classes/WMFetchDataViewModel+GMRequest.h
0 → 100644
View file @
e6ffac3d
//
// WMFetchDataViewModel+GMRequest.h
// Gengmei
//
// Created by 汪俊 on 2017/7/13.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "WMFetchDataViewModel.h"
@interface
WMFetchDataViewModel
(
GMRequest
)
/**
因为这个是拼在url query中,所以后端给我们时,我们不需求关心它是NSNumber或者是String类型,原样传回去就可以
但其实在get方法的确是返回了String类型,因为这样便于清空offset,及对offset进行判断
未来offset会集成到FetchDataViewModel
*/
@property
(
nonatomic
,
strong
)
id
offset
;
@end
GMBase/Classes/WMFetchDataViewModel+GMRequest.m
0 → 100644
View file @
e6ffac3d
//
// WMFetchDataViewModel+GMRequest.m
// Gengmei
//
// Created by 汪俊 on 2017/7/13.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "WMFetchDataViewModel+GMRequest.h"
#import <objc/runtime.h>
@implementation
WMFetchDataViewModel
(
GMRequest
)
-
(
void
)
setOffset
:(
id
)
offset
{
objc_setAssociatedObject
(
self
,
@selector
(
offset
),
offset
,
OBJC_ASSOCIATION_RETAIN_NONATOMIC
);
}
-
(
id
)
offset
{
id
_offset
=
objc_getAssociatedObject
(
self
,
@selector
(
offset
));
if
(
_offset
==
nil
)
{
return
@""
;
}
if
([
_offset
isKindOfClass
:[
NSNumber
class
]])
{
return
[
_offset
stringValue
];
}
return
_offset
;
}
@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