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
52337ac2
Commit
52337ac2
authored
Dec 29, 2018
by
李震
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lz/gmBase' into 'master'
Lz/gm base See merge request
!14
parents
e6b12e14
36314bc2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
17 deletions
+6
-17
project.pbxproj
Example/GMBase.xcodeproj/project.pbxproj
+2
-2
Podfile.lock
Example/Podfile.lock
+3
-3
WMBaseCollectionController.m
GMBase/Classes/WMBaseCollectionController.m
+0
-1
WMBaseListViewController.m
GMBase/Classes/WMBaseListViewController.m
+0
-1
WMFetchDataViewModel.h
GMBase/Classes/WMFetchDataViewModel.h
+0
-3
WMFetchDataViewModel.m
GMBase/Classes/WMFetchDataViewModel.m
+1
-7
No files found.
Example/GMBase.xcodeproj/project.pbxproj
View file @
52337ac2
...
...
@@ -318,7 +318,7 @@
files
=
(
);
inputPaths
=
(
"${
SRCROOT}/Pods
/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh"
,
"${
PODS_ROOT}
/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh"
,
"${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework"
,
"${BUILT_PRODUCTS_DIR}/GMBase/GMBase.framework"
,
"${BUILT_PRODUCTS_DIR}/GMCache/GMCache.framework"
,
...
...
@@ -353,7 +353,7 @@
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"\"${
SRCROOT}/Pods
/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh\"\n"
;
shellScript
=
"\"${
PODS_ROOT}
/Target Support Files/Pods-GMBase_Example/Pods-GMBase_Example-frameworks.sh\"\n"
;
showEnvVarsInLog
=
0
;
};
6B1A34007915B07651D26E10
/* [CP] Check Pods Manifest.lock */
=
{
...
...
Example/Podfile.lock
View file @
52337ac2
...
...
@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- GMBase (
0.5.0
):
- GMBase (
1.0.1
):
- GMHud
- GMJSONModel
- GMKit
...
...
@@ -103,7 +103,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase: c
2d6cee8062f0230844e10f089e81769ff901f87
GMBase: c
b450491a520db00d02dc2c35c753e4011f06134
GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e
GMHud: 9cc3942fc9f215db55b134cbfd05a458b124a964
GMJSONModel: 5e81a98de668e9f93cf6ff77869f77b0d1a806be
...
...
@@ -119,4 +119,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: b9c24bb8fb1ea50b58c59e079b456b4ca1d9b998
COCOAPODS: 1.
5.3
COCOAPODS: 1.
6.0.beta.2
GMBase/Classes/WMBaseCollectionController.m
View file @
52337ac2
...
...
@@ -136,7 +136,6 @@
-
(
void
)
refreshList
{
[
self
.
viewModel
setStartNum
:
0
];
[
self
.
viewModel
setPage
:
1
];
[[
self
.
viewModel
dataArray
]
removeAllObjects
];
[
_collectionView
reloadData
];
...
...
GMBase/Classes/WMBaseListViewController.m
View file @
52337ac2
...
...
@@ -94,7 +94,6 @@
-
(
void
)
refreshList
{
[
self
.
viewModel
setStartNum
:
0
];
[
self
.
viewModel
setPage
:
1
];
[[
self
.
viewModel
dataArray
]
removeAllObjects
];
[
_table
reloadData
];
...
...
GMBase/Classes/WMFetchDataViewModel.h
View file @
52337ac2
...
...
@@ -98,9 +98,6 @@
/** @brief 获取http数据分页第一页起始位置,默认为0,下一页为startNum+每页的数据条数(默认为10) */
@property
(
nonatomic
,
assign
)
NSInteger
startNum
;
/** @brief 获取http数据,按照页码进行获取(默认为1) */
@property
(
nonatomic
,
assign
)
NSInteger
page
;
/** @brief 获取http数据,每页获取数据(默认为10) */
@property
(
nonatomic
,
assign
)
NSInteger
count
;
...
...
GMBase/Classes/WMFetchDataViewModel.m
View file @
52337ac2
...
...
@@ -20,7 +20,6 @@
_dataArray
=
[[
NSMutableArray
alloc
]
init
];
_startNum
=
0
;
_params
=
nil
;
_page
=
1
;
_count
=
10
;
_deduplicationDic
=
[
NSMutableDictionary
dictionary
];
_fetchDataErrorMsg
=
@"获取数据失败,请重试"
;
...
...
@@ -42,7 +41,7 @@
}
-
(
BOOL
)
shouldClearDataForResponse
:
(
id
)
response
{
return
self
.
startNum
==
0
&&
self
.
page
==
1
;
return
self
.
startNum
==
0
;
}
-
(
void
)
fetchRemoteData
{
...
...
@@ -67,7 +66,6 @@
NSArray
*
array
=
(
NSArray
*
)
responseObject
;
[
self
buildModelWithRemoteArray
:
array
];
self
.
page
++
;
[
self
setValue
:
@YES
forKey
:
@"fetchDataSuccess"
];
}
else
if
([
responseObject
isKindOfClass
:[
NSDictionary
class
]]){
...
...
@@ -76,12 +74,10 @@
self
.
message
=
responseObject
[
@"message"
];
if
(
code
==
APIStatusCodeSuccess
)
{
[
self
buildModelWithRemoteDic
:
dic
];
self
.
page
++
;
[
self
setValue
:
@YES
forKey
:
@"fetchDataSuccess"
];
}
else
if
(
code
==
APIStatusCodeEmpty
){
self
.
message
=
responseObject
[
@"message"
];
self
.
page
++
;
[
self
setValue
:
@YES
forKey
:
@"fetchDataSuccess"
];
}
else
{
...
...
@@ -104,7 +100,6 @@
// 因为 clearData 可能会被外部调用,所以 self.startNum = 0 要确认执行,不能少
self
.
startNum
=
0
;
_deleteCount
=
0
;
self
.
page
=
1
;
[
self
.
dataArray
removeAllObjects
];
[
_deduplicationDic
removeAllObjects
];
}
...
...
@@ -112,7 +107,6 @@
-
(
void
)
handleHeaderRefreshing
{
self
.
startNum
=
0
;
self
.
page
=
1
;
[
self
fetchRemoteData
];
}
...
...
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