Commit 255f4a7d874febac9750550feada34a7f81b8f9c
1 parent
cd0778c1
no message
Showing
3 changed files
with
62 additions
and
59 deletions
CNLiveCollectionModule/Classes/Controller/CNLiveCollectionController.m
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | #import "QMUIKit.h" | 10 | #import "QMUIKit.h" |
| 11 | 11 | ||
| 12 | #import "CNLiveCategory.h" | 12 | #import "CNLiveCategory.h" |
| 13 | +#import "CNLiveBaseKit.h" | ||
| 13 | 14 | ||
| 14 | #import "CNLiveRefreshHeader.h" | 15 | #import "CNLiveRefreshHeader.h" |
| 15 | #import "CNLiveRefreshFooter.h" | 16 | #import "CNLiveRefreshFooter.h" |
| @@ -49,13 +50,12 @@ static const CGFloat timeValue = 1.5; | @@ -49,13 +50,12 @@ static const CGFloat timeValue = 1.5; | ||
| 49 | [strongSelf.tableView.mj_footer endRefreshing]; | 50 | [strongSelf.tableView.mj_footer endRefreshing]; |
| 50 | 51 | ||
| 51 | if (error) { | 52 | if (error) { |
| 52 | - if (strongSelf.data.count == 0) { | ||
| 53 | - if (error.code == -1001||error.code == -1003||error.code == -1009) { | ||
| 54 | - [strongSelf showEmptyViewWithImage:[UIImage imageNamed:@"dd_wlcw"] text:@"无法连接网络" detailText:@"别紧张,试试看刷新页面~" buttonTitle:@" 重试 " buttonAction:@selector(loadData)]; | ||
| 55 | - [strongSelf setCNAPIErrorEmptyView]; | ||
| 56 | - strongSelf.tableView.mj_footer.hidden = strongSelf.data.count == 0; | ||
| 57 | - } | ||
| 58 | - } | 53 | + [self.data removeAllObjects]; |
| 54 | + [self.tableView reloadData]; | ||
| 55 | + [self.tableView showEmptyViewWithType:CNLiveCustomTipsTypeLoadFail noData:self.data.count == 0 block:^{ | ||
| 56 | + [self.tableView.mj_header beginRefreshing]; | ||
| 57 | + }]; | ||
| 58 | + self.tableView.emptyView.top = 0; | ||
| 59 | return; | 59 | return; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| @@ -75,11 +75,9 @@ static const CGFloat timeValue = 1.5; | @@ -75,11 +75,9 @@ static const CGFloat timeValue = 1.5; | ||
| 75 | } | 75 | } |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | - if (strongSelf.data.count == 0) {//显示empty | ||
| 79 | - [strongSelf showEmptyViewWithImage:[UIImage imageNamed:@"zhuangtai_kong"] text:@"您现在没有相关内容哦" detailText:@"" buttonTitle:@"" buttonAction:nil]; | ||
| 80 | - [strongSelf setCNNoDataEmptyView]; | ||
| 81 | - strongSelf.tableView.tableFooterView = nil; | ||
| 82 | - } | 78 | + [strongSelf.tableView showEmptyViewWithType:CNLiveCustomTipsTypeNoData noData:self.data.count == 0 block:nil]; |
| 79 | + strongSelf.tableView.emptyView.top = 0; | ||
| 80 | + | ||
| 83 | strongSelf.tableView.mj_footer.hidden = self.data.count == 0; | 81 | strongSelf.tableView.mj_footer.hidden = self.data.count == 0; |
| 84 | [strongSelf.tableView reloadData]; | 82 | [strongSelf.tableView reloadData]; |
| 85 | 83 |
Example/CNLiveCollectionModule.xcodeproj/project.pbxproj
| @@ -207,7 +207,7 @@ | @@ -207,7 +207,7 @@ | ||
| 207 | 6003F586195388D20070C39A /* Sources */, | 207 | 6003F586195388D20070C39A /* Sources */, |
| 208 | 6003F587195388D20070C39A /* Frameworks */, | 208 | 6003F587195388D20070C39A /* Frameworks */, |
| 209 | 6003F588195388D20070C39A /* Resources */, | 209 | 6003F588195388D20070C39A /* Resources */, |
| 210 | - 86193E368B9AC6672C6C9E5D /* [CP] Embed Pods Frameworks */, | 210 | + EDF5167CA47DDB788AD86E4A /* [CP] Embed Pods Frameworks */, |
| 211 | ); | 211 | ); |
| 212 | buildRules = ( | 212 | buildRules = ( |
| 213 | ); | 213 | ); |
| @@ -247,6 +247,9 @@ | @@ -247,6 +247,9 @@ | ||
| 247 | LastUpgradeCheck = 0720; | 247 | LastUpgradeCheck = 0720; |
| 248 | ORGANIZATIONNAME = "153993236@qq.com"; | 248 | ORGANIZATIONNAME = "153993236@qq.com"; |
| 249 | TargetAttributes = { | 249 | TargetAttributes = { |
| 250 | + 6003F589195388D20070C39A = { | ||
| 251 | + DevelopmentTeam = 94X49GG3ZW; | ||
| 252 | + }; | ||
| 250 | 6003F5AD195388D20070C39A = { | 253 | 6003F5AD195388D20070C39A = { |
| 251 | TestTargetID = 6003F589195388D20070C39A; | 254 | TestTargetID = 6003F589195388D20070C39A; |
| 252 | }; | 255 | }; |
| @@ -295,7 +298,51 @@ | @@ -295,7 +298,51 @@ | ||
| 295 | /* End PBXResourcesBuildPhase section */ | 298 | /* End PBXResourcesBuildPhase section */ |
| 296 | 299 | ||
| 297 | /* Begin PBXShellScriptBuildPhase section */ | 300 | /* Begin PBXShellScriptBuildPhase section */ |
| 298 | - 86193E368B9AC6672C6C9E5D /* [CP] Embed Pods Frameworks */ = { | 301 | + 960F3AF809FA34C6E96A9461 /* [CP] Check Pods Manifest.lock */ = { |
| 302 | + isa = PBXShellScriptBuildPhase; | ||
| 303 | + buildActionMask = 2147483647; | ||
| 304 | + files = ( | ||
| 305 | + ); | ||
| 306 | + inputFileListPaths = ( | ||
| 307 | + ); | ||
| 308 | + inputPaths = ( | ||
| 309 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 310 | + "${PODS_ROOT}/Manifest.lock", | ||
| 311 | + ); | ||
| 312 | + name = "[CP] Check Pods Manifest.lock"; | ||
| 313 | + outputFileListPaths = ( | ||
| 314 | + ); | ||
| 315 | + outputPaths = ( | ||
| 316 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveCollectionModule_Tests-checkManifestLockResult.txt", | ||
| 317 | + ); | ||
| 318 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 319 | + shellPath = /bin/sh; | ||
| 320 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
| 321 | + showEnvVarsInLog = 0; | ||
| 322 | + }; | ||
| 323 | + 9D5A20D6D12364DD9DF1B89D /* [CP] Check Pods Manifest.lock */ = { | ||
| 324 | + isa = PBXShellScriptBuildPhase; | ||
| 325 | + buildActionMask = 2147483647; | ||
| 326 | + files = ( | ||
| 327 | + ); | ||
| 328 | + inputFileListPaths = ( | ||
| 329 | + ); | ||
| 330 | + inputPaths = ( | ||
| 331 | + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 332 | + "${PODS_ROOT}/Manifest.lock", | ||
| 333 | + ); | ||
| 334 | + name = "[CP] Check Pods Manifest.lock"; | ||
| 335 | + outputFileListPaths = ( | ||
| 336 | + ); | ||
| 337 | + outputPaths = ( | ||
| 338 | + "$(DERIVED_FILE_DIR)/Pods-CNLiveCollectionModule_Example-checkManifestLockResult.txt", | ||
| 339 | + ); | ||
| 340 | + runOnlyForDeploymentPostprocessing = 0; | ||
| 341 | + shellPath = /bin/sh; | ||
| 342 | + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
| 343 | + showEnvVarsInLog = 0; | ||
| 344 | + }; | ||
| 345 | + EDF5167CA47DDB788AD86E4A /* [CP] Embed Pods Frameworks */ = { | ||
| 299 | isa = PBXShellScriptBuildPhase; | 346 | isa = PBXShellScriptBuildPhase; |
| 300 | buildActionMask = 2147483647; | 347 | buildActionMask = 2147483647; |
| 301 | files = ( | 348 | files = ( |
| @@ -349,50 +396,6 @@ | @@ -349,50 +396,6 @@ | ||
| 349 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveCollectionModule_Example/Pods-CNLiveCollectionModule_Example-frameworks.sh\"\n"; | 396 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveCollectionModule_Example/Pods-CNLiveCollectionModule_Example-frameworks.sh\"\n"; |
| 350 | showEnvVarsInLog = 0; | 397 | showEnvVarsInLog = 0; |
| 351 | }; | 398 | }; |
| 352 | - 960F3AF809FA34C6E96A9461 /* [CP] Check Pods Manifest.lock */ = { | ||
| 353 | - isa = PBXShellScriptBuildPhase; | ||
| 354 | - buildActionMask = 2147483647; | ||
| 355 | - files = ( | ||
| 356 | - ); | ||
| 357 | - inputFileListPaths = ( | ||
| 358 | - ); | ||
| 359 | - inputPaths = ( | ||
| 360 | - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 361 | - "${PODS_ROOT}/Manifest.lock", | ||
| 362 | - ); | ||
| 363 | - name = "[CP] Check Pods Manifest.lock"; | ||
| 364 | - outputFileListPaths = ( | ||
| 365 | - ); | ||
| 366 | - outputPaths = ( | ||
| 367 | - "$(DERIVED_FILE_DIR)/Pods-CNLiveCollectionModule_Tests-checkManifestLockResult.txt", | ||
| 368 | - ); | ||
| 369 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 370 | - shellPath = /bin/sh; | ||
| 371 | - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
| 372 | - showEnvVarsInLog = 0; | ||
| 373 | - }; | ||
| 374 | - 9D5A20D6D12364DD9DF1B89D /* [CP] Check Pods Manifest.lock */ = { | ||
| 375 | - isa = PBXShellScriptBuildPhase; | ||
| 376 | - buildActionMask = 2147483647; | ||
| 377 | - files = ( | ||
| 378 | - ); | ||
| 379 | - inputFileListPaths = ( | ||
| 380 | - ); | ||
| 381 | - inputPaths = ( | ||
| 382 | - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
| 383 | - "${PODS_ROOT}/Manifest.lock", | ||
| 384 | - ); | ||
| 385 | - name = "[CP] Check Pods Manifest.lock"; | ||
| 386 | - outputFileListPaths = ( | ||
| 387 | - ); | ||
| 388 | - outputPaths = ( | ||
| 389 | - "$(DERIVED_FILE_DIR)/Pods-CNLiveCollectionModule_Example-checkManifestLockResult.txt", | ||
| 390 | - ); | ||
| 391 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 392 | - shellPath = /bin/sh; | ||
| 393 | - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
| 394 | - showEnvVarsInLog = 0; | ||
| 395 | - }; | ||
| 396 | /* End PBXShellScriptBuildPhase section */ | 399 | /* End PBXShellScriptBuildPhase section */ |
| 397 | 400 | ||
| 398 | /* Begin PBXSourcesBuildPhase section */ | 401 | /* Begin PBXSourcesBuildPhase section */ |
| @@ -530,6 +533,7 @@ | @@ -530,6 +533,7 @@ | ||
| 530 | baseConfigurationReference = 9ABFA23662146CDF3FEEB166 /* Pods-CNLiveCollectionModule_Example.debug.xcconfig */; | 533 | baseConfigurationReference = 9ABFA23662146CDF3FEEB166 /* Pods-CNLiveCollectionModule_Example.debug.xcconfig */; |
| 531 | buildSettings = { | 534 | buildSettings = { |
| 532 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 536 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 533 | GCC_PRECOMPILE_PREFIX_HEADER = YES; | 537 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 534 | GCC_PREFIX_HEADER = "CNLiveCollectionModule/CNLiveCollectionModule-Prefix.pch"; | 538 | GCC_PREFIX_HEADER = "CNLiveCollectionModule/CNLiveCollectionModule-Prefix.pch"; |
| 535 | INFOPLIST_FILE = "CNLiveCollectionModule/CNLiveCollectionModule-Info.plist"; | 539 | INFOPLIST_FILE = "CNLiveCollectionModule/CNLiveCollectionModule-Info.plist"; |
| @@ -546,6 +550,7 @@ | @@ -546,6 +550,7 @@ | ||
| 546 | baseConfigurationReference = 01C2BEA02A559BF8EE8B90FC /* Pods-CNLiveCollectionModule_Example.release.xcconfig */; | 550 | baseConfigurationReference = 01C2BEA02A559BF8EE8B90FC /* Pods-CNLiveCollectionModule_Example.release.xcconfig */; |
| 547 | buildSettings = { | 551 | buildSettings = { |
| 548 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 552 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 553 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 549 | GCC_PRECOMPILE_PREFIX_HEADER = YES; | 554 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 550 | GCC_PREFIX_HEADER = "CNLiveCollectionModule/CNLiveCollectionModule-Prefix.pch"; | 555 | GCC_PREFIX_HEADER = "CNLiveCollectionModule/CNLiveCollectionModule-Prefix.pch"; |
| 551 | INFOPLIST_FILE = "CNLiveCollectionModule/CNLiveCollectionModule-Info.plist"; | 556 | INFOPLIST_FILE = "CNLiveCollectionModule/CNLiveCollectionModule-Info.plist"; |
Example/CNLiveCollectionModule/CNLIVEAppDelegate.m
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | 33 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 34 | { | 34 | { |
| 35 | // Override point for customization after application launch. | 35 | // Override point for customization after application launch. |
| 36 | - [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore]; | 36 | + [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore]; |
| 37 | [self networkParamAction]; | 37 | [self networkParamAction]; |
| 38 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];//UIScreen mainScreen].bounds个人理解获取屏幕的硬件信息然后设置尺寸大小 | 38 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];//UIScreen mainScreen].bounds个人理解获取屏幕的硬件信息然后设置尺寸大小 |
| 39 | CNLiveCollectionController *vc = [[CNLiveCollectionController alloc] init]; | 39 | CNLiveCollectionController *vc = [[CNLiveCollectionController alloc] init]; |