diff --git a/GIGA.xcodeproj/project.pbxproj b/GIGA.xcodeproj/project.pbxproj index 97957cf..5ade598 100644 --- a/GIGA.xcodeproj/project.pbxproj +++ b/GIGA.xcodeproj/project.pbxproj @@ -57,6 +57,20 @@ 8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361B4312121832800238FEB /* GiGaBaseViewController.m */; }; 8361B4352121836700238FEB /* GiGaBaseNavViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361B4342121836700238FEB /* GiGaBaseNavViewController.m */; }; 8361B4382121847600238FEB /* UINavigationBar+Custom.m in Sources */ = {isa = PBXBuildFile; fileRef = 8361B4372121847600238FEB /* UINavigationBar+Custom.m */; }; + 83835BA0212E43BD001480F2 /* GiGaMasssagesVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835B9F212E43BD001480F2 /* GiGaMasssagesVC.m */; }; + 83835BA7212E4748001480F2 /* MAssaageCenterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BA5212E4748001480F2 /* MAssaageCenterCell.m */; }; + 83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83835BA6212E4748001480F2 /* MAssaageCenterCell.xib */; }; + 83835BAF212E4FCD001480F2 /* MessageListViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BAD212E4FCD001480F2 /* MessageListViewCell.m */; }; + 83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83835BAE212E4FCD001480F2 /* MessageListViewCell.xib */; }; + 83835BB3212E50ED001480F2 /* ActiveMesagelistVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BB2212E50ED001480F2 /* ActiveMesagelistVC.m */; }; + 83835BB6212E5174001480F2 /* GiGaServiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BB5212E5174001480F2 /* GiGaServiceViewController.m */; }; + 83835BB9212E51B0001480F2 /* GiGaSystemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BB8212E51B0001480F2 /* GiGaSystemViewController.m */; }; + 83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BBB212E60E5001480F2 /* MessageDetailViewController.m */; }; + 83835BC3212E677C001480F2 /* GiGaQuestionVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BC2212E677C001480F2 /* GiGaQuestionVC.m */; }; + 83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BC6212E7BBF001480F2 /* GiGaNavTitileView.m */; }; + 83835BCA212E8045001480F2 /* GIGAQuetionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BC9212E8045001480F2 /* GIGAQuetionView.m */; }; + 83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BCC212E856A001480F2 /* NSString+MD5.m */; }; + 83835BD0212E8B9C001480F2 /* GiGaQuestionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 83835BCF212E8B9C001480F2 /* GiGaQuestionModel.m */; }; 83A2270C212A97ED00B3E75C /* MaskViewBootomWaringView.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A2270B212A97ED00B3E75C /* MaskViewBootomWaringView.m */; }; 83A22712212A9EA900B3E75C /* UIView+Sizes.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A22710212A9EA900B3E75C /* UIView+Sizes.m */; }; 83A22718212ABDFF00B3E75C /* GiGaBlockButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A22717212ABDFF00B3E75C /* GiGaBlockButton.m */; }; @@ -169,6 +183,32 @@ 8361B4342121836700238FEB /* GiGaBaseNavViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaBaseNavViewController.m; sourceTree = ""; }; 8361B4362121847600238FEB /* UINavigationBar+Custom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UINavigationBar+Custom.h"; sourceTree = ""; }; 8361B4372121847600238FEB /* UINavigationBar+Custom.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UINavigationBar+Custom.m"; sourceTree = ""; }; + 83835B9E212E43BD001480F2 /* GiGaMasssagesVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaMasssagesVC.h; sourceTree = ""; }; + 83835B9F212E43BD001480F2 /* GiGaMasssagesVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaMasssagesVC.m; sourceTree = ""; }; + 83835BA4212E4748001480F2 /* MAssaageCenterCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MAssaageCenterCell.h; sourceTree = ""; }; + 83835BA5212E4748001480F2 /* MAssaageCenterCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MAssaageCenterCell.m; sourceTree = ""; }; + 83835BA6212E4748001480F2 /* MAssaageCenterCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MAssaageCenterCell.xib; sourceTree = ""; }; + 83835BAC212E4FCD001480F2 /* MessageListViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageListViewCell.h; sourceTree = ""; }; + 83835BAD212E4FCD001480F2 /* MessageListViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageListViewCell.m; sourceTree = ""; }; + 83835BAE212E4FCD001480F2 /* MessageListViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MessageListViewCell.xib; sourceTree = ""; }; + 83835BB1212E50ED001480F2 /* ActiveMesagelistVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActiveMesagelistVC.h; sourceTree = ""; }; + 83835BB2212E50ED001480F2 /* ActiveMesagelistVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ActiveMesagelistVC.m; sourceTree = ""; }; + 83835BB4212E5174001480F2 /* GiGaServiceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaServiceViewController.h; sourceTree = ""; }; + 83835BB5212E5174001480F2 /* GiGaServiceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaServiceViewController.m; sourceTree = ""; }; + 83835BB7212E51B0001480F2 /* GiGaSystemViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaSystemViewController.h; sourceTree = ""; }; + 83835BB8212E51B0001480F2 /* GiGaSystemViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaSystemViewController.m; sourceTree = ""; }; + 83835BBA212E60E5001480F2 /* MessageDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageDetailViewController.h; sourceTree = ""; }; + 83835BBB212E60E5001480F2 /* MessageDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageDetailViewController.m; sourceTree = ""; }; + 83835BC1212E677C001480F2 /* GiGaQuestionVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaQuestionVC.h; sourceTree = ""; }; + 83835BC2212E677C001480F2 /* GiGaQuestionVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaQuestionVC.m; sourceTree = ""; }; + 83835BC5212E7BBF001480F2 /* GiGaNavTitileView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaNavTitileView.h; sourceTree = ""; }; + 83835BC6212E7BBF001480F2 /* GiGaNavTitileView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaNavTitileView.m; sourceTree = ""; }; + 83835BC8212E8045001480F2 /* GIGAQuetionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIGAQuetionView.h; sourceTree = ""; }; + 83835BC9212E8045001480F2 /* GIGAQuetionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIGAQuetionView.m; sourceTree = ""; }; + 83835BCB212E856A001480F2 /* NSString+MD5.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+MD5.h"; sourceTree = ""; }; + 83835BCC212E856A001480F2 /* NSString+MD5.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+MD5.m"; sourceTree = ""; }; + 83835BCE212E8B9C001480F2 /* GiGaQuestionModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiGaQuestionModel.h; sourceTree = ""; }; + 83835BCF212E8B9C001480F2 /* GiGaQuestionModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiGaQuestionModel.m; sourceTree = ""; }; 83A2270A212A97ED00B3E75C /* MaskViewBootomWaringView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MaskViewBootomWaringView.h; sourceTree = ""; }; 83A2270B212A97ED00B3E75C /* MaskViewBootomWaringView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MaskViewBootomWaringView.m; sourceTree = ""; }; 83A22710212A9EA900B3E75C /* UIView+Sizes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Sizes.m"; sourceTree = ""; }; @@ -400,6 +440,7 @@ 8361B3FC21215C7400238FEB /* Common */ = { isa = PBXGroup; children = ( + 83835BC4212E7B96001480F2 /* GiGaNavTitileView */, 835060AA212D4C0F007E6220 /* GiGaFileManager */, 83346AC8212BD4160054D597 /* Source */, 8357ADCA2123BFD8000816F2 /* GiGaNetTool */, @@ -431,6 +472,8 @@ 8361B4372121847600238FEB /* UINavigationBar+Custom.m */, 83A22716212ABDFF00B3E75C /* GiGaBlockButton.h */, 83A22717212ABDFF00B3E75C /* GiGaBlockButton.m */, + 83835BCB212E856A001480F2 /* NSString+MD5.h */, + 83835BCC212E856A001480F2 /* NSString+MD5.m */, ); path = Category; sourceTree = ""; @@ -438,6 +481,7 @@ 8361B3FF21215C9D00238FEB /* Modules */ = { isa = PBXGroup; children = ( + 83835B9D212E4335001480F2 /* MessageCenter */, 835060AE212D5423007E6220 /* AppAD */, 83E40B3021219078008149C4 /* Mask */, 83E40B2C21218B7E008149C4 /* LogIn */, @@ -537,6 +581,99 @@ path = BaseVC; sourceTree = ""; }; + 83835B9D212E4335001480F2 /* MessageCenter */ = { + isa = PBXGroup; + children = ( + 83835BA3212E4623001480F2 /* Model */, + 83835BA2212E4618001480F2 /* View */, + 83835BA1212E4602001480F2 /* Controller */, + ); + path = MessageCenter; + sourceTree = ""; + }; + 83835BA1212E4602001480F2 /* Controller */ = { + isa = PBXGroup; + children = ( + 83835B9E212E43BD001480F2 /* GiGaMasssagesVC.h */, + 83835B9F212E43BD001480F2 /* GiGaMasssagesVC.m */, + 83835BB1212E50ED001480F2 /* ActiveMesagelistVC.h */, + 83835BB2212E50ED001480F2 /* ActiveMesagelistVC.m */, + 83835BB4212E5174001480F2 /* GiGaServiceViewController.h */, + 83835BB5212E5174001480F2 /* GiGaServiceViewController.m */, + 83835BB7212E51B0001480F2 /* GiGaSystemViewController.h */, + 83835BB8212E51B0001480F2 /* GiGaSystemViewController.m */, + 83835BBA212E60E5001480F2 /* MessageDetailViewController.h */, + 83835BBB212E60E5001480F2 /* MessageDetailViewController.m */, + ); + path = Controller; + sourceTree = ""; + }; + 83835BA2212E4618001480F2 /* View */ = { + isa = PBXGroup; + children = ( + 83835BA4212E4748001480F2 /* MAssaageCenterCell.h */, + 83835BA5212E4748001480F2 /* MAssaageCenterCell.m */, + 83835BA6212E4748001480F2 /* MAssaageCenterCell.xib */, + 83835BAC212E4FCD001480F2 /* MessageListViewCell.h */, + 83835BAD212E4FCD001480F2 /* MessageListViewCell.m */, + 83835BAE212E4FCD001480F2 /* MessageListViewCell.xib */, + ); + path = View; + sourceTree = ""; + }; + 83835BA3212E4623001480F2 /* Model */ = { + isa = PBXGroup; + children = ( + ); + path = Model; + sourceTree = ""; + }; + 83835BBD212E6676001480F2 /* Exercises */ = { + isa = PBXGroup; + children = ( + 83835BC0212E66A1001480F2 /* View */, + 83835BBF212E6698001480F2 /* Model */, + 83835BBE212E6690001480F2 /* Controller */, + ); + path = Exercises; + sourceTree = ""; + }; + 83835BBE212E6690001480F2 /* Controller */ = { + isa = PBXGroup; + children = ( + 83835BC1212E677C001480F2 /* GiGaQuestionVC.h */, + 83835BC2212E677C001480F2 /* GiGaQuestionVC.m */, + ); + path = Controller; + sourceTree = ""; + }; + 83835BBF212E6698001480F2 /* Model */ = { + isa = PBXGroup; + children = ( + 83835BCE212E8B9C001480F2 /* GiGaQuestionModel.h */, + 83835BCF212E8B9C001480F2 /* GiGaQuestionModel.m */, + ); + path = Model; + sourceTree = ""; + }; + 83835BC0212E66A1001480F2 /* View */ = { + isa = PBXGroup; + children = ( + 83835BC8212E8045001480F2 /* GIGAQuetionView.h */, + 83835BC9212E8045001480F2 /* GIGAQuetionView.m */, + ); + path = View; + sourceTree = ""; + }; + 83835BC4212E7B96001480F2 /* GiGaNavTitileView */ = { + isa = PBXGroup; + children = ( + 83835BC5212E7BBF001480F2 /* GiGaNavTitileView.h */, + 83835BC6212E7BBF001480F2 /* GiGaNavTitileView.m */, + ); + path = GiGaNavTitileView; + sourceTree = ""; + }; 83A22719212AC7FC00B3E75C /* View */ = { isa = PBXGroup; children = ( @@ -583,6 +720,7 @@ 83E40B3021219078008149C4 /* Mask */ = { isa = PBXGroup; children = ( + 83835BBD212E6676001480F2 /* Exercises */, 8354B3832121BB00004F448F /* View */, 8354B3822121BAFA004F448F /* Model */, 8354B3812121BAE1004F448F /* Controller */, @@ -726,8 +864,10 @@ 83A22720212AC8C100B3E75C /* GiGaUserLoginVC.xib in Resources */, 83346AC1212BB50A0054D597 /* PassWordResetVC.xib in Resources */, 83346AD1212BF5B70054D597 /* useragreement.html in Resources */, + 83835BA8212E4748001480F2 /* MAssaageCenterCell.xib in Resources */, 8361B3D3212155C300238FEB /* Assets.xcassets in Resources */, 8361B3D1212155C200238FEB /* Main.storyboard in Resources */, + 83835BB0212E4FCD001480F2 /* MessageListViewCell.xib in Resources */, 83346ACF212BD7830054D597 /* GiGaWebViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -824,31 +964,43 @@ 83346AC5212BBC8C0054D597 /* GiGaRegistViewController.m in Sources */, 83346AD7212C18F50054D597 /* GiGaAppGaurdVC.m in Sources */, 8349585C212511040064DB6C /* AppDelegate+ThirdParty.m in Sources */, + 83835BCA212E8045001480F2 /* GIGAQuetionView.m in Sources */, 8361B3CE212155C200238FEB /* ViewController.m in Sources */, 8361B4382121847600238FEB /* UINavigationBar+Custom.m in Sources */, 83346AD4212BFF6E0054D597 /* UserGuardViewController.m in Sources */, 8357ADC92123BFCA000816F2 /* GiGaUserManager.m in Sources */, + 83835BB3212E50ED001480F2 /* ActiveMesagelistVC.m in Sources */, + 83835BC3212E677C001480F2 /* GiGaQuestionVC.m in Sources */, 83A2271F212AC8C100B3E75C /* GiGaUserLoginVC.m in Sources */, 83346ACE212BD7830054D597 /* GiGaWebViewController.m in Sources */, 8357ADD82124027D000816F2 /* GiGaUserDefault.m in Sources */, + 83835BB6212E5174001480F2 /* GiGaServiceViewController.m in Sources */, 8361B40721215E6F00238FEB /* GiGaHelper.m in Sources */, + 83835BA0212E43BD001480F2 /* GiGaMasssagesVC.m in Sources */, 8357ADCD2123C091000816F2 /* GiGaNetManager.m in Sources */, 835060A9212D38EE007E6220 /* GiGaStartAdView.m in Sources */, 833DA7762122A62000A5C614 /* GiGaMaskTaskViewController.m in Sources */, 8357ADD02123C5F7000816F2 /* GiGaAPIRequest.m in Sources */, + 83835BD0212E8B9C001480F2 /* GiGaQuestionModel.m in Sources */, + 83835BAF212E4FCD001480F2 /* MessageListViewCell.m in Sources */, 8361B3D9212155C300238FEB /* main.m in Sources */, 835060A2212D1225007E6220 /* GiGaMeViewController.m in Sources */, 8361B3CB212155C200238FEB /* AppDelegate.m in Sources */, + 83835BBC212E60E5001480F2 /* MessageDetailViewController.m in Sources */, + 83835BCD212E856A001480F2 /* NSString+MD5.m in Sources */, + 83835BC7212E7BBF001480F2 /* GiGaNavTitileView.m in Sources */, 8361B4322121832800238FEB /* GiGaBaseViewController.m in Sources */, 8357ADD32123C7C6000816F2 /* GiGaAPIResult.m in Sources */, 8361B4352121836700238FEB /* GiGaBaseNavViewController.m in Sources */, 835060B3212D54C2007E6220 /* GiGaAdDetailViewController.m in Sources */, 83346AC0212BB50A0054D597 /* PassWordResetVC.m in Sources */, + 83835BB9212E51B0001480F2 /* GiGaSystemViewController.m in Sources */, 8361B40421215E0C00238FEB /* LXCountTimer.m in Sources */, 8357ADC52123BEBD000816F2 /* GiGaUser.m in Sources */, 83E40B2F21218BA0008149C4 /* GiGaUserViewController.m in Sources */, 835060A5212D3536007E6220 /* AppDelegate+GiGaConfig.m in Sources */, 83E40B2B21218B6F008149C4 /* GiGaExercisesViewController.m in Sources */, + 83835BA7212E4748001480F2 /* MAssaageCenterCell.m in Sources */, 8361B42E2121812000238FEB /* GiGaServerConfig.m in Sources */, 83A22712212A9EA900B3E75C /* UIView+Sizes.m in Sources */, 83A22718212ABDFF00B3E75C /* GiGaBlockButton.m in Sources */, diff --git a/GIGA/AppDelegate.m b/GIGA/AppDelegate.m index 86089bd..2a90437 100644 --- a/GIGA/AppDelegate.m +++ b/GIGA/AppDelegate.m @@ -13,6 +13,9 @@ #import "JPUSHService.h" @interface AppDelegate () +//保持后台长时间运行 +@property (nonatomic,assign) UIBackgroundTaskIdentifier backgroundTask; +@property (nonatomic,strong) NSTimer *timer; @end @@ -46,9 +49,37 @@ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + //后台模式 + [self creatBackGoundTask]; + } +-(void)creatBackGoundTask{ + //告诉系统当前app在后台有任务处理,需要时间 + self.backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ + [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask]; + self.backgroundTask = UIBackgroundTaskInvalid; + + }]; + self.timer = [NSTimer scheduledTimerWithTimeInterval:30.0 target:self selector:@selector(applyToActiveForMoreTime) userInfo:nil repeats:YES]; + [self.timer fire]; +} +-(void)applyToActiveForMoreTime{ + + //如果系统给的剩余时间小于60秒 就终止当前的后台任务,再重新初始化一个后台任务,重新让系统分配时间,这样一直循环下去,保持APP在后台一直处于active状态。 + if ([UIApplication sharedApplication].backgroundTimeRemaining < 60.0) { + {//如果剩余时间小于60秒 + [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask]; + self.backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ + [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask]; + self.backgroundTask = UIBackgroundTaskInvalid; + }]; + + } + } + +} - (void)applicationWillEnterForeground:(UIApplication *)application { application.applicationIconBadgeNumber = 0; [JPUSHService resetBadge]; diff --git a/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/Contents.json new file mode 100644 index 0000000..db7bdf5 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "exerc_answer_option_nor@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "exerc_answer_option_nor@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/exerc_answer_option_nor@2x.png b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/exerc_answer_option_nor@2x.png new file mode 100644 index 0000000..dbeba2a Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/exerc_answer_option_nor@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/exerc_answer_option_nor@3x.png b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/exerc_answer_option_nor@3x.png new file mode 100644 index 0000000..1b66133 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_nor.imageset/exerc_answer_option_nor@3x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/Contents.json b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/Contents.json new file mode 100644 index 0000000..7234bb0 --- /dev/null +++ b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "exerc_answer_option_sel@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "exerc_answer_option_sel@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/exerc_answer_option_sel@2x.png b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/exerc_answer_option_sel@2x.png new file mode 100644 index 0000000..afeab26 Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/exerc_answer_option_sel@2x.png differ diff --git a/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/exerc_answer_option_sel@3x.png b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/exerc_answer_option_sel@3x.png new file mode 100644 index 0000000..e0ccd9a Binary files /dev/null and b/GIGA/Assets.xcassets/maskTime/exerc_answer_option_sel.imageset/exerc_answer_option_sel@3x.png differ diff --git a/GIGA/Base.lproj/LaunchScreen.storyboard b/GIGA/Base.lproj/LaunchScreen.storyboard index 722ce1c..fa689fa 100644 --- a/GIGA/Base.lproj/LaunchScreen.storyboard +++ b/GIGA/Base.lproj/LaunchScreen.storyboard @@ -1,12 +1,11 @@ - + - @@ -14,11 +13,13 @@ + + + + - - diff --git a/GIGA/Base.lproj/Main.storyboard b/GIGA/Base.lproj/Main.storyboard index d7c78a1..6bad06e 100644 --- a/GIGA/Base.lproj/Main.storyboard +++ b/GIGA/Base.lproj/Main.storyboard @@ -1,20 +1,26 @@ - + + + + - - + + - + + + + + - diff --git a/GIGA/Category/NSString+MD5.h b/GIGA/Category/NSString+MD5.h new file mode 100644 index 0000000..03ee5d5 --- /dev/null +++ b/GIGA/Category/NSString+MD5.h @@ -0,0 +1,14 @@ +// +// NSString+MD5.h +// GIGA +// +// Created by lianxiang on 2018/8/23. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface NSString (MD5) +//MD5加密 +- (NSString *)MD5; +@end diff --git a/GIGA/Category/NSString+MD5.m b/GIGA/Category/NSString+MD5.m new file mode 100644 index 0000000..df44e95 --- /dev/null +++ b/GIGA/Category/NSString+MD5.m @@ -0,0 +1,30 @@ +// +// NSString+MD5.m +// GIGA +// +// Created by lianxiang on 2018/8/23. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "NSString+MD5.h" +#import +@implementation NSString (MD5) +//MD5加密 +- (NSString *)MD5{ + + const char *ptr = [self UTF8String]; + + unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; + + CC_MD5(ptr, (unsigned int)strlen(ptr), md5Buffer); + + NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH *2]; + for (int i = 0; i -@interface GiGaBaseViewController : UIViewController +@interface GiGaBaseViewController : UIViewController { - UIView *emptyView; + UIView *_emptyView; + UIView *_noNetWorkView; } -//- (void)setNavigationViewWithBGColor:(UIColor *)bgColor TitleColor:(UIColor *)titleColor; -//- (void)setNavigationViewHidden:(BOOL)hidden; -//- (void)addBackButtonWithImageName:(NSString *)imageName; -//- (void)setBackButtonHidden:(BOOL)hidden; -//- (void)setNavigationViewBottomLineHidden:(BOOL)hidden; -// -//- (void)addRightButtonWithBGImageName:(NSString *)rightImageName action:(SEL)rightAction; -// -//- (void)addRefreshHeaderFooterForTableView:(UITableView *)tableView -// refreshHeaderSelector:(SEL)refreshHeaderSelector -// refreshFooterSelector:(SEL)refreshFooterSelector; +@property (nonatomic,strong) UIView * emptyView; +@property (nonatomic,strong) UIView * noNetWorkView; + +@property (nonatomic,strong) UITableView *tableView; + +//网络改变回调Block,-1未知、0无网络、1蜂窝数据网络、2WiFi +@property (nonatomic, copy) void(^ network)(AFNetworkReachabilityStatus status); +//当前网络状态,-1未知、0无网络、1蜂窝数据网络、2WiFi +@property (nonatomic, assign) AFNetworkReachabilityStatus currentNetworkStatus; + +- (void)showNoNetWorkView; +- (void)showEmptyView; + +-(void)addNavTitile:(NSString *)title; @end diff --git a/GIGA/Common/BaseVC/GiGaBaseViewController.m b/GIGA/Common/BaseVC/GiGaBaseViewController.m index 0177315..c1fd5df 100644 --- a/GIGA/Common/BaseVC/GiGaBaseViewController.m +++ b/GIGA/Common/BaseVC/GiGaBaseViewController.m @@ -7,6 +7,8 @@ // #import "GiGaBaseViewController.h" +#import "UIView+Toast.h" +#import "GiGaNavTitileView.h" @interface GiGaBaseViewController () { @@ -15,6 +17,7 @@ // SEL _rightBtnAction; // SEL _refreshHeaderSelector; // SEL _refreshFooterSelector; + } @end @@ -24,21 +27,87 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. + [self.view addSubview:_tableView]; + [self testNetworkStatus]; } +-(void)addNavTitile:(NSString *)title{ + + self.navigationItem.titleView = [[GiGaNavTitileView alloc] initWithString:title frame:CGRectMake(0, 0, 200, 44)]; + +} + +//没有网络返回 +- (void)showNoNetWorkView +{ +// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ +// if (self.currentNetworkStatus < 1) { +// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ +// +// }); +// } +// }); +} + +-(void)showEmptyView{ + +} + +-(void)testNetworkStatus{ + AFNetworkReachabilityManager *manager = [AFNetworkReachabilityManager sharedManager]; + weakify(self); + [manager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { + weakSelf.currentNetworkStatus = status; + if (weakSelf.network) weakSelf.network(status); + switch (status) { + case AFNetworkReachabilityStatusNotReachable: + + [[UIApplication sharedApplication].keyWindow makeToast:@"哎呀,没有网络啦~"duration:1.6 position:CSToastPositionCenter]; + + break; + + default: + break; + } + }] ; + //开始检测 + [manager startMonitoring]; +} + +//显示信息,并在设定延时后返回上级界面 +- (void)backWithShowMessage:(NSString *)message afterDelay:(CGFloat)delay +{ + [[UIApplication sharedApplication].keyWindow makeToast:message duration:1.6 position:CSToastPositionCenter]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self back]; + }); +} +- (void)back +{ + [self.navigationController popViewControllerAnimated:YES]; +} + +-(UITableView*)tableView{ + + if (!_tableView) { + + _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped]; + } + + return _tableView; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } -/* -#pragma mark - Navigation - -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. +- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { + return 0; } -*/ + +- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return 0; +} + @end diff --git a/GIGA/Common/GiGaHelper.h b/GIGA/Common/GiGaHelper.h index 0321b5f..b4ed7a7 100644 --- a/GIGA/Common/GiGaHelper.h +++ b/GIGA/Common/GiGaHelper.h @@ -38,4 +38,8 @@ */ +(NSString *)stringWithNSTimerinterval:(NSTimeInterval)interval; +//计算文字的长度 ++ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font maxSize:(CGSize)maxSize; + + @end diff --git a/GIGA/Common/GiGaHelper.m b/GIGA/Common/GiGaHelper.m index d890eeb..d45cb09 100644 --- a/GIGA/Common/GiGaHelper.m +++ b/GIGA/Common/GiGaHelper.m @@ -68,5 +68,10 @@ } +//计算文字的长度 ++ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font maxSize:(CGSize)maxSize +{ + return [text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size; +} @end diff --git a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.h b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.h new file mode 100644 index 0000000..2eaf0ab --- /dev/null +++ b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.h @@ -0,0 +1,13 @@ +// +// GiGaNavTitileView.h +// GIGA +// +// Created by lianxiang on 2018/8/23. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import + +@interface GiGaNavTitileView : UIView +- (id)initWithString:(NSString *)str frame:(CGRect)frame; +@end diff --git a/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m new file mode 100644 index 0000000..e6acebf --- /dev/null +++ b/GIGA/Common/GiGaNavTitileView/GiGaNavTitileView.m @@ -0,0 +1,28 @@ +// +// GiGaNavTitileView.m +// GIGA +// +// Created by lianxiang on 2018/8/23. +// Copyright © 2018年 com.giga.ios. All rights reserved. +// + +#import "GiGaNavTitileView.h" + +@implementation GiGaNavTitileView + +- (id)initWithString:(NSString *)str frame:(CGRect)frame +{ + if (self = [super initWithFrame:frame]) { + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)]; + label.textColor = [UIColor redColor]; + label.text = str; + label.font = [UIFont boldSystemFontOfSize:18.0f]; + label.textAlignment = NSTextAlignmentCenter; + [self addSubview:label]; + } + + return self; +} + + +@end diff --git a/GIGA/GIGA.pch b/GIGA/GIGA.pch index 412506b..8428bb5 100644 --- a/GIGA/GIGA.pch +++ b/GIGA/GIGA.pch @@ -12,6 +12,8 @@ // Include any system framework and library headers here that should be included in all compilation units. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. #import "GIGA.h" +#import "AFNetworking.h" +#import "UIView+Toast.h" #ifdef DEBUG #define GILog(fmt,...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) diff --git a/GIGA/Info.plist b/GIGA/Info.plist index 6183edb..94c9d30 100644 --- a/GIGA/Info.plist +++ b/GIGA/Info.plist @@ -29,6 +29,7 @@ UIBackgroundModes + audio remote-notification UILaunchStoryboardName diff --git a/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.h b/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.h index e082018..ea6deab 100644 --- a/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.h +++ b/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.h @@ -14,6 +14,7 @@ static NSString *const kAdUrlKey = @"adUrl"; @interface GiGaStartAdView : UIView @property (nonatomic,strong) UIImageView *adView; + /** 显示启动页广告 */ diff --git a/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m b/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m index 3df7e21..ea716fc 100644 --- a/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m +++ b/GIGA/Modules/AppAD/GiGaStartAdView/GiGaStartAdView.m @@ -16,9 +16,8 @@ @property (nonatomic,strong) NSTimer *countTimer; @property (nonatomic,assign) int count; - @end -static int const showTime = 12; +static int const showTime = 5; @implementation GiGaStartAdView @@ -51,7 +50,8 @@ static int const showTime = 12; [_adView addGestureRecognizer:tap]; CGFloat btnW = 60; CGFloat btnH = 30; - _countBtn = [[UIButton alloc] initWithFrame:CGRectMake(KMainW - btnW - 24, btnH, btnW, btnH)]; + _countBtn = [[UIButton alloc] initWithFrame:CGRectMake(KMainW - btnW - 24, btnH + 10, btnW, btnH)]; + [_countBtn addTarget:self action:@selector(removeAdView) forControlEvents:UIControlEventTouchUpInside]; [_countBtn setTitle:[NSString stringWithFormat:@"跳过%d",showTime] forState:UIControlStateNormal]; _countBtn.titleLabel.font = [UIFont systemFontOfSize:15]; @@ -76,10 +76,8 @@ static int const showTime = 12; } -(void)gotoAd{ - [self removeAdView]; NC_POST_NAME_OBJECT(APP_PUSHTO_DETAILVIEW, nil); - } -(void)countDown{ diff --git a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib index bbacb44..90c5348 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaRegistViewController.xib @@ -1,5 +1,5 @@ - + @@ -7,7 +7,6 @@ - @@ -29,7 +28,7 @@ - + @@ -37,7 +36,7 @@ - + @@ -46,7 +45,7 @@ - + @@ -55,7 +54,7 @@ - + @@ -64,28 +63,28 @@ - + - + - + - + - + - + - - + + - - + + - - + + - + - diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m index 9fb2a7a..b72ea8f 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.m @@ -112,7 +112,7 @@ #pragma mark - 登录 -(void)loginBtnAction:(UIButton *)btn{ [GiGaUserDefault saveUserId:@"123"]; - + [self dismissViewControllerAnimated:YES completion:nil]; } @end diff --git a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib index 6aab7b9..17b9337 100644 --- a/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib +++ b/GIGA/Modules/LogIn/Controller/GiGaUserLoginVC.xib @@ -1,5 +1,5 @@ - + @@ -7,7 +7,6 @@ - @@ -28,7 +27,7 @@ - + @@ -36,7 +35,7 @@ - + @@ -46,7 +45,7 @@ - + @@ -56,21 +55,21 @@ - + - + - + - +