├── LYTNetDiagnose ├── LYTConfig.h ├── LYTConfig.m ├── LYTDB │ ├── LYTSDKDataBase+LYTServersList.h │ ├── LYTSDKDataBase+LYTServersList.m │ ├── LYTSDKDataBase.h │ └── LYTSDKDataBase.m ├── LYTNetDiagnoser │ ├── LYTColorRank.h │ ├── LYTColorRank.m │ ├── LYTNetConnect.h │ ├── LYTNetConnect.m │ ├── LYTNetDiagnoser.h │ ├── LYTNetDiagnoser.m │ ├── LYTNetGetAddress.h │ ├── LYTNetGetAddress.m │ ├── LYTNetInfo.h │ ├── LYTNetInfo.m │ ├── LYTNetTimer.h │ ├── LYTNetTimer.m │ ├── LYTNetTraceRoute.h │ ├── LYTNetTraceRoute.m │ ├── LYTNetWorkReqestTool.h │ ├── LYTNetWorkReqestTool.m │ ├── LYTPingInfo.h │ ├── LYTPingInfo.m │ ├── LYTRoute.h │ └── SRPingHepler │ │ ├── LYTPingHelper.h │ │ ├── LYTPingHelper.m │ │ ├── LYTSimplePing.h │ │ ├── LYTSimplePing.m │ │ ├── PingResult.h │ │ └── PingResult.m ├── MainViewController │ ├── LYTScreenView │ │ ├── LYTScreenView.h │ │ └── LYTScreenView.m │ ├── MainViewController.h │ ├── MainViewController.m │ ├── Model │ │ ├── MainViewModel.h │ │ └── MainViewModel.m │ ├── TYHBaseViewController.h │ ├── TYHBaseViewController.m │ ├── View │ │ ├── MainViewCell.h │ │ └── MainViewCell.m │ └── 控制台 │ │ ├── DNS │ │ ├── LYTDNSViewController.h │ │ ├── LYTDNSViewController.m │ │ └── LYTDNSViewController.xib │ │ ├── ping │ │ ├── LYTPingViewController.h │ │ ├── LYTPingViewController.m │ │ └── LYTPingViewController.xib │ │ ├── traceroute │ │ ├── TracerouteViewController2.h │ │ ├── TracerouteViewController2.m │ │ └── TracerouteViewController2.xib │ │ └── 端口探测 │ │ ├── TYHPortScanController.h │ │ ├── TYHPortScanController.m │ │ └── TYHPortScanController.xib └── 第三方 │ ├── LYTdb │ ├── LYTDB.h │ ├── LYTDatabase.h │ ├── LYTDatabase.m │ ├── LYTDatabaseAdditions.h │ ├── LYTDatabaseAdditions.m │ ├── LYTDatabasePool.h │ ├── LYTDatabasePool.m │ ├── LYTDatabaseQueue.h │ ├── LYTDatabaseQueue.m │ ├── LYTResultSet.h │ └── LYTResultSet.m │ ├── NSString+NetTool.h │ ├── NSString+NetTool.m │ ├── UIColor+TYHColor.h │ ├── UIColor+TYHColor.m │ ├── UIView+Extension.h │ └── UIView+Extension.m ├── Podfile ├── Podfile.lock ├── Pods ├── Headers │ ├── Private │ │ ├── MJExtension │ │ │ ├── MJExtension.h │ │ │ ├── MJExtensionConst.h │ │ │ ├── MJFoundation.h │ │ │ ├── MJProperty.h │ │ │ ├── MJPropertyKey.h │ │ │ ├── MJPropertyType.h │ │ │ ├── NSObject+MJClass.h │ │ │ ├── NSObject+MJCoding.h │ │ │ ├── NSObject+MJKeyValue.h │ │ │ ├── NSObject+MJProperty.h │ │ │ └── NSString+MJExtension.h │ │ ├── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ │ ├── SDAutoLayout │ │ │ ├── SDAutoLayout.h │ │ │ ├── UITableView+SDAutoTableViewCellHeight.h │ │ │ └── UIView+SDAutoLayout.h │ │ └── SVProgressHUD │ │ │ ├── SVIndefiniteAnimatedView.h │ │ │ ├── SVProgressAnimatedView.h │ │ │ ├── SVProgressHUD.h │ │ │ └── SVRadialGradientLayer.h │ └── Public │ │ ├── MJExtension │ │ ├── MJExtension.h │ │ ├── MJExtensionConst.h │ │ ├── MJFoundation.h │ │ ├── MJProperty.h │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyType.h │ │ ├── NSObject+MJClass.h │ │ ├── NSObject+MJCoding.h │ │ ├── NSObject+MJKeyValue.h │ │ ├── NSObject+MJProperty.h │ │ └── NSString+MJExtension.h │ │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ ├── View+MASShorthandAdditions.h │ │ └── ViewController+MASAdditions.h │ │ ├── SDAutoLayout │ │ ├── SDAutoLayout.h │ │ ├── UITableView+SDAutoTableViewCellHeight.h │ │ └── UIView+SDAutoLayout.h │ │ └── SVProgressHUD │ │ ├── SVIndefiniteAnimatedView.h │ │ ├── SVProgressAnimatedView.h │ │ ├── SVProgressHUD.h │ │ └── SVRadialGradientLayer.h ├── MJExtension │ ├── LICENSE │ ├── MJExtension │ │ ├── MJExtension.h │ │ ├── MJExtensionConst.h │ │ ├── MJExtensionConst.m │ │ ├── MJFoundation.h │ │ ├── MJFoundation.m │ │ ├── MJProperty.h │ │ ├── MJProperty.m │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyKey.m │ │ ├── MJPropertyType.h │ │ ├── MJPropertyType.m │ │ ├── NSObject+MJClass.h │ │ ├── NSObject+MJClass.m │ │ ├── NSObject+MJCoding.h │ │ ├── NSObject+MJCoding.m │ │ ├── NSObject+MJKeyValue.h │ │ ├── NSObject+MJKeyValue.m │ │ ├── NSObject+MJProperty.h │ │ ├── NSObject+MJProperty.m │ │ ├── NSString+MJExtension.h │ │ └── NSString+MJExtension.m │ └── README.md ├── Manifest.lock ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ ├── shen.xcuserdatad │ │ └── xcschemes │ │ │ ├── MJExtension.xcscheme │ │ │ ├── Masonry.xcscheme │ │ │ ├── Pods-SpeedTest.xcscheme │ │ │ ├── SDAutoLayout.xcscheme │ │ │ ├── SVProgressHUD.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── zhangyoubo.xcuserdatad │ │ └── xcschemes │ │ ├── MJExtension.xcscheme │ │ ├── Masonry.xcscheme │ │ ├── Pods-SpeedTest.xcscheme │ │ ├── SDAutoLayout.xcscheme │ │ ├── SVProgressHUD.xcscheme │ │ └── xcschememanagement.plist ├── SDAutoLayout │ ├── LICENSE │ ├── README.md │ └── SDAutoLayoutDemo │ │ └── SDAutoLayout │ │ ├── SDAutoLayout.h │ │ ├── UITableView+SDAutoTableViewCellHeight.h │ │ ├── UITableView+SDAutoTableViewCellHeight.m │ │ ├── UIView+SDAutoLayout.h │ │ └── UIView+SDAutoLayout.m ├── SVProgressHUD │ ├── LICENSE.txt │ ├── README.md │ └── SVProgressHUD │ │ ├── SVIndefiniteAnimatedView.h │ │ ├── SVIndefiniteAnimatedView.m │ │ ├── SVProgressAnimatedView.h │ │ ├── SVProgressAnimatedView.m │ │ ├── SVProgressHUD.bundle │ │ ├── angle-mask.png │ │ ├── angle-mask@2x.png │ │ ├── angle-mask@3x.png │ │ ├── error.png │ │ ├── error@2x.png │ │ ├── error@3x.png │ │ ├── info.png │ │ ├── info@2x.png │ │ ├── info@3x.png │ │ ├── success.png │ │ ├── success@2x.png │ │ └── success@3x.png │ │ ├── SVProgressHUD.h │ │ ├── SVProgressHUD.m │ │ ├── SVRadialGradientLayer.h │ │ └── SVRadialGradientLayer.m └── Target Support Files │ ├── MJExtension │ ├── MJExtension-dummy.m │ ├── MJExtension-prefix.pch │ └── MJExtension.xcconfig │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ ├── Pods-SpeedTest │ ├── Pods-SpeedTest-acknowledgements.markdown │ ├── Pods-SpeedTest-acknowledgements.plist │ ├── Pods-SpeedTest-dummy.m │ ├── Pods-SpeedTest-frameworks.sh │ ├── Pods-SpeedTest-resources.sh │ ├── Pods-SpeedTest.debug.xcconfig │ └── Pods-SpeedTest.release.xcconfig │ ├── SDAutoLayout │ ├── SDAutoLayout-dummy.m │ ├── SDAutoLayout-prefix.pch │ └── SDAutoLayout.xcconfig │ └── SVProgressHUD │ ├── SVProgressHUD-dummy.m │ ├── SVProgressHUD-prefix.pch │ └── SVProgressHUD.xcconfig ├── README.md ├── SpeedTest.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── shen.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── shen.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── SpeedTest.xcscheme │ │ └── xcschememanagement.plist │ └── zhangyoubo.xcuserdatad │ └── xcschemes │ ├── SpeedTest.xcscheme │ └── xcschememanagement.plist ├── SpeedTest.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ ├── shen.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── zhangyoubo.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── SpeedTest ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── backImage.imageset │ │ ├── Contents.json │ │ ├── 返回箭头@2x.png │ │ └── 返回箭头@3x.png │ ├── iconfont-home.imageset │ │ ├── Contents.json │ │ ├── iconfont-home.png │ │ └── iconfont-home@2x.png │ ├── iconfont-homeselected.imageset │ │ ├── Contents.json │ │ ├── iconfont-home.png │ │ └── iconfont-home@2x.png │ ├── iconfont-sousuo.imageset │ │ ├── Contents.json │ │ ├── iconfont-sousuo.png │ │ └── iconfont-sousuo@2x.png │ ├── iconfont-sousuoselected.imageset │ │ ├── Contents.json │ │ ├── iconfont-sousuo.png │ │ └── iconfont-sousuo@2x.png │ ├── iconfont-wode.imageset │ │ ├── Contents.json │ │ ├── iconfont-wode.png │ │ └── iconfont-wode@2x.png │ ├── iconfont-wodeselected.imageset │ │ ├── Contents.json │ │ ├── iconfont-wode.png │ │ └── iconfont-wode@2x.png │ ├── mycenterabout.imageset │ │ ├── Contents.json │ │ └── my.png │ └── pingfenabout.imageset │ │ ├── Contents.json │ │ └── 我们.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CKAlertViewController │ ├── CKAlertViewController.h │ └── CKAlertViewController.m ├── Info.plist ├── Main │ ├── AboutVC.h │ ├── AboutVC.m │ ├── MainVC.h │ ├── MainVC.m │ ├── SetVC.h │ └── SetVC.m ├── OtherController │ ├── BaseVC.h │ ├── BaseVC.m │ ├── NaviVC.h │ ├── NaviVC.m │ ├── TabVC.h │ └── TabVC.m ├── PrefixHeader.pch ├── ReplicatorHUD │ ├── ReplicatorView.h │ └── ReplicatorView.m ├── Tool │ ├── EPProgressShow.h │ ├── EPProgressShow.m │ ├── MeasurNetTools.h │ ├── MeasurNetTools.m │ ├── NetWorkReachability.h │ ├── NetWorkReachability.m │ ├── QBTools.h │ ├── QBTools.m │ ├── UIImage+Extension.h │ └── UIImage+Extension.m └── main.m ├── SpeedTestTests ├── Info.plist └── SpeedTestTests.m └── SpeedTestUITests ├── Info.plist └── SpeedTestUITests.m /LYTNetDiagnose/LYTConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTConfig.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Masonry.h" 11 | #import "LYTSDKDataBase.h" 12 | #import "LYTSDKDataBase+LYTServersList.h" 13 | #import "NSString+NetTool.h" 14 | 15 | #define TitleFont 19 16 | #define DestTitleFont 14 17 | #define contentFont 13 18 | 19 | #define LYWeakSelf __weak typeof(self) weakSelf = self; 20 | //常见颜色 21 | #define backColor [UIColor colorWithRed:0.757 green:0.875 blue:1.000 alpha:1.000]; 22 | 23 | //蓝色 24 | #define colorC1D [UIColor colorWithRed:0.757 green:0.875 blue:1.000 alpha:1.000] 25 | #define color8FD [UIColor colorWithRed:0.561 green:0.827 blue:1.000 alpha:1.000] 26 | #define color72c [UIColor colorWithRed:0.447 green:0.784 blue:1.000 alpha:1.000] 27 | 28 | #define color01a [UIColor colorWithRed:0.004 green:0.651 blue:0.996 alpha:1.000] 29 | #define color227shallblue [UIColor colorWithRed:0.133 green:0.478 blue:0.898 alpha:1.000] 30 | #define color004deepblue [UIColor colorWithRed:0.000 green:0.310 blue:0.686 alpha:1.000] 31 | @interface LYTConfig : NSObject 32 | 33 | + (NSArray *)mainViewArray; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTConfig.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTConfig.h" 10 | 11 | #define title @"title" 12 | #define desTitle @"desTitle" 13 | #define imageName @"imageName" 14 | #define className @"className" 15 | @implementation LYTConfig 16 | + (NSArray *)mainViewArray{ 17 | NSArray *array = @[ 18 | @{title:@"ping", 19 | desTitle:@"利用“ping”命令可以检查网络是否连通,可以很好地帮助我们分析和判定网络故障", 20 | imageName:@"", 21 | className:@"LYTPingViewController"}, 22 | @{title:@"Traceroute", 23 | desTitle:@"用来发出数据包的主机到目标主机之间所经过的网关的工具", 24 | imageName:@"", 25 | className:@"TracerouteViewController2", 26 | }, 27 | @{title:@"DNS", 28 | desTitle:@"因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP数串。", 29 | imageName:@"", 30 | className:@"LYTDNSViewController" 31 | }, 32 | @{title:@"端口检测", 33 | desTitle:@"", 34 | imageName:@"", 35 | className:@"TYHPortScanController", 36 | }, 37 | 38 | ]; 39 | return array; 40 | } 41 | @end 42 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTDB/LYTSDKDataBase+LYTServersList.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTSDKDataBase+LYTServersList.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/6. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTSDKDataBase.h" 10 | 11 | @interface LYTSDKDataBase (LYTServersList) 12 | - (void)createChatdbServersList; 13 | 14 | #pragma mark - add 15 | /** 16 | 插入新的列表 增加 17 | */ 18 | - (void)dbInsertserver:(NSString *)server 19 | succeed:(void (^)(BOOL result))block; 20 | #pragma mark - delete 21 | 22 | 23 | #pragma mark - quary 24 | - (void)dbAllServersSucceed:(void (^)(NSArray *servers))block; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTDB/LYTSDKDataBase+LYTServersList.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTSDKDataBase+LYTServersList.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/6. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTSDKDataBase+LYTServersList.h" 10 | #import "LYTConfig.h" 11 | @implementation LYTSDKDataBase (LYTServersList) 12 | - (void)createChatdbServersList{ 13 | [self.dbQueue inDatabase:^(LYTDatabase *db) { 14 | BOOL result = [db executeUpdate:@"create table if not exists server_list_table(\ 15 | id INTEGER PRIMARY KEY AUTOINCREMENT,\ 16 | Servers text);"]; 17 | NSAssert(result, @"createChatdbChatList Error"); 18 | }]; 19 | } 20 | - (void)dbInsertserver:(NSString *)server 21 | succeed:(void (^)(BOOL result))block{ 22 | 23 | if (server.length== 0) { 24 | return; 25 | } 26 | LYWeakSelf; 27 | dispatch_async(_concurrentQueue, ^{ 28 | __block BOOL result = NO; 29 | [weakSelf.dbQueue inTransaction:^(LYTDatabase *db, BOOL *rollback) { 30 | result = [db executeUpdate:@"insert into server_list_table(Servers) values (?)",server]; 31 | }]; 32 | dispatch_async(dispatch_get_main_queue(), ^{ 33 | if (block) { 34 | block(result); 35 | } 36 | }); 37 | 38 | }); 39 | 40 | } 41 | - (void)dbAllServersSucceed:(void (^)(NSArray *servers))block{ 42 | LYWeakSelf 43 | __block NSMutableArray *array = @[].mutableCopy; 44 | dispatch_async(_concurrentQueue, ^{ 45 | [weakSelf.dbQueue inDatabase:^(LYTDatabase *db) { 46 | 47 | LYTResultSet *rs = [db executeQuery:[NSString stringWithFormat:@"select * from server_list_table;"]]; 48 | while (rs.next) { 49 | NSString *server = [rs stringForColumn:@"Servers"]; 50 | if (server.length > 0) { 51 | [array addObject:server]; 52 | } 53 | } 54 | [rs close]; 55 | // 回调 56 | dispatch_async(dispatch_get_main_queue(), ^{ 57 | block(array); 58 | }); 59 | }]; 60 | }); 61 | } 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTDB/LYTSDKDataBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTSDKDataBase.h 3 | // LeYingTong 4 | // 5 | // Created by shangen on 17/2/6. 6 | // Copyright © 2017年 HHLY. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LYTDB.h" 11 | 12 | // 空值校验 13 | #define nilReturn(obj,Block) if (obj == nil) {\ 14 | block(Block);\ 15 | return;} 16 | 17 | // 未登录校验回调 18 | #define unloginResult(rezult) \ 19 | if (!self.dbQueue) {\ 20 | !compelete ?: compelete(rezult);\ 21 | return;\ 22 | } 23 | 24 | // 未登录 主线程回调 25 | #define unloginBlock(rezult) \ 26 | if (!self.dbQueue) {\ 27 | dispatch_async(dispatch_get_main_queue(), ^{ \ 28 | !block ?: block(rezult);\ 29 | });\ 30 | return;\ 31 | } 32 | 33 | 34 | @interface LYTSDKDataBase : NSObject 35 | { 36 | dispatch_queue_t _concurrentQueue; 37 | dispatch_queue_t _serialQueue; 38 | 39 | } 40 | + (instancetype)shareDatabase; 41 | @property (nonatomic,strong) LYTDatabaseQueue *dbQueue; 42 | 43 | /** 44 | 创建数据库 45 | */ 46 | - (void)createSqlite; 47 | 48 | 49 | /** 50 | 关闭数据库 退出登录调用 51 | */ 52 | - (void)closeSqlite; 53 | 54 | /** 55 | 清理本地的数据库 56 | */ 57 | - (void)clearLoaclDatabase; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTDB/LYTSDKDataBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTSDKDataBase.m 3 | // LeYingTong 4 | // 5 | // Created by shangen on 17/2/6. 6 | // Copyright © 2017年 HHLY. All rights reserved. 7 | // 8 | 9 | #import "LYTSDKDataBase.h" 10 | #import "LYTSDKDataBase+LYTServersList.h" 11 | @implementation LYTSDKDataBase 12 | static LYTSDKDataBase *dataBase = nil; 13 | + (instancetype)shareDatabase { 14 | static dispatch_once_t onceToken; 15 | dispatch_once(&onceToken, ^{ 16 | dataBase = [[[LYTSDKDataBase class] alloc] init]; 17 | }); 18 | return dataBase; 19 | } 20 | 21 | - (instancetype)init { 22 | if (self = [super init]){ 23 | _concurrentQueue = dispatch_queue_create("LYTSDKDataBase", DISPATCH_QUEUE_CONCURRENT); 24 | _serialQueue = dispatch_queue_create("LYTSDKDataBase", DISPATCH_QUEUE_SERIAL); 25 | } 26 | return self; 27 | } 28 | 29 | - (NSString *)dbPath { 30 | NSString * document = @"/COM.HHLY.LYTSDK"; 31 | NSString *documentPath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingString:document]; 32 | if (![[NSFileManager defaultManager] fileExistsAtPath:documentPath]) { 33 | [[NSFileManager defaultManager] createDirectoryAtPath:documentPath withIntermediateDirectories:YES attributes:nil error:nil]; 34 | } 35 | NSString *dbName = @"LYTNetDiagose.sqlite"; 36 | return [documentPath stringByAppendingPathComponent:dbName] ; 37 | } 38 | 39 | - (void)createSqlite { 40 | [self closeSqlite]; 41 | _dbQueue = [LYTDatabaseQueue databaseQueueWithPath:[self dbPath]]; 42 | [self createChatdbServersList]; 43 | 44 | 45 | NSLog(@"SDK_DB---%@",[self dbPath]); 46 | } 47 | 48 | - (void)closeSqlite { 49 | if (_dbQueue) { 50 | [_dbQueue close]; 51 | _dbQueue = nil; 52 | } 53 | } 54 | 55 | - (void)dealloc{ 56 | 57 | } 58 | 59 | - (void)clearLoaclDatabase{ 60 | 61 | NSString *dbPathstr = [self dbPath]; 62 | BOOL result = [[NSFileManager defaultManager] removeItemAtPath:dbPathstr error:nil]; 63 | NSLog(@"删除本地的数据库结果=%zd",result); 64 | if (result) {//重新创建新的数据库 65 | [self createSqlite]; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTColorRank.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTColorRank.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/24. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | @interface LYTColorRank : NSObject 12 | + (UIColor *)pingColorWithDurationTime:(NSString *)durationTime; 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTColorRank.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTColorRank.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/24. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTColorRank.h" 10 | 11 | @implementation LYTColorRank 12 | + (UIColor *)pingColorWithDurationTime:(NSString *)durationTime{ 13 | CGFloat time = [durationTime floatValue]; 14 | if (time <= 100 && time != 0) { 15 | int greenRank = time/10; 16 | switch (greenRank) { 17 | case 0: 18 | return [UIColor greenColor]; 19 | break; 20 | case 1: 21 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.9]; 22 | break; 23 | case 2: 24 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.8]; 25 | break; 26 | case 3: 27 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.7]; 28 | break; 29 | case 4: 30 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.6]; 31 | break; 32 | case 5: 33 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.5]; 34 | break; 35 | case 6: 36 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.4]; 37 | break; 38 | case 7: 39 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.3]; 40 | break; 41 | case 8: 42 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.2]; 43 | break; 44 | case 9: 45 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.1]; 46 | break; 47 | case 10: 48 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:0.1]; 49 | break; 50 | default: 51 | return [UIColor colorWithRed:0 green:1 blue:0 alpha:1]; 52 | break; 53 | } 54 | }else if(time > 100&& time != 0){ 55 | int readRank = time/100; 56 | switch (readRank) { 57 | case 1: 58 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.1]; 59 | break; 60 | case 2: 61 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.2]; 62 | break; 63 | case 3: 64 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.3]; 65 | break; 66 | case 4: 67 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.4]; 68 | break; 69 | case 5: 70 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.5]; 71 | break; 72 | case 6: 73 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.6]; 74 | break; 75 | case 7: 76 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.7]; 77 | case 8: 78 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.8]; 79 | break; 80 | case 9: 81 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:0.9]; 82 | break; 83 | case 10: 84 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:1.0]; 85 | break; 86 | default: 87 | return [UIColor colorWithRed:1 green:0 blue:0 alpha:1.0]; 88 | break; 89 | } 90 | } 91 | return [UIColor blackColor]; 92 | } 93 | @end 94 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetConnect.h: -------------------------------------------------------------------------------- 1 | // 2 | // LDNetConnect.h 3 | // LDNetDiagnoServiceDemo 4 | // 5 | // Created by ZhangHaiyang on 15-8-5. 6 | // Copyright (c) 2015年 庞辉. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /* 12 | * @protocal LDNetConnectDelegate监测connect命令的的输出到日志变量; 13 | * 14 | */ 15 | @protocol LDNetConnectDelegate 16 | - (void)appendSocketLog:(NSString *)socketLog; 17 | - (void)connectDidEnd:(BOOL)success; 18 | @end 19 | 20 | 21 | /* 22 | * @class LDNetConnect ping监控 23 | * 主要是通过建立socket连接的过程,监控目标主机是否连通 24 | * 连续执行五次,因为每次的速度不一致,可以观察其平均速度来判断网络情况 25 | */ 26 | @interface LYTNetConnect : NSObject { 27 | } 28 | 29 | @property (nonatomic, weak) id delegate; 30 | 31 | /** 32 | * 通过hostaddress和port 进行connect诊断 33 | */ 34 | - (void)runWithHostAddress:(NSString *)hostAddress port:(NSInteger)port maxTestCount:(NSInteger)testCount; 35 | 36 | /** 37 | * 停止connect 38 | */ 39 | - (void)stopConnect; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetDiagnoser.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTNetDiagnoser.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LYTPingInfo.h" 11 | //网络类型 12 | typedef enum { 13 | NETWORK_TYPE_NONE = 0,//未连接网络 14 | NETWORK_TYPE_2G = 1, 15 | NETWORK_TYPE_3G = 2, 16 | NETWORK_TYPE_4G = 3, 17 | NETWORK_TYPE_5G = 4, // 5G目前为猜测结果 18 | NETWORK_TYPE_WIFI = 5, 19 | } NETWORK_TYPE; 20 | @class LYTNetDiagnoser; 21 | @class LYTNetInfo; 22 | @protocol LYTNetDiagnoseDelegate 23 | 24 | /** 25 | 开始扫描 26 | */ 27 | - (void)diagnoserBeginScan:(LYTNetDiagnoser *)dignoser; 28 | 29 | /** 30 | 停止扫描 31 | */ 32 | - (void)diagnoserErrorScan:(LYTNetDiagnoser *)dignoser errorInfo:(LYTNetInfo *)errorInfo; 33 | 34 | /** 35 | 扫描完毕 36 | @param info 获取得到的网络信息 37 | */ 38 | - (void)diagnoserEndScan:(LYTNetDiagnoser *)dignoser netInfo:(LYTNetInfo *)info; 39 | 40 | 41 | @end 42 | @protocol LYTNetPingDelegate 43 | 44 | - (void)pingDidReportSequence:(NSUInteger)seq timeout:(BOOL)isTimeout delay:(NSUInteger)delay packetLoss:(double)lossRate host:(NSString *)ip; 45 | 46 | - (void)pingDidStopPingRequest; 47 | @end 48 | 49 | @interface LYTNetDiagnoser : NSObject 50 | @property (weak, nonatomic) id diagnoseDelegate; 51 | @property (weak, nonatomic) id pingDelegate; 52 | 53 | + (instancetype)shareTool; 54 | 55 | /** 56 | 开始扫描 57 | 58 | @param delegate 扫描状态传递给代理 59 | */ 60 | - (void)startNetScanWithDelegate:(id)delegate; 61 | 62 | //自身获取 63 | - (NSString *)getLocalIP; 64 | - (NSString *)getGatewayIP; 65 | - (NSArray *)getLocalDNSAddress; 66 | - (NSString *)getPublicIP; 67 | - (NSString *)getNetSIMCardProviderCompany; 68 | - (NETWORK_TYPE )getNetType; 69 | 70 | /** 71 | DNS解析 72 | 73 | @param domainName 域名 eg ”www.baidu.com" 74 | @param resposeblock 回调DNS解析的结果 75 | */ 76 | - (void)getDNSFromDomain:(NSString *)domainName respose:(void(^)(LYTPingInfo * info))resposeblock; 77 | 78 | /** 79 | ping 域名延迟测试 80 | 81 | @param domainName 域名或者host eg “www.baidu.com"、“8.8.8.8” 82 | @param times 次数 83 | @param resposeblock 结果 84 | */ 85 | - (void)testPingRequestDomain:(NSString *)domainName count:(NSInteger)times respose:(void(^)(LYTPingInfo * info))resposeblock error:(void(^)(NSString *error))errorBlock; 86 | 87 | /** 88 | 停止ping测试 89 | */ 90 | - (void)stopTestPing; 91 | @end 92 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetGetAddress.h: -------------------------------------------------------------------------------- 1 | // 2 | // LDNetGetAddress.h 3 | // LDNetDiagnoServiceDemo 4 | // 5 | // Created by ZhangHaiyang on 15-8-5. 6 | // Copyright (c) 2015年 庞辉. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "LYTNetDiagnoser.h" 12 | 13 | @interface LYTNetGetAddress : NSObject 14 | 15 | 16 | /*! 17 | * 获取当前设备ip地址 18 | */ 19 | + (NSString *)deviceIPAddress; 20 | 21 | 22 | /*! 23 | * 获取当前设备网关地址 24 | */ 25 | + (NSString *)getGatewayIPAddress; 26 | 27 | 28 | /*! 29 | * 通过域名获取服务器DNS地址 30 | */ 31 | + (NSArray *)getDNSsWithDormain:(NSString *)hostName; 32 | 33 | 34 | /*! 35 | * 获取本地网络的DNS地址 36 | */ 37 | + (NSArray *)outPutDNSServers; 38 | 39 | 40 | /*! 41 | * 获取当前网络类型 42 | */ 43 | + (NETWORK_TYPE)getNetworkTypeFromStatusBar; 44 | 45 | /** 46 | * 格式化IPV6地址 47 | */ 48 | +(NSString *)formatIPV6Address:(struct in6_addr)ipv6Addr; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NetInfo.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LYTNetDiagnoser.h" 11 | @interface LYTNetInfo : NSObject 12 | 13 | /** 14 | 国家 15 | */ 16 | @property (copy, nonatomic) NSString *country; 17 | 18 | /** 19 | 区域 20 | */ 21 | @property (copy, nonatomic) NSString *area; 22 | 23 | /** 24 | 省份 25 | */ 26 | @property (copy, nonatomic) NSString *region; 27 | 28 | /** 29 | 城市 30 | */ 31 | @property (copy, nonatomic) NSString *city; 32 | 33 | /** 34 | 提供商 35 | */ 36 | @property (copy, nonatomic) NSString *isp; 37 | 38 | /** 39 | 公网iP 40 | */ 41 | @property (copy, nonatomic) NSString *publicIP; 42 | 43 | /** 44 | 机器IP 45 | */ 46 | @property (copy, nonatomic) NSString *deviceIPAddres; 47 | 48 | /** 49 | 网关地址 50 | */ 51 | @property (copy, nonatomic) NSString *gatewayIPAddress; 52 | 53 | /** 54 | 本地DNS 55 | */ 56 | @property (copy, nonatomic) NSArray *localDNSAddress; 57 | 58 | /** 59 | 网络类型 60 | */ 61 | @property (assign, nonatomic) NETWORK_TYPE netType; 62 | 63 | /** 64 | 获取SIM卡的运营商信息 65 | */ 66 | @property (copy, nonatomic) NSString *SIMCardProviderCompany; 67 | 68 | /** 69 | app版本 70 | */ 71 | @property (copy, nonatomic) NSString *appVersion; 72 | 73 | /** 74 | 手机设备ID 75 | */ 76 | @property (copy, nonatomic) NSString *deviceID; 77 | @end 78 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // NetInfo.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTNetInfo.h" 10 | 11 | @implementation LYTNetInfo 12 | -(NSString *)description{ 13 | NSString *netType; 14 | switch (self.netType) { 15 | case 0: 16 | netType = @"未联网"; 17 | break; 18 | case 1: 19 | netType = @"2G网络"; 20 | case 2: 21 | netType = @"3G网络"; 22 | break; 23 | case 3: 24 | netType = @"4G网络"; 25 | break; 26 | case 4: 27 | netType = @"5G网络"; 28 | break; 29 | case 5: 30 | netType = @"wifi网络"; 31 | break; 32 | default: 33 | netType = @"未知网络"; 34 | break; 35 | } 36 | return [NSString stringWithFormat:@"\n国家:%@\n区域:%@\n省份:%@\n城市:%@\n运营商:%@\n公网地址:%@\n手机IP:%@\n网关地址:%@\nDNS地址:%@\n网络类型:%@\nSIM制式:%@\napp版本:%@\n手机标识别:%@\n",self.country,self.area,self.region,self.city,self.isp,self.publicIP,self.deviceIPAddres,self.gatewayIPAddress,self.localDNSAddress,netType,self.SIMCardProviderCompany,self.appVersion,self.deviceID]; 37 | } 38 | @end 39 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetTimer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LDNetTimer.h 3 | // LDNetDiagnoServieDemo 4 | // 5 | // Created by 庞辉 on 14-10-29. 6 | // Copyright (c) 2014年 庞辉. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LYTNetTimer : NSObject { 12 | } 13 | 14 | 15 | /** 16 | * Retourne un timestamp en microsecondes. 17 | */ 18 | + (long)getMicroSeconds; 19 | 20 | 21 | /** 22 | * Calcule une durée en millisecondes par rapport au timestamp passé en paramètre. 23 | */ 24 | + (long)computeDurationSince:(long)uTime; 25 | @end 26 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetTimer.m: -------------------------------------------------------------------------------- 1 | // 2 | // LDNetTimer.m 3 | // LDNetDiagnoServieDemo 4 | // 5 | // Created by 庞辉 on 14-10-29. 6 | // Copyright (c) 2014年 庞辉. All rights reserved. 7 | // 8 | #include 9 | #import "LYTNetTimer.h" 10 | 11 | @implementation LYTNetTimer 12 | 13 | /** 14 | * Retourne un timestamp en microsecondes. 15 | */ 16 | + (long)getMicroSeconds 17 | { 18 | struct timeval time; 19 | gettimeofday(&time, NULL); 20 | return time.tv_usec; 21 | } 22 | 23 | /** 24 | * Calcule une durée en millisecondes par rapport au timestamp passé en paramètre. 25 | */ 26 | + (long)computeDurationSince:(long)uTime 27 | { 28 | long now = [LYTNetTimer getMicroSeconds]; 29 | if (now < uTime) { 30 | return 1000000 - uTime + now; 31 | } 32 | return now - uTime; 33 | } 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetTraceRoute.h: -------------------------------------------------------------------------------- 1 | // 2 | // TraceRoute.h 3 | // LDNetCheckServiceDemo 4 | // 5 | // Created by 庞辉 on 14-10-29. 6 | // Copyright (c) 2014年 庞辉. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | static const int TRACEROUTE_PORT = 30001; 12 | static const int TRACEROUTE_MAX_TTL = 30; 13 | static const int TRACEROUTE_ATTEMPTS = 3; 14 | static const int TRACEROUTE_TIMEOUT = 5000000; 15 | 16 | /* 17 | * @protocal LDNetTraceRouteDelegate监测TraceRoute命令的的输出到日志变量; 18 | * 19 | */ 20 | @protocol LYTNetTraceRouteDelegate 21 | - (void)appendRouteLog:(NSString *)routeLog; 22 | - (void)traceRouteDidEnd; 23 | @end 24 | 25 | 26 | /* 27 | * @class LDNetTraceRoute TraceRoute网络监控 28 | * 主要是通过模拟shell命令traceRoute的过程,监控网络站点间的跳转 29 | * 默认执行20转,每转进行三次发送测速 30 | */ 31 | @interface LYTNetTraceRoute : NSObject { 32 | int udpPort; //执行端口 33 | int maxTTL; //执行转数 34 | int readTimeout; //每次发送时间的timeout 35 | int maxAttempts; //每转的发送次数 36 | NSString *running; 37 | bool isrunning; 38 | } 39 | 40 | @property (nonatomic, weak) id delegate; 41 | 42 | /** 43 | * 初始化 44 | */ 45 | - (LYTNetTraceRoute *)initWithMaxTTL:(int)ttl 46 | timeout:(int)timeout 47 | maxAttempts:(int)attempts 48 | port:(int)port; 49 | 50 | /** 51 | * 监控tranceroute 路径 52 | */ 53 | - (Boolean)doTraceRoute:(NSString *)host; 54 | 55 | /** 56 | * 停止traceroute 57 | */ 58 | - (void)stopTrace; 59 | - (bool)isRunning; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetWorkReqestTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // NetWorkReqestTool.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | @class LYTNetInfo; 11 | @interface LYTNetWorkReqestTool : NSObject 12 | + (instancetype)shareManager; 13 | - (void)requestMyIPaddressSuccessBlock:(void (^)(LYTNetInfo * info))block; 14 | @end 15 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTNetWorkReqestTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // NetWorkReqestTool.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTNetWorkReqestTool.h" 10 | #import "LYTNetInfo.h" 11 | @interface LYTNetWorkReqestTool () 12 | 13 | @end 14 | @implementation LYTNetWorkReqestTool 15 | + (instancetype)shareManager{ 16 | static LYTNetWorkReqestTool *_shareManager; 17 | static dispatch_once_t onceToken; 18 | dispatch_once(&onceToken, ^{ 19 | _shareManager = [[LYTNetWorkReqestTool alloc] init]; 20 | }); 21 | return _shareManager; 22 | } 23 | - (void)requestMyIPaddressSuccessBlock:(void (^)(LYTNetInfo * info))block{ 24 | // NSURL *URL1 = [NSURL URLWithString:@"http://pv.sohu.com/cityjson?ie=utf-8"]; 25 | NSURL *URL2 = [NSURL URLWithString:@"http://ip.taobao.com/service/getIpInfo.php?ip=myip"]; 26 | 27 | NSURLRequest *request = [NSURLRequest requestWithURL:URL2]; 28 | NSURLSession *session = [NSURLSession sharedSession]; 29 | NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * data, NSURLResponse * response, NSError * error) { 30 | LYTNetInfo *info = [[LYTNetInfo alloc] init]; 31 | 32 | if (200 == [(NSHTTPURLResponse *)response statusCode]) { 33 | // NSString *response2 = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 34 | NSError *error = nil; 35 | NSDictionary * json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; 36 | if (json) { 37 | info.country = json[@"data"][@"country"]; 38 | info.area = json[@"data"][@"area"]; 39 | info.region = json[@"data"][@"region"]; 40 | info.city = json[@"data"][@"city"]; 41 | info.isp = json[@"data"][@"isp"]; 42 | info.publicIP = json[@"data"][@"ip"]; 43 | } 44 | block(info); 45 | }else{ 46 | block(info); 47 | } 48 | }]; 49 | [dataTask resume]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTPingInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTDetecteInfo.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LYTPingInfo : NSObject 12 | 13 | /** 14 | 经历的时间 15 | */ 16 | @property (assign, nonatomic) float durationTime; 17 | 18 | /** 19 | 消息序号 20 | */ 21 | @property (copy, nonatomic) NSString *sequence; 22 | 23 | /** 24 | 消息标示 25 | */ 26 | @property (copy, nonatomic) NSString *identifier; 27 | 28 | 29 | /** 30 | 携带的信息 31 | */ 32 | @property (copy, nonatomic) NSString *infoStr; 33 | 34 | /** 35 | 存储数组 36 | */ 37 | @property (nonatomic,strong) NSArray *infoArray; 38 | @end 39 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/LYTPingInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTDetecteInfo.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/23. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTPingInfo.h" 10 | 11 | @implementation LYTPingInfo 12 | - (NSString *)description 13 | { 14 | return [NSString stringWithFormat:@"\n时间:%.2f ms\n信息:%@\n数组信息:%@\n消息序号:%@\n消息的标示:%@\n",self.durationTime,self.infoStr,self.infoArray,self.sequence,self.identifier]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/SRPingHepler/LYTPingHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SRPingHelper.h 3 | // ping 4 | // 5 | // Created by guoqingwei on 16/6/1. 6 | // Copyright © 2016年 cvte. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class LYTPingHelper; 12 | 13 | @protocol SRPingHelperDelegate 14 | 15 | @required 16 | /** 17 | * Report RTT and packet loss rate. 18 | * Implement this delegate methods to do more. 19 | */ 20 | - (void)didReportSequence:(NSUInteger)seq timeout:(BOOL)isTimeout delay:(NSUInteger)delay packetLoss:(double)lossRate host:(NSString *)ip; 21 | 22 | /** 23 | stop Ping request 24 | */ 25 | - (void)didStopPingRequest; 26 | @end 27 | 28 | /** 29 | * Encapsulation about Apple's SimplePing, both IPv4 and IPv6 are supported. 30 | * RTT and average packet loss rate 31 | */ 32 | @interface LYTPingHelper : NSObject 33 | 34 | @property (nonatomic, weak) id delegate; 35 | 36 | /** 37 | ping count 38 | */ 39 | @property (nonatomic,assign) NSInteger pingCount; 40 | 41 | /** 42 | * RTT, ms. 43 | */ 44 | @property (nonatomic, readonly) NSUInteger delay; 45 | 46 | /** 47 | * Packet loss rate, percentage. 48 | */ 49 | @property (nonatomic, readonly) double packetLoss; //Packet loss rate. 50 | 51 | /** 52 | * ping's target host:IP Address or domain name. 53 | * make sure this value is not null before start ping, an exception is throwed otherwise. 54 | */ 55 | @property (nonatomic, copy) NSString *host; 56 | 57 | 58 | + (instancetype)sharedInstance; 59 | 60 | /** 61 | * start ping cycle 62 | * send a ping packet every 2 seconds 63 | */ 64 | - (void)startPing; 65 | 66 | /** 67 | * stop ping cycle 68 | */ 69 | - (void)stopPing; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/SRPingHepler/PingResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // PingResult.h 3 | // SRPingHeplerTest 4 | // 5 | // Created by guoqingwei on 16/6/1. 6 | // Copyright © 2016年 seewo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface PingResult : NSObject 13 | 14 | @property (nonatomic, strong) UIImage *resultImage; 15 | @property (nonatomic) NSUInteger seq; 16 | @property (nonatomic, strong) NSString *host; 17 | @property (nonatomic, strong) NSString *ttl; 18 | 19 | 20 | - (id)initWithTimeout:(BOOL)isTimeout sequence:(NSUInteger)seq delay:(NSUInteger)delay host:(NSString *)host; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /LYTNetDiagnose/LYTNetDiagnoser/SRPingHepler/PingResult.m: -------------------------------------------------------------------------------- 1 | // 2 | // PingResult.m 3 | // SRPingHeplerTest 4 | // 5 | // Created by guoqingwei on 16/6/1. 6 | // Copyright © 2016年 seewo. All rights reserved. 7 | // 8 | 9 | #import "PingResult.h" 10 | 11 | @implementation PingResult 12 | 13 | - (id)initWithTimeout:(BOOL)isTimeout sequence:(NSUInteger)seq delay:(NSUInteger)delay host:(NSString *)host 14 | { 15 | if (self = [super init]) { 16 | if (isTimeout) { 17 | self.resultImage = [UIImage imageNamed:@"red"]; 18 | } else { 19 | self.resultImage = [UIImage imageNamed:@"green"]; 20 | } 21 | self.seq = seq; 22 | self.host = host; 23 | self.ttl = [NSString stringWithFormat:@"%ld ms", delay]; 24 | } 25 | return self; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/LYTScreenView/LYTScreenView.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTScreenView.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LYTScreenView : UIView 12 | - (instancetype)initWithFilepath:(NSString *)path; 13 | - (instancetype)initWithContent:(NSString *)content; 14 | @property (copy,nonatomic) NSString *content; 15 | 16 | /** 17 | 滑动到什么位置 18 | */ 19 | - (void)scrollToRange:(NSRange)range; 20 | @end 21 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/LYTScreenView/LYTScreenView.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTScreenView.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTScreenView.h" 10 | #import "LYTConfig.h" 11 | @interface LYTScreenView() 12 | @property (copy,nonatomic) NSString *path; 13 | @property (nonatomic,strong) UITextView * textView; 14 | 15 | @end 16 | 17 | @implementation LYTScreenView 18 | - (instancetype)initWithFilepath:(NSString *)path{ 19 | if (self = [super init]) { 20 | _path = path; 21 | [self setUI]; 22 | } 23 | return self; 24 | } 25 | - (instancetype)initWithContent:(NSString *)content{ 26 | if (self = [super init]) { 27 | _content = content; 28 | [self setUI]; 29 | } 30 | return self; 31 | } 32 | - (void)setContent:(NSString *)content{ 33 | _content = content; 34 | _textView.text = content; 35 | } 36 | - (void)setUI{ 37 | _textView = [[UITextView alloc] init]; 38 | _textView.backgroundColor = [UIColor blackColor]; 39 | _textView.textColor = [UIColor greenColor]; 40 | _textView.font = [UIFont systemFontOfSize:contentFont]; 41 | _textView.editable = NO; 42 | _textView.layer.cornerRadius = 10; 43 | _textView.layer.masksToBounds = YES; 44 | [self addSubview:_textView]; 45 | } 46 | -(void)layoutSubviews{ 47 | [super layoutSubviews]; 48 | 49 | [_textView mas_makeConstraints:^(MASConstraintMaker *make) { 50 | make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0)); 51 | }]; 52 | } 53 | - (void)scrollToRange:(NSRange)range{ 54 | if (range.location<=[_textView.text length]){ 55 | [_textView scrollRangeToVisible:range]; 56 | } 57 | } 58 | @end 59 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseVC.h" 12 | @interface MainViewController : BaseVC 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/Model/MainViewModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewModel.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainViewModel : NSObject 12 | @property (nonatomic,copy) NSString * title; 13 | @property (nonatomic,copy) NSString * desTitle; 14 | @property (nonatomic,copy) NSString * imageName; 15 | @property (nonatomic,copy) NSString * className; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/Model/MainViewModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewModel.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "MainViewModel.h" 10 | 11 | @implementation MainViewModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/TYHBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TYHBaseViewController.h 3 | // TaiYangHua 4 | // 5 | // Created by Vieene on 15/12/28. 6 | // Copyright © 2015年 hhly. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TYHBaseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/TYHBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TYHBaseViewController.m 3 | // TaiYangHua 4 | // 5 | // Created by Vieene on 15/12/28. 6 | // Copyright © 2015年 hhly. All rights reserved. 7 | // 8 | 9 | #import "TYHBaseViewController.h" 10 | 11 | @interface TYHBaseViewController () 12 | 13 | @end 14 | 15 | @implementation TYHBaseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | self.view.backgroundColor = kMainViewBgColor; 21 | 22 | [self setleftBarButton]; 23 | [self setNavTitleColor]; 24 | 25 | } 26 | - (void)setleftBarButton 27 | { 28 | 29 | UIButton *btn = [[UIButton alloc] init]; 30 | [btn addTarget:self action:@selector(clickBackBarItem) forControlEvents:UIControlEventTouchDown]; 31 | [btn setImage:[UIImage imageNamed:@"backImage"] forState:UIControlStateNormal]; 32 | btn.frame = CGRectMake(0, 0, 50, 40); 33 | btn.imageEdgeInsets = UIEdgeInsetsMake(0, -40, 0, 0); 34 | 35 | UIBarButtonItem *baritem = [[UIBarButtonItem alloc] initWithCustomView:btn]; 36 | btn.tintColor = [UIColor whiteColor]; 37 | self.navigationItem.leftBarButtonItem = baritem; 38 | 39 | } 40 | - (void)setNavTitleColor 41 | { 42 | UIColor * color = [UIColor whiteColor]; 43 | NSDictionary * dict=[NSDictionary dictionaryWithObject:color forKey:NSForegroundColorAttributeName]; 44 | self.navigationController.navigationBar.titleTextAttributes = dict; 45 | } 46 | - (void)clickBackBarItem 47 | { 48 | [self.navigationController popViewControllerAnimated:YES]; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/View/MainViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewCell.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | @class MainViewModel; 11 | @interface MainViewCell : UITableViewCell 12 | 13 | 14 | @property (nonatomic,strong) MainViewModel * model; 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/View/MainViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewCell.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/5. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "MainViewCell.h" 10 | #import "MainViewModel.h" 11 | #import "LYTConfig.h" 12 | 13 | #import "UIView+SDAutoLayout.h" 14 | #import "UITableView+SDAutoTableViewCellHeight.h" 15 | 16 | #define W(x) kScreenWidth*(x)/320.0 17 | #define H(y) kScreenHeight*(y)/568.0 18 | #define kMarg 10 19 | #define kHeightLabel 30 20 | 21 | @implementation MainViewCell{ 22 | UILabel *_titleLabel; 23 | UILabel *_contentLabel; 24 | } 25 | 26 | 27 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 28 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 29 | 30 | self.backgroundColor = [UIColor whiteColor]; 31 | 32 | [self addSubviews]; 33 | } 34 | return self; 35 | } 36 | -(void)addSubviews{ 37 | 38 | 39 | UIImageView *lineView = [UIImageView new]; 40 | lineView.backgroundColor = kMainViewBgColor; 41 | [self.contentView addSubview:lineView]; 42 | 43 | _titleLabel = [UILabel new]; 44 | _titleLabel.textAlignment = NSTextAlignmentCenter; 45 | _titleLabel.textColor = [UIColor colorWithRed:249.0/255 green:123.0/255 blue:134.0/255 alpha:100]; 46 | [self.contentView addSubview:_titleLabel]; 47 | 48 | _contentLabel = [UILabel new]; 49 | _contentLabel.textColor = [UIColor colorWithRed:100.0/255 green:100.0/255 blue:100.0/255 alpha:100]; 50 | _contentLabel.font = [UIFont systemFontOfSize:16]; 51 | _contentLabel.numberOfLines = 0; 52 | _contentLabel.textAlignment = NSTextAlignmentCenter; 53 | [self.contentView addSubview:_contentLabel]; 54 | 55 | 56 | lineView.sd_layout.widthIs(kScreenWidth).heightIs(kMarg).topSpaceToView(self.contentView,0); 57 | 58 | _titleLabel.sd_layout.widthIs(kScreenWidth - kMarg *4).heightIs(kHeightLabel).topSpaceToView(lineView, kMarg).leftSpaceToView(self.contentView,kMarg * 2); 59 | 60 | _contentLabel.sd_layout.topSpaceToView(_titleLabel, kMarg).rightSpaceToView(self.contentView, kMarg * 2).leftSpaceToView(self.contentView,kMarg * 2).autoHeightRatio(0); 61 | 62 | 63 | } 64 | 65 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 66 | [super setSelected:selected animated:animated]; 67 | } 68 | - (void)setModel:(MainViewModel *)model{ 69 | 70 | _model = model; 71 | _titleLabel.text = model.title; 72 | _contentLabel.text = model.desTitle; 73 | 74 | 75 | //***********************高度自适应cell设置步骤************************ 76 | [self setupAutoHeightWithBottomView:_contentLabel bottomMargin:20]; 77 | } 78 | @end 79 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/控制台/DNS/LYTDNSViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTDNSViewController.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/7. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "TYHBaseViewController.h" 10 | 11 | @interface LYTDNSViewController : TYHBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/控制台/DNS/LYTDNSViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LYTDNSViewController.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/7. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "LYTDNSViewController.h" 10 | #import "LYTScreenView.h" 11 | #import "LYTNetDiagnoser.h" 12 | #import "LYTConfig.h" 13 | #import "LYTSDKDataBase+LYTServersList.h" 14 | 15 | @interface LYTDNSViewController () 16 | { 17 | NSMutableString *_log; 18 | LYTScreenView *_screeenView; 19 | 20 | } 21 | - (IBAction)clickAddbtn:(UIButton *)sender; 22 | @property (weak, nonatomic) IBOutlet UITextField *domainTextField; 23 | @property (weak, nonatomic) IBOutlet UIButton *DNSBtn; 24 | - (IBAction)DNSClick:(UIButton *)sender; 25 | 26 | @end 27 | 28 | @implementation LYTDNSViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | self.title = @"DNS"; 33 | _log = [@"" mutableCopy]; 34 | [self screeenView]; 35 | 36 | } 37 | - (void)viewWillDisappear:(BOOL)animated{ 38 | [super viewWillDisappear:animated]; 39 | // [self stopTraceroute]; 40 | } 41 | - (LYTScreenView *)screeenView{ 42 | if (!_screeenView) { 43 | _screeenView = [[LYTScreenView alloc] initWithContent:@""]; 44 | [self.view addSubview:_screeenView]; 45 | } 46 | return _screeenView; 47 | } 48 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 49 | { 50 | [self.view endEditing:YES]; 51 | } 52 | - (void)viewDidLayoutSubviews{ 53 | [super viewDidLayoutSubviews]; 54 | [_screeenView mas_makeConstraints:^(MASConstraintMaker *make) { 55 | make.top.mas_equalTo(self.DNSBtn.mas_bottom).offset(20); 56 | make.left.mas_equalTo(self.view).offset(15); 57 | make.right.mas_equalTo(self.view).offset(-15); 58 | make.bottom.mas_equalTo(self.view).offset(-15); 59 | }]; 60 | } 61 | - (IBAction)clickAddbtn:(UIButton *)sender { 62 | [self.view endEditing:YES]; 63 | [[LYTSDKDataBase shareDatabase] dbAllServersSucceed:^(NSArray *servers) { 64 | __block BOOL exist = NO; 65 | [servers enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 66 | if ([obj isEqualToString:self.domainTextField.text]) { 67 | exist = YES; 68 | } 69 | }]; 70 | if (exist) { 71 | 72 | [self addLog:@"该域名主机已经存在\n"]; 73 | } 74 | else 75 | { 76 | [[LYTSDKDataBase shareDatabase] dbInsertserver:self.domainTextField.text succeed:^(BOOL result) { 77 | [self addLog:@"添加域名主机成功\n"]; 78 | }]; 79 | } 80 | }]; 81 | } 82 | - (IBAction)DNSClick:(UIButton *)sender { 83 | 84 | 85 | [[LYTNetDiagnoser shareTool] getDNSFromDomain:self.domainTextField.text respose:^(LYTPingInfo *info) { 86 | if (info.infoArray.count == 0) { 87 | NSString *log = [NSString stringWithFormat:@"%@\n DNS无法解析\n",self.domainTextField.text]; 88 | [self addLog:log]; 89 | } 90 | else 91 | { 92 | NSString *log = [NSString stringWithFormat:@"%@\n %@\n",self.domainTextField.text,info.infoStr]; 93 | [self addLog:log]; 94 | } 95 | }]; 96 | } 97 | 98 | - (void)addLog:(NSString *)log{ 99 | dispatch_async(dispatch_get_main_queue(), ^{ 100 | [_log appendString:log]; 101 | [_log appendString:@"\n"]; 102 | _screeenView.content = _log; 103 | NSRange range = {_log.length,0}; 104 | [_screeenView scrollToRange:range]; 105 | }); 106 | } 107 | @end 108 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/控制台/ping/LYTPingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LYTPingViewController.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by Vieene on 2017/3/27. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "TYHBaseViewController.h" 10 | @protocol LYTPingViewControllerDelegate 11 | 12 | /** 13 | 开始ping一个地址 14 | 15 | @param address 地址/主机或者域名 16 | */ 17 | - (void)pingViewControllerStartPingAddress:(NSString *)address count:(NSInteger)count; 18 | 19 | /** 20 | 停止ping一个地址 21 | */ 22 | - (void)pingViewControllerStopPing; 23 | @end 24 | @interface LYTPingViewController : TYHBaseViewController 25 | @property (nonatomic,weak)id delegate; 26 | - (void)didEndPingAction; 27 | @end 28 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/控制台/traceroute/TracerouteViewController2.h: -------------------------------------------------------------------------------- 1 | // 2 | // TracerouteViewController2.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/7. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "TYHBaseViewController.h" 10 | 11 | @interface TracerouteViewController2 : TYHBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/MainViewController/控制台/端口探测/TYHPortScanController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TYHPortScanController.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/10. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "TYHBaseViewController.h" 10 | 11 | @interface TYHPortScanController : TYHBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/LYTdb/LYTDB.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double LYTDBVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char LYTDBVersionString[]; 5 | 6 | #import "LYTDatabase.h" 7 | #import "LYTResultSet.h" 8 | #import "LYTDatabaseAdditions.h" 9 | #import "LYTDatabaseQueue.h" 10 | #import "LYTDatabasePool.h" 11 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/NSString+NetTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+NetTool.h 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/10. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (NetTool) 12 | - (BOOL)isIPaddress; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/NSString+NetTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+NetTool.m 3 | // LYTNetDiagnose 4 | // 5 | // Created by 谭建中 on 2017/4/10. 6 | // Copyright © 2017年 Vieene. All rights reserved. 7 | // 8 | 9 | #import "NSString+NetTool.h" 10 | #import 11 | 12 | @implementation NSString (NetTool) 13 | - (BOOL)isIPaddress{ 14 | 15 | in_addr_t addt = inet_addr([self UTF8String]); 16 | in_addr_t addt255 = inet_addr("255.255.255.255"); 17 | if (addt == addt255) { 18 | return NO; 19 | }else{ 20 | return YES; 21 | } 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/UIColor+TYHColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+TYHColor.h 3 | // TaiYangHua 4 | // 5 | // Created by Vieene on 16/8/1. 6 | // Copyright © 2016年 hhly. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (TYHColor) 12 | /** 13 | * 将16进制颜色转换成UIColor 14 | * 15 | **/ 16 | +(UIColor *)getColor:(NSString *)hexColor; 17 | 18 | /** 19 | * 将16进制颜色转换成UIColor 设置透明度 (add by zhangsg 2016.11.14) 20 | * 21 | **/ 22 | +(UIColor *)getColor:(NSString *)hexColor alpha:(CGFloat)alpha; 23 | @end 24 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/UIColor+TYHColor.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+TYHColor.m 3 | // TaiYangHua 4 | // 5 | // Created by Vieene on 16/8/1. 6 | // Copyright © 2016年 hhly. All rights reserved. 7 | // 8 | 9 | #import "UIColor+TYHColor.h" 10 | 11 | @implementation UIColor (TYHColor) 12 | /** 13 | * 将16进制颜色转换成UIColor 14 | * 15 | **/ 16 | +(UIColor *)getColor:(NSString *)hexColor { 17 | return [self getColor:hexColor alpha:1.0]; // modify by zhangsg 2016.11.14 18 | } 19 | 20 | +(UIColor *)getColor:(NSString *)hexColor alpha:(CGFloat)alpha { 21 | 22 | unsigned int red,green,blue; 23 | NSRange range; 24 | range.length = 2; 25 | 26 | range.location = 0; 27 | [[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&red]; 28 | 29 | range.location = 2; 30 | [[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&green]; 31 | 32 | range.location = 4; 33 | [[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&blue]; 34 | 35 | return [UIColor colorWithRed:(float)(red/255.0f) green:(float)(green / 255.0f) blue:(float)(blue / 255.0f) alpha:alpha]; 36 | 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/UIView+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.h 3 | // 01 - 表情键盘 4 | // 5 | // Created by apple on 15-1-30. 6 | // Copyright (c) 2015年 apple. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Extension) 12 | 13 | @property (nonatomic, assign) CGFloat x; 14 | @property (nonatomic, assign) CGFloat y; 15 | @property (nonatomic, assign) CGFloat centerX; 16 | @property (nonatomic, assign) CGFloat centerY; 17 | @property (nonatomic, assign) CGFloat width; 18 | @property (nonatomic, assign) CGFloat height; 19 | @property (nonatomic, assign) CGSize size; 20 | @property (nonatomic, assign) CGPoint origin; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /LYTNetDiagnose/第三方/UIView+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.m 3 | // 01 - 表情键盘 4 | // 5 | // Created by apple on 15-1-30. 6 | // Copyright (c) 2015年 apple. All rights reserved. 7 | // 8 | 9 | #import "UIView+Extension.h" 10 | 11 | @implementation UIView (Extension) 12 | 13 | - (void)setX:(CGFloat)x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = x; 17 | self.frame = frame; 18 | } 19 | 20 | - (void)setY:(CGFloat)y 21 | { 22 | CGRect frame = self.frame; 23 | frame.origin.y = y; 24 | self.frame = frame; 25 | } 26 | 27 | - (CGFloat)x 28 | { 29 | return self.frame.origin.x; 30 | } 31 | 32 | - (CGFloat)y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setCenterX:(CGFloat)centerX 38 | { 39 | CGPoint center = self.center; 40 | center.x = centerX; 41 | self.center = center; 42 | } 43 | 44 | - (CGFloat)centerX 45 | { 46 | return self.center.x; 47 | } 48 | 49 | - (void)setCenterY:(CGFloat)centerY 50 | { 51 | CGPoint center = self.center; 52 | center.y = centerY; 53 | self.center = center; 54 | } 55 | 56 | - (CGFloat)centerY 57 | { 58 | return self.center.y; 59 | } 60 | 61 | - (void)setWidth:(CGFloat)width 62 | { 63 | CGRect frame = self.frame; 64 | frame.size.width = width; 65 | self.frame = frame; 66 | } 67 | 68 | - (void)setHeight:(CGFloat)height 69 | { 70 | CGRect frame = self.frame; 71 | frame.size.height = height; 72 | self.frame = frame; 73 | } 74 | 75 | - (CGFloat)height 76 | { 77 | return self.frame.size.height; 78 | } 79 | 80 | - (CGFloat)width 81 | { 82 | return self.frame.size.width; 83 | } 84 | 85 | - (void)setSize:(CGSize)size 86 | { 87 | CGRect frame = self.frame; 88 | frame.size = size; 89 | self.frame = frame; 90 | } 91 | 92 | - (CGSize)size 93 | { 94 | return self.frame.size; 95 | } 96 | 97 | - (void)setOrigin:(CGPoint)origin 98 | { 99 | CGRect frame = self.frame; 100 | frame.origin = origin; 101 | self.frame = frame; 102 | } 103 | 104 | - (CGPoint)origin 105 | { 106 | return self.frame.origin; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | target 'SpeedTest' do 4 | pod 'SVProgressHUD' 5 | pod 'Masonry' 6 | pod 'MJExtension' 7 | pod 'SDAutoLayout' 8 | end 9 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.0.2) 3 | - MJExtension (3.0.13) 4 | - SDAutoLayout (2.1.7) 5 | - SVProgressHUD (2.1.2) 6 | 7 | DEPENDENCIES: 8 | - Masonry 9 | - MJExtension 10 | - SDAutoLayout 11 | - SVProgressHUD 12 | 13 | SPEC CHECKSUMS: 14 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e 15 | MJExtension: 5932755f451458eefa24239358817f8d291240c7 16 | SDAutoLayout: e9b36d04b8c0b504762a04d76fbbe5108944297a 17 | SVProgressHUD: c404a55d78acbeb7ebb78b76d3faf986475a6994 18 | 19 | PODFILE CHECKSUM: 1583ea0b50eb7a998cad12ffa527989de11b4309 20 | 21 | COCOAPODS: 1.1.1 22 | -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtensionConst.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJFoundation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyKey.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJClass.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJKeyValue.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJKeyValue.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSString+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDAutoLayout/SDAutoLayout.h: -------------------------------------------------------------------------------- 1 | ../../../SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/SDAutoLayout.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.h: -------------------------------------------------------------------------------- 1 | ../../../SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDAutoLayout/UIView+SDAutoLayout.h: -------------------------------------------------------------------------------- 1 | ../../../SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SVProgressHUD/SVIndefiniteAnimatedView.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVIndefiniteAnimatedView.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SVProgressHUD/SVProgressAnimatedView.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVProgressAnimatedView.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SVProgressHUD/SVProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SVProgressHUD/SVRadialGradientLayer.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVRadialGradientLayer.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtensionConst.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJFoundation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyKey.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJClass.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/NSObject+MJKeyValue.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJKeyValue.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSString+MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDAutoLayout/SDAutoLayout.h: -------------------------------------------------------------------------------- 1 | ../../../SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/SDAutoLayout.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.h: -------------------------------------------------------------------------------- 1 | ../../../SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDAutoLayout/UIView+SDAutoLayout.h: -------------------------------------------------------------------------------- 1 | ../../../SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/UIView+SDAutoLayout.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SVProgressHUD/SVIndefiniteAnimatedView.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVIndefiniteAnimatedView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SVProgressHUD/SVProgressAnimatedView.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVProgressAnimatedView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SVProgressHUD/SVProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SVProgressHUD/SVRadialGradientLayer.h: -------------------------------------------------------------------------------- 1 | ../../../SVProgressHUD/SVProgressHUD/SVRadialGradientLayer.h -------------------------------------------------------------------------------- /Pods/MJExtension/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJExtension (https://github.com/CoderMJLee/MJExtension) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJExtension.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 代码地址:https://github.com/CoderMJLee/MJExtension 8 | // 代码地址:http://code4app.com/ios/%E5%AD%97%E5%85%B8-JSON-%E4%B8%8E%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%BD%AC%E6%8D%A2/5339992a933bf062608b4c57 9 | 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "NSObject+MJClass.h" 13 | #import "NSObject+MJKeyValue.h" 14 | #import "NSString+MJExtension.h" 15 | #import "MJExtensionConst.h" -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MJExtensionConst__H__ 3 | #define __MJExtensionConst__H__ 4 | 5 | #import 6 | 7 | // 过期 8 | #define MJExtensionDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 9 | 10 | // 构建错误 11 | #define MJExtensionBuildError(clazz, msg) \ 12 | NSError *error = [NSError errorWithDomain:msg code:250 userInfo:nil]; \ 13 | [clazz setMj_error:error]; 14 | 15 | // 日志输出 16 | #ifdef DEBUG 17 | #define MJExtensionLog(...) NSLog(__VA_ARGS__) 18 | #else 19 | #define MJExtensionLog(...) 20 | #endif 21 | 22 | /** 23 | * 断言 24 | * @param condition 条件 25 | * @param returnValue 返回值 26 | */ 27 | #define MJExtensionAssertError(condition, returnValue, clazz, msg) \ 28 | [clazz setMj_error:nil]; \ 29 | if ((condition) == NO) { \ 30 | MJExtensionBuildError(clazz, msg); \ 31 | return returnValue;\ 32 | } 33 | 34 | #define MJExtensionAssert2(condition, returnValue) \ 35 | if ((condition) == NO) return returnValue; 36 | 37 | /** 38 | * 断言 39 | * @param condition 条件 40 | */ 41 | #define MJExtensionAssert(condition) MJExtensionAssert2(condition, ) 42 | 43 | /** 44 | * 断言 45 | * @param param 参数 46 | * @param returnValue 返回值 47 | */ 48 | #define MJExtensionAssertParamNotNil2(param, returnValue) \ 49 | MJExtensionAssert2((param) != nil, returnValue) 50 | 51 | /** 52 | * 断言 53 | * @param param 参数 54 | */ 55 | #define MJExtensionAssertParamNotNil(param) MJExtensionAssertParamNotNil2(param, ) 56 | 57 | /** 58 | * 打印所有的属性 59 | */ 60 | #define MJLogAllIvars \ 61 | -(NSString *)description \ 62 | { \ 63 | return [self mj_keyValues].description; \ 64 | } 65 | #define MJExtensionLogAllProperties MJLogAllIvars 66 | 67 | /** 68 | * 类型(属性类型) 69 | */ 70 | extern NSString *const MJPropertyTypeInt; 71 | extern NSString *const MJPropertyTypeShort; 72 | extern NSString *const MJPropertyTypeFloat; 73 | extern NSString *const MJPropertyTypeDouble; 74 | extern NSString *const MJPropertyTypeLong; 75 | extern NSString *const MJPropertyTypeLongLong; 76 | extern NSString *const MJPropertyTypeChar; 77 | extern NSString *const MJPropertyTypeBOOL1; 78 | extern NSString *const MJPropertyTypeBOOL2; 79 | extern NSString *const MJPropertyTypePointer; 80 | 81 | extern NSString *const MJPropertyTypeIvar; 82 | extern NSString *const MJPropertyTypeMethod; 83 | extern NSString *const MJPropertyTypeBlock; 84 | extern NSString *const MJPropertyTypeClass; 85 | extern NSString *const MJPropertyTypeSEL; 86 | extern NSString *const MJPropertyTypeId; 87 | 88 | #endif -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtensionConst.m: -------------------------------------------------------------------------------- 1 | #ifndef __MJExtensionConst__M__ 2 | #define __MJExtensionConst__M__ 3 | 4 | #import 5 | 6 | /** 7 | * 成员变量类型(属性类型) 8 | */ 9 | NSString *const MJPropertyTypeInt = @"i"; 10 | NSString *const MJPropertyTypeShort = @"s"; 11 | NSString *const MJPropertyTypeFloat = @"f"; 12 | NSString *const MJPropertyTypeDouble = @"d"; 13 | NSString *const MJPropertyTypeLong = @"l"; 14 | NSString *const MJPropertyTypeLongLong = @"q"; 15 | NSString *const MJPropertyTypeChar = @"c"; 16 | NSString *const MJPropertyTypeBOOL1 = @"c"; 17 | NSString *const MJPropertyTypeBOOL2 = @"b"; 18 | NSString *const MJPropertyTypePointer = @"*"; 19 | 20 | NSString *const MJPropertyTypeIvar = @"^{objc_ivar=}"; 21 | NSString *const MJPropertyTypeMethod = @"^{objc_method=}"; 22 | NSString *const MJPropertyTypeBlock = @"@?"; 23 | NSString *const MJPropertyTypeClass = @"#"; 24 | NSString *const MJPropertyTypeSEL = @":"; 25 | NSString *const MJPropertyTypeId = @"@"; 26 | 27 | #endif -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MJFoundation : NSObject 12 | + (BOOL)isClassFromFoundation:(Class)c; 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJFoundation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJFoundation.h" 10 | #import "MJExtensionConst.h" 11 | #import 12 | 13 | static NSSet *foundationClasses_; 14 | 15 | @implementation MJFoundation 16 | 17 | + (NSSet *)foundationClasses 18 | { 19 | if (foundationClasses_ == nil) { 20 | // 集合中没有NSObject,因为几乎所有的类都是继承自NSObject,具体是不是NSObject需要特殊判断 21 | foundationClasses_ = [NSSet setWithObjects: 22 | [NSURL class], 23 | [NSDate class], 24 | [NSValue class], 25 | [NSData class], 26 | [NSError class], 27 | [NSArray class], 28 | [NSDictionary class], 29 | [NSString class], 30 | [NSAttributedString class], nil]; 31 | } 32 | return foundationClasses_; 33 | } 34 | 35 | + (BOOL)isClassFromFoundation:(Class)c 36 | { 37 | if (c == [NSObject class] || c == [NSManagedObject class]) return YES; 38 | 39 | __block BOOL result = NO; 40 | [[self foundationClasses] enumerateObjectsUsingBlock:^(Class foundationClass, BOOL *stop) { 41 | if ([c isSubclassOfClass:foundationClass]) { 42 | result = YES; 43 | *stop = YES; 44 | } 45 | }]; 46 | return result; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 包装一个成员属性 8 | 9 | #import 10 | #import 11 | #import "MJPropertyType.h" 12 | #import "MJPropertyKey.h" 13 | 14 | /** 15 | * 包装一个成员 16 | */ 17 | @interface MJProperty : NSObject 18 | /** 成员属性 */ 19 | @property (nonatomic, assign) objc_property_t property; 20 | /** 成员属性的名字 */ 21 | @property (nonatomic, readonly) NSString *name; 22 | 23 | /** 成员属性的类型 */ 24 | @property (nonatomic, readonly) MJPropertyType *type; 25 | /** 成员属性来源于哪个类(可能是父类) */ 26 | @property (nonatomic, assign) Class srcClass; 27 | 28 | /**** 同一个成员属性 - 父类和子类的行为可能不一致(originKey、propertyKeys、objectClassInArray) ****/ 29 | /** 设置最原始的key */ 30 | - (void)setOriginKey:(id)originKey forClass:(Class)c; 31 | /** 对应着字典中的多级key(里面存放的数组,数组里面都是MJPropertyKey对象) */ 32 | - (NSArray *)propertyKeysForClass:(Class)c; 33 | 34 | /** 模型数组中的模型类型 */ 35 | - (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; 36 | - (Class)objectClassInArrayForClass:(Class)c; 37 | /**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ 38 | 39 | /** 40 | * 设置object的成员变量值 41 | */ 42 | - (void)setValue:(id)value forObject:(id)object; 43 | /** 44 | * 得到object的成员属性值 45 | */ 46 | - (id)valueForObject:(id)object; 47 | 48 | /** 49 | * 初始化 50 | */ 51 | + (instancetype)cachedPropertyWithProperty:(objc_property_t)property; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | MJPropertyKeyTypeDictionary = 0, // 字典的key 13 | MJPropertyKeyTypeArray // 数组的key 14 | } MJPropertyKeyType; 15 | 16 | /** 17 | * 属性的key 18 | */ 19 | @interface MJPropertyKey : NSObject 20 | /** key的名字 */ 21 | @property (copy, nonatomic) NSString *name; 22 | /** key的种类,可能是@"10",可能是@"age" */ 23 | @property (assign, nonatomic) MJPropertyKeyType type; 24 | 25 | /** 26 | * 根据当前的key,也就是name,从object(字典或者数组)中取值 27 | */ 28 | - (id)valueInObject:(id)object; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyKey.h" 10 | 11 | @implementation MJPropertyKey 12 | 13 | - (id)valueInObject:(id)object 14 | { 15 | if ([object isKindOfClass:[NSDictionary class]] && self.type == MJPropertyKeyTypeDictionary) { 16 | return object[self.name]; 17 | } else if ([object isKindOfClass:[NSArray class]] && self.type == MJPropertyKeyTypeArray) { 18 | NSArray *array = object; 19 | NSUInteger index = self.name.intValue; 20 | if (index < array.count) return array[index]; 21 | return nil; 22 | } 23 | return nil; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 包装一种类型 8 | 9 | #import 10 | 11 | /** 12 | * 包装一种类型 13 | */ 14 | @interface MJPropertyType : NSObject 15 | /** 类型标识符 */ 16 | @property (nonatomic, copy) NSString *code; 17 | 18 | /** 是否为id类型 */ 19 | @property (nonatomic, readonly, getter=isIdType) BOOL idType; 20 | 21 | /** 是否为基本数字类型:int、float等 */ 22 | @property (nonatomic, readonly, getter=isNumberType) BOOL numberType; 23 | 24 | /** 是否为BOOL类型 */ 25 | @property (nonatomic, readonly, getter=isBoolType) BOOL boolType; 26 | 27 | /** 对象类型(如果是基本数据类型,此值为nil) */ 28 | @property (nonatomic, readonly) Class typeClass; 29 | 30 | /** 类型是否来自于Foundation框架,比如NSString、NSArray */ 31 | @property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; 32 | /** 类型是否不支持KVC */ 33 | @property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; 34 | 35 | /** 36 | * 获得缓存的类型对象 37 | */ 38 | + (instancetype)cachedTypeWithCode:(NSString *)code; 39 | @end -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyType.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyType.h" 10 | #import "MJExtension.h" 11 | #import "MJFoundation.h" 12 | #import "MJExtensionConst.h" 13 | 14 | @implementation MJPropertyType 15 | 16 | static NSMutableDictionary *types_; 17 | + (void)initialize 18 | { 19 | types_ = [NSMutableDictionary dictionary]; 20 | } 21 | 22 | + (instancetype)cachedTypeWithCode:(NSString *)code 23 | { 24 | MJExtensionAssertParamNotNil2(code, nil); 25 | @synchronized (self) { 26 | MJPropertyType *type = types_[code]; 27 | if (type == nil) { 28 | type = [[self alloc] init]; 29 | type.code = code; 30 | types_[code] = type; 31 | } 32 | return type; 33 | } 34 | } 35 | 36 | #pragma mark - 公共方法 37 | - (void)setCode:(NSString *)code 38 | { 39 | _code = code; 40 | 41 | MJExtensionAssertParamNotNil(code); 42 | 43 | if ([code isEqualToString:MJPropertyTypeId]) { 44 | _idType = YES; 45 | } else if (code.length == 0) { 46 | _KVCDisabled = YES; 47 | } else if (code.length > 3 && [code hasPrefix:@"@\""]) { 48 | // 去掉@"和",截取中间的类型名称 49 | _code = [code substringWithRange:NSMakeRange(2, code.length - 3)]; 50 | _typeClass = NSClassFromString(_code); 51 | _fromFoundation = [MJFoundation isClassFromFoundation:_typeClass]; 52 | _numberType = [_typeClass isSubclassOfClass:[NSNumber class]]; 53 | 54 | } else if ([code isEqualToString:MJPropertyTypeSEL] || 55 | [code isEqualToString:MJPropertyTypeIvar] || 56 | [code isEqualToString:MJPropertyTypeMethod]) { 57 | _KVCDisabled = YES; 58 | } 59 | 60 | // 是否为数字类型 61 | NSString *lowerCode = _code.lowercaseString; 62 | NSArray *numberTypes = @[MJPropertyTypeInt, MJPropertyTypeShort, MJPropertyTypeBOOL1, MJPropertyTypeBOOL2, MJPropertyTypeFloat, MJPropertyTypeDouble, MJPropertyTypeLong, MJPropertyTypeLongLong, MJPropertyTypeChar]; 63 | if ([numberTypes containsObject:lowerCode]) { 64 | _numberType = YES; 65 | 66 | if ([lowerCode isEqualToString:MJPropertyTypeBOOL1] 67 | || [lowerCode isEqualToString:MJPropertyTypeBOOL2]) { 68 | _boolType = YES; 69 | } 70 | } 71 | } 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJClass.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 遍历所有类的block(父类) 13 | */ 14 | typedef void (^MJClassesEnumeration)(Class c, BOOL *stop); 15 | 16 | /** 这个数组中的属性名才会进行字典和模型的转换 */ 17 | typedef NSArray * (^MJAllowedPropertyNames)(); 18 | /** 这个数组中的属性名才会进行归档 */ 19 | typedef NSArray * (^MJAllowedCodingPropertyNames)(); 20 | 21 | /** 这个数组中的属性名将会被忽略:不进行字典和模型的转换 */ 22 | typedef NSArray * (^MJIgnoredPropertyNames)(); 23 | /** 这个数组中的属性名将会被忽略:不进行归档 */ 24 | typedef NSArray * (^MJIgnoredCodingPropertyNames)(); 25 | 26 | /** 27 | * 类相关的扩展 28 | */ 29 | @interface NSObject (MJClass) 30 | /** 31 | * 遍历所有的类 32 | */ 33 | + (void)mj_enumerateClasses:(MJClassesEnumeration)enumeration; 34 | + (void)mj_enumerateAllClasses:(MJClassesEnumeration)enumeration; 35 | 36 | #pragma mark - 属性白名单配置 37 | /** 38 | * 这个数组中的属性名才会进行字典和模型的转换 39 | * 40 | * @param allowedPropertyNames 这个数组中的属性名才会进行字典和模型的转换 41 | */ 42 | + (void)mj_setupAllowedPropertyNames:(MJAllowedPropertyNames)allowedPropertyNames; 43 | 44 | /** 45 | * 这个数组中的属性名才会进行字典和模型的转换 46 | */ 47 | + (NSMutableArray *)mj_totalAllowedPropertyNames; 48 | 49 | #pragma mark - 属性黑名单配置 50 | /** 51 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 52 | * 53 | * @param ignoredPropertyNames 这个数组中的属性名将会被忽略:不进行字典和模型的转换 54 | */ 55 | + (void)mj_setupIgnoredPropertyNames:(MJIgnoredPropertyNames)ignoredPropertyNames; 56 | 57 | /** 58 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 59 | */ 60 | + (NSMutableArray *)mj_totalIgnoredPropertyNames; 61 | 62 | #pragma mark - 归档属性白名单配置 63 | /** 64 | * 这个数组中的属性名才会进行归档 65 | * 66 | * @param allowedCodingPropertyNames 这个数组中的属性名才会进行归档 67 | */ 68 | + (void)mj_setupAllowedCodingPropertyNames:(MJAllowedCodingPropertyNames)allowedCodingPropertyNames; 69 | 70 | /** 71 | * 这个数组中的属性名才会进行字典和模型的转换 72 | */ 73 | + (NSMutableArray *)mj_totalAllowedCodingPropertyNames; 74 | 75 | #pragma mark - 归档属性黑名单配置 76 | /** 77 | * 这个数组中的属性名将会被忽略:不进行归档 78 | * 79 | * @param ignoredCodingPropertyNames 这个数组中的属性名将会被忽略:不进行归档 80 | */ 81 | + (void)mj_setupIgnoredCodingPropertyNames:(MJIgnoredCodingPropertyNames)ignoredCodingPropertyNames; 82 | 83 | /** 84 | * 这个数组中的属性名将会被忽略:不进行归档 85 | */ 86 | + (NSMutableArray *)mj_totalIgnoredCodingPropertyNames; 87 | 88 | #pragma mark - 内部使用 89 | + (void)mj_setupBlockReturnValue:(id (^)())block key:(const char *)key; 90 | @end 91 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | /** 13 | * Codeing协议 14 | */ 15 | @protocol MJCoding 16 | @optional 17 | /** 18 | * 这个数组中的属性名才会进行归档 19 | */ 20 | + (NSArray *)mj_allowedCodingPropertyNames; 21 | /** 22 | * 这个数组中的属性名将会被忽略:不进行归档 23 | */ 24 | + (NSArray *)mj_ignoredCodingPropertyNames; 25 | @end 26 | 27 | @interface NSObject (MJCoding) 28 | /** 29 | * 解码(从文件中解析对象) 30 | */ 31 | - (void)mj_decode:(NSCoder *)decoder; 32 | /** 33 | * 编码(将对象写入文件中) 34 | */ 35 | - (void)mj_encode:(NSCoder *)encoder; 36 | @end 37 | 38 | /** 39 | 归档的实现 40 | */ 41 | #define MJCodingImplementation \ 42 | - (id)initWithCoder:(NSCoder *)decoder \ 43 | { \ 44 | if (self = [super init]) { \ 45 | [self mj_decode:decoder]; \ 46 | } \ 47 | return self; \ 48 | } \ 49 | \ 50 | - (void)encodeWithCoder:(NSCoder *)encoder \ 51 | { \ 52 | [self mj_encode:encoder]; \ 53 | } 54 | 55 | #define MJExtensionCodingImplementation MJCodingImplementation -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJCoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJCoding.h" 10 | #import "NSObject+MJClass.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "MJProperty.h" 13 | 14 | @implementation NSObject (MJCoding) 15 | 16 | - (void)mj_encode:(NSCoder *)encoder 17 | { 18 | Class clazz = [self class]; 19 | 20 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 21 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 22 | 23 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 24 | // 检测是否被忽略 25 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 26 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 27 | 28 | id value = [property valueForObject:self]; 29 | if (value == nil) return; 30 | [encoder encodeObject:value forKey:property.name]; 31 | }]; 32 | } 33 | 34 | - (void)mj_decode:(NSCoder *)decoder 35 | { 36 | Class clazz = [self class]; 37 | 38 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 39 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 40 | 41 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 42 | // 检测是否被忽略 43 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 44 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 45 | 46 | id value = [decoder decodeObjectForKey:property.name]; 47 | if (value == nil) { // 兼容以前的MJExtension版本 48 | value = [decoder decodeObjectForKey:[@"_" stringByAppendingString:property.name]]; 49 | } 50 | if (value == nil) return; 51 | [property setValue:value forObject:self]; 52 | }]; 53 | } 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @class MJProperty; 13 | 14 | /** 15 | * 遍历成员变量用的block 16 | * 17 | * @param property 成员的包装对象 18 | * @param stop YES代表停止遍历,NO代表继续遍历 19 | */ 20 | typedef void (^MJPropertiesEnumeration)(MJProperty *property, BOOL *stop); 21 | 22 | /** 将属性名换为其他key去字典中取值 */ 23 | typedef NSDictionary * (^MJReplacedKeyFromPropertyName)(); 24 | typedef id (^MJReplacedKeyFromPropertyName121)(NSString *propertyName); 25 | /** 数组中需要转换的模型类 */ 26 | typedef NSDictionary * (^MJObjectClassInArray)(); 27 | /** 用于过滤字典中的值 */ 28 | typedef id (^MJNewValueFromOldValue)(id object, id oldValue, MJProperty *property); 29 | 30 | /** 31 | * 成员属性相关的扩展 32 | */ 33 | @interface NSObject (MJProperty) 34 | #pragma mark - 遍历 35 | /** 36 | * 遍历所有的成员 37 | */ 38 | + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration; 39 | 40 | #pragma mark - 新值配置 41 | /** 42 | * 用于过滤字典中的值 43 | * 44 | * @param newValueFormOldValue 用于过滤字典中的值 45 | */ 46 | + (void)mj_setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue; 47 | + (id)mj_getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property; 48 | 49 | #pragma mark - key配置 50 | /** 51 | * 将属性名换为其他key去字典中取值 52 | * 53 | * @param replacedKeyFromPropertyName 将属性名换为其他key去字典中取值 54 | */ 55 | + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName; 56 | /** 57 | * 将属性名换为其他key去字典中取值 58 | * 59 | * @param replacedKeyFromPropertyName121 将属性名换为其他key去字典中取值 60 | */ 61 | + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121; 62 | 63 | #pragma mark - array model class配置 64 | /** 65 | * 数组中需要转换的模型类 66 | * 67 | * @param objectClassInArray 数组中需要转换的模型类 68 | */ 69 | + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray; 70 | @end 71 | 72 | @interface NSObject (MJPropertyDeprecated_v_2_5_16) 73 | + (void)enumerateProperties:(MJPropertiesEnumeration)enumeration MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 74 | + (void)setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 75 | + (id)getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 76 | + (void)setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 77 | + (void)setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121 MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 78 | + (void)setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 79 | @end -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @interface NSString (MJExtension) 13 | /** 14 | * 驼峰转下划线(loveYou -> love_you) 15 | */ 16 | - (NSString *)mj_underlineFromCamel; 17 | /** 18 | * 下划线转驼峰(love_you -> loveYou) 19 | */ 20 | - (NSString *)mj_camelFromUnderline; 21 | /** 22 | * 首字母变大写 23 | */ 24 | - (NSString *)mj_firstCharUpper; 25 | /** 26 | * 首字母变小写 27 | */ 28 | - (NSString *)mj_firstCharLower; 29 | 30 | - (BOOL)mj_isPureInt; 31 | 32 | - (NSURL *)mj_url; 33 | @end 34 | 35 | @interface NSString (MJExtensionDeprecated_v_2_5_16) 36 | - (NSString *)underlineFromCamel MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 37 | - (NSString *)camelFromUnderline MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 38 | - (NSString *)firstCharUpper MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 39 | - (NSString *)firstCharLower MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 40 | - (BOOL)isPureInt MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 41 | - (NSURL *)url MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.0.2) 3 | - MJExtension (3.0.13) 4 | - SDAutoLayout (2.1.7) 5 | - SVProgressHUD (2.1.2) 6 | 7 | DEPENDENCIES: 8 | - Masonry 9 | - MJExtension 10 | - SDAutoLayout 11 | - SVProgressHUD 12 | 13 | SPEC CHECKSUMS: 14 | Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e 15 | MJExtension: 5932755f451458eefa24239358817f8d291240c7 16 | SDAutoLayout: e9b36d04b8c0b504762a04d76fbbe5108944297a 17 | SVProgressHUD: c404a55d78acbeb7ebb78b76d3faf986475a6994 18 | 19 | PODFILE CHECKSUM: 1583ea0b50eb7a998cad12ffa527989de11b4309 20 | 21 | COCOAPODS: 1.1.1 22 | -------------------------------------------------------------------------------- /Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/MJExtension.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/Masonry.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/Pods-SpeedTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/SDAutoLayout.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/SVProgressHUD.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MJExtension.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Masonry.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-SpeedTest.xcscheme 18 | 19 | isShown 20 | 21 | 22 | SDAutoLayout.xcscheme 23 | 24 | isShown 25 | 26 | 27 | SVProgressHUD.xcscheme 28 | 29 | isShown 30 | 31 | 32 | 33 | SuppressBuildableAutocreation 34 | 35 | 177244A9EEAACA33A404379364942121 36 | 37 | primary 38 | 39 | 40 | 1844B9E716741D7D99B94B213CA91CB8 41 | 42 | primary 43 | 44 | 45 | 9DC8D9E02903E93BD0B2FEC9D846EA20 46 | 47 | primary 48 | 49 | 50 | A316B54C67E947D23CECD230FA5BFAEF 51 | 52 | primary 53 | 54 | 55 | B0798E57005BC0D71604E6AFAD907823 56 | 57 | primary 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/MJExtension.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/Masonry.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/Pods-SpeedTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/SDAutoLayout.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/SVProgressHUD.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MJExtension.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | Masonry.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | Pods-SpeedTest.xcscheme 18 | 19 | orderHint 20 | 3 21 | 22 | SDAutoLayout.xcscheme 23 | 24 | orderHint 25 | 4 26 | 27 | SVProgressHUD.xcscheme 28 | 29 | orderHint 30 | 5 31 | 32 | 33 | SuppressBuildableAutocreation 34 | 35 | 177244A9EEAACA33A404379364942121 36 | 37 | primary 38 | 39 | 40 | 1844B9E716741D7D99B94B213CA91CB8 41 | 42 | primary 43 | 44 | 45 | 9DC8D9E02903E93BD0B2FEC9D846EA20 46 | 47 | primary 48 | 49 | 50 | A316B54C67E947D23CECD230FA5BFAEF 51 | 52 | primary 53 | 54 | 55 | B0798E57005BC0D71604E6AFAD907823 56 | 57 | primary 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/SDAutoLayout/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 GSD_iOS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/SDAutoLayout/SDAutoLayoutDemo/SDAutoLayout/SDAutoLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // SDAutoLayout.h 3 | // SDAutoLayoutDemo 4 | // 5 | // Created by gsd on 16/6/27. 6 | // Copyright © 2016年 gsd. All rights reserved. 7 | // 8 | 9 | 10 | /* 11 | 12 | SDAutoLayout 13 | 版本:2.1.7 14 | 发布:2016.08.12 15 | 16 | */ 17 | 18 | #ifndef SDAutoLayout_h 19 | #define SDAutoLayout_h 20 | 21 | #import "UIView+SDAutoLayout.h" 22 | #import "UITableView+SDAutoTableViewCellHeight.h" 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Pods/SVProgressHUD/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 Sam Vermette, Tobias Tiemerding and contributors. 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | A different license may apply to other resources included in this package, 25 | including Freepik Icons. Please consult their 26 | respective headers for the terms of their individual licenses. 27 | -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVIndefiniteAnimatedView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVIndefiniteAnimatedView.h 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2014-2016 Guillaume Campagna. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SVIndefiniteAnimatedView : UIView 11 | 12 | @property (nonatomic, assign) CGFloat strokeThickness; 13 | @property (nonatomic, assign) CGFloat radius; 14 | @property (nonatomic, strong) UIColor *strokeColor; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressAnimatedView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVProgressAnimatedView.h 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SVProgressAnimatedView : UIView 11 | 12 | @property (nonatomic, assign) CGFloat radius; 13 | @property (nonatomic, assign) CGFloat strokeThickness; 14 | @property (nonatomic, strong) UIColor *strokeColor; 15 | @property (nonatomic, assign) CGFloat strokeEnd; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressAnimatedView.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVProgressAnimatedView.m 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import "SVProgressAnimatedView.h" 9 | 10 | @interface SVProgressAnimatedView () 11 | 12 | @property (nonatomic, strong) CAShapeLayer *ringAnimatedLayer; 13 | 14 | @end 15 | 16 | @implementation SVProgressAnimatedView 17 | 18 | - (void)willMoveToSuperview:(UIView*)newSuperview { 19 | if (newSuperview) { 20 | [self layoutAnimatedLayer]; 21 | } else { 22 | [_ringAnimatedLayer removeFromSuperlayer]; 23 | _ringAnimatedLayer = nil; 24 | } 25 | } 26 | 27 | - (void)layoutAnimatedLayer { 28 | CALayer *layer = self.ringAnimatedLayer; 29 | [self.layer addSublayer:layer]; 30 | 31 | CGFloat widthDiff = CGRectGetWidth(self.bounds) - CGRectGetWidth(layer.bounds); 32 | CGFloat heightDiff = CGRectGetHeight(self.bounds) - CGRectGetHeight(layer.bounds); 33 | layer.position = CGPointMake(CGRectGetWidth(self.bounds) - CGRectGetWidth(layer.bounds) / 2 - widthDiff / 2, CGRectGetHeight(self.bounds) - CGRectGetHeight(layer.bounds) / 2 - heightDiff / 2); 34 | } 35 | 36 | - (CAShapeLayer*)ringAnimatedLayer { 37 | if(!_ringAnimatedLayer) { 38 | CGPoint arcCenter = CGPointMake(self.radius+self.strokeThickness/2+5, self.radius+self.strokeThickness/2+5); 39 | UIBezierPath* smoothedPath = [UIBezierPath bezierPathWithArcCenter:arcCenter radius:self.radius startAngle:(CGFloat)-M_PI_2 endAngle:(CGFloat) (M_PI + M_PI_2) clockwise:YES]; 40 | 41 | _ringAnimatedLayer = [CAShapeLayer layer]; 42 | _ringAnimatedLayer.contentsScale = [[UIScreen mainScreen] scale]; 43 | _ringAnimatedLayer.frame = CGRectMake(0.0f, 0.0f, arcCenter.x*2, arcCenter.y*2); 44 | _ringAnimatedLayer.fillColor = [UIColor clearColor].CGColor; 45 | _ringAnimatedLayer.strokeColor = self.strokeColor.CGColor; 46 | _ringAnimatedLayer.lineWidth = self.strokeThickness; 47 | _ringAnimatedLayer.lineCap = kCALineCapRound; 48 | _ringAnimatedLayer.lineJoin = kCALineJoinBevel; 49 | _ringAnimatedLayer.path = smoothedPath.CGPath; 50 | } 51 | return _ringAnimatedLayer; 52 | } 53 | 54 | - (void)setFrame:(CGRect)frame { 55 | if(!CGRectEqualToRect(frame, super.frame)) { 56 | [super setFrame:frame]; 57 | 58 | if(self.superview) { 59 | [self layoutAnimatedLayer]; 60 | } 61 | } 62 | } 63 | 64 | - (void)setRadius:(CGFloat)radius { 65 | if(radius != _radius) { 66 | _radius = radius; 67 | 68 | [_ringAnimatedLayer removeFromSuperlayer]; 69 | _ringAnimatedLayer = nil; 70 | 71 | if(self.superview) { 72 | [self layoutAnimatedLayer]; 73 | } 74 | } 75 | } 76 | 77 | - (void)setStrokeColor:(UIColor*)strokeColor { 78 | _strokeColor = strokeColor; 79 | _ringAnimatedLayer.strokeColor = strokeColor.CGColor; 80 | } 81 | 82 | - (void)setStrokeThickness:(CGFloat)strokeThickness { 83 | _strokeThickness = strokeThickness; 84 | _ringAnimatedLayer.lineWidth = _strokeThickness; 85 | } 86 | 87 | - (void)setStrokeEnd:(CGFloat)strokeEnd { 88 | _strokeEnd = strokeEnd; 89 | _ringAnimatedLayer.strokeEnd = _strokeEnd; 90 | } 91 | 92 | - (CGSize)sizeThatFits:(CGSize)size { 93 | return CGSizeMake((self.radius+self.strokeThickness/2+5)*2, (self.radius+self.strokeThickness/2+5)*2); 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/angle-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/angle-mask.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/angle-mask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/angle-mask@2x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/angle-mask@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/angle-mask@3x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/error.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/error@2x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/error@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/error@3x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/info.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/info@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/info@2x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/info@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/info@3x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/success.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/success@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/success@2x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/success@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/Pods/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle/success@3x.png -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVRadialGradientLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVRadialGradientLayer.h 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2014-2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SVRadialGradientLayer : CALayer 11 | 12 | @property (nonatomic) CGPoint gradientCenter; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/SVProgressHUD/SVProgressHUD/SVRadialGradientLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVRadialGradientLayer.m 3 | // SVProgressHUD, https://github.com/SVProgressHUD/SVProgressHUD 4 | // 5 | // Copyright (c) 2014-2016 Tobias Tiemerding. All rights reserved. 6 | // 7 | 8 | #import "SVRadialGradientLayer.h" 9 | 10 | @implementation SVRadialGradientLayer 11 | 12 | - (void)drawInContext:(CGContextRef)context { 13 | size_t locationsCount = 2; 14 | CGFloat locations[2] = {0.0f, 1.0f}; 15 | CGFloat colors[8] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.75f}; 16 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 17 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount); 18 | CGColorSpaceRelease(colorSpace); 19 | 20 | float radius = MIN(self.bounds.size.width , self.bounds.size.height); 21 | CGContextDrawRadialGradient (context, gradient, self.gradientCenter, 0, self.gradientCenter, radius, kCGGradientDrawsAfterEndLocation); 22 | CGGradientRelease(gradient); 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJExtension : NSObject 3 | @end 4 | @implementation PodsDummy_MJExtension 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MJExtension 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJExtension" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDAutoLayout" "${PODS_ROOT}/Headers/Public/SVProgressHUD" 4 | PODS_BUILD_DIR = $BUILD_DIR 5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDAutoLayout" "${PODS_ROOT}/Headers/Public/SVProgressHUD" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SpeedTest/Pods-SpeedTest-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SpeedTest : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SpeedTest 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SpeedTest/Pods-SpeedTest.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDAutoLayout" "${PODS_ROOT}/Headers/Public/SVProgressHUD" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MJExtension" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" "$PODS_CONFIGURATION_BUILD_DIR/SDAutoLayout" "$PODS_CONFIGURATION_BUILD_DIR/SVProgressHUD" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/SDAutoLayout" -isystem "${PODS_ROOT}/Headers/Public/SVProgressHUD" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MJExtension" -l"Masonry" -l"SDAutoLayout" -l"SVProgressHUD" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-SpeedTest/Pods-SpeedTest.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDAutoLayout" "${PODS_ROOT}/Headers/Public/SVProgressHUD" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MJExtension" "$PODS_CONFIGURATION_BUILD_DIR/Masonry" "$PODS_CONFIGURATION_BUILD_DIR/SDAutoLayout" "$PODS_CONFIGURATION_BUILD_DIR/SVProgressHUD" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MJExtension" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/SDAutoLayout" -isystem "${PODS_ROOT}/Headers/Public/SVProgressHUD" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MJExtension" -l"Masonry" -l"SDAutoLayout" -l"SVProgressHUD" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDAutoLayout/SDAutoLayout-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDAutoLayout : NSObject 3 | @end 4 | @implementation PodsDummy_SDAutoLayout 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDAutoLayout/SDAutoLayout-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDAutoLayout/SDAutoLayout.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDAutoLayout 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDAutoLayout" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDAutoLayout" "${PODS_ROOT}/Headers/Public/SVProgressHUD" 4 | PODS_BUILD_DIR = $BUILD_DIR 5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SVProgressHUD/SVProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SVProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_SVProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SVProgressHUD/SVProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SVProgressHUD/SVProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SVProgressHUD 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SVProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MJExtension" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/SDAutoLayout" "${PODS_ROOT}/Headers/Public/SVProgressHUD" 4 | OTHER_LDFLAGS = -framework "QuartzCore" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GetNetSpeedTest 2 | demo集成了网络测速以及网络监控。方便检查检测网络的2G、3G、4G、WiFi的网速问题。单独的ping测试功能、Traceroute检测功能、DNS检测功能、端口检测等。简单易用的网络检测工具。 3 | -------------------------------------------------------------------------------- /SpeedTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SpeedTest.xcodeproj/project.xcworkspace/xcuserdata/shen.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest.xcodeproj/project.xcworkspace/xcuserdata/shen.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SpeedTest.xcodeproj/xcuserdata/shen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SpeedTest.xcodeproj/xcuserdata/shen.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SpeedTest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6407C1AF1EA07AAC004080AE 16 | 17 | primary 18 | 19 | 20 | 6407C1C81EA07AAC004080AE 21 | 22 | primary 23 | 24 | 25 | 6407C1D31EA07AAC004080AE 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SpeedTest.xcodeproj/xcuserdata/zhangyoubo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SpeedTest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6407C1AF1EA07AAC004080AE 16 | 17 | primary 18 | 19 | 20 | 6407C1C81EA07AAC004080AE 21 | 22 | primary 23 | 24 | 25 | 6407C1D31EA07AAC004080AE 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SpeedTest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SpeedTest.xcworkspace/xcuserdata/shen.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest.xcworkspace/xcuserdata/shen.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SpeedTest.xcworkspace/xcuserdata/shen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SpeedTest.xcworkspace/xcuserdata/zhangyoubo.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest.xcworkspace/xcuserdata/zhangyoubo.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SpeedTest.xcworkspace/xcuserdata/zhangyoubo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /SpeedTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /SpeedTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "TabVC.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinisaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | 22 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | 25 | TabVC *tabBarVC = [[TabVC alloc] init]; 26 | self.window.rootViewController = tabBarVC; 27 | [self.window makeKeyWindow]; 28 | 29 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO]; 30 | [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; 31 | 32 | 33 | return YES; 34 | } 35 | 36 | 37 | 38 | - (void)applicationWillResignActive:(UIApplication *)application { 39 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 40 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 41 | } 42 | 43 | 44 | - (void)applicationDidEnterBackground:(UIApplication *)application { 45 | // 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. 46 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 47 | } 48 | 49 | 50 | - (void)applicationWillEnterForeground:(UIApplication *)application { 51 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 52 | } 53 | 54 | 55 | - (void)applicationDidBecomeActive:(UIApplication *)application { 56 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 57 | } 58 | 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application { 61 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/backImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "返回箭头@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "返回箭头@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/backImage.imageset/返回箭头@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/backImage.imageset/返回箭头@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/backImage.imageset/返回箭头@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/backImage.imageset/返回箭头@3x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iconfont-home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iconfont-home@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-home.imageset/iconfont-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-home.imageset/iconfont-home.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-home.imageset/iconfont-home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-home.imageset/iconfont-home@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-homeselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iconfont-home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iconfont-home@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-homeselected.imageset/iconfont-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-homeselected.imageset/iconfont-home.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-homeselected.imageset/iconfont-home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-homeselected.imageset/iconfont-home@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-sousuo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iconfont-sousuo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iconfont-sousuo@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-sousuo.imageset/iconfont-sousuo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-sousuo.imageset/iconfont-sousuo.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-sousuo.imageset/iconfont-sousuo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-sousuo.imageset/iconfont-sousuo@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-sousuoselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iconfont-sousuo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iconfont-sousuo@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-sousuoselected.imageset/iconfont-sousuo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-sousuoselected.imageset/iconfont-sousuo.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-sousuoselected.imageset/iconfont-sousuo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-sousuoselected.imageset/iconfont-sousuo@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-wode.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iconfont-wode.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iconfont-wode@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-wode.imageset/iconfont-wode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-wode.imageset/iconfont-wode.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-wode.imageset/iconfont-wode@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-wode.imageset/iconfont-wode@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-wodeselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iconfont-wode.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "iconfont-wode@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-wodeselected.imageset/iconfont-wode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-wodeselected.imageset/iconfont-wode.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/iconfont-wodeselected.imageset/iconfont-wode@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/iconfont-wodeselected.imageset/iconfont-wode@2x.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/mycenterabout.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "my.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/mycenterabout.imageset/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/mycenterabout.imageset/my.png -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/pingfenabout.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "我们.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SpeedTest/Assets.xcassets/pingfenabout.imageset/我们.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyoubo/GetNetSpeedTest-NetworkMonitoring/cc5e34dce6cd08d51b9c5470a38d78b8aa1a010e/SpeedTest/Assets.xcassets/pingfenabout.imageset/我们.png -------------------------------------------------------------------------------- /SpeedTest/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SpeedTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SpeedTest/CKAlertViewController/CKAlertViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CKAlertViewController.h 3 | // 自定义警告框 4 | // 5 | // Created by 陈凯 on 16/8/24. 6 | // Copyright © 2016年 陈凯. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CKAlertAction : NSObject 12 | 13 | + (instancetype)actionWithTitle:(NSString *)title handler:(void (^)(CKAlertAction *action))handler; 14 | // readonly readwrite 15 | @property (nonatomic, readonly) NSString *title; 16 | 17 | @end 18 | 19 | 20 | @interface CKAlertViewController : UIViewController 21 | 22 | @property (nonatomic, readonly) NSArray *actions; 23 | @property (nonatomic, copy) NSString *title; 24 | @property (nonatomic, copy) NSString *message; 25 | @property (nonatomic, assign) NSTextAlignment messageAlignment; 26 | 27 | + (instancetype)alertControllerWithTitle:(NSString *)title message:(NSString *)message; 28 | - (void)addAction:(CKAlertAction *)action; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /SpeedTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UIRequiresFullScreen 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /SpeedTest/Main/AboutVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // AboutVC.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/17. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import "BaseVC.h" 10 | #import "TYHBaseViewController.h" 11 | @interface AboutVC : TYHBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SpeedTest/Main/AboutVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // AboutVC.m 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/17. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import "AboutVC.h" 10 | 11 | @interface AboutVC () 12 | 13 | @end 14 | 15 | @implementation AboutVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.title = @"关于APP"; 21 | [self aboutAPP]; 22 | } 23 | 24 | -(void)aboutAPP{ 25 | 26 | UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 64, kScreenWidth, 150)]; 27 | header.backgroundColor = kMainScreenColor; 28 | [self.view addSubview:header]; 29 | 30 | UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((kScreenWidth - 100)/2, (header.bounds.size.height - 120)/2, 100, 100)]; 31 | imageView.layer.cornerRadius = imageView.bounds.size.width/2; 32 | imageView.layer.masksToBounds = YES; 33 | imageView.backgroundColor = [UIColor yellowColor]; 34 | imageView.image = [UIImage imageNamed:@"logoimage"]; 35 | [header addSubview:imageView]; 36 | 37 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 38 | NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 39 | NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"]; 40 | 41 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,CGRectGetMaxY(imageView.frame)+ 5 , kScreenWidth,20)]; 42 | label.text = [NSString stringWithFormat:@"版本号:%@(%@)",app_Version,app_build]; 43 | label.font = [UIFont systemFontOfSize:10]; 44 | label.textAlignment = NSTextAlignmentCenter; 45 | [header addSubview:label]; 46 | 47 | UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(20,CGRectGetMaxY(header.frame)+ 10 ,kScreenWidth - 40, 160)]; 48 | textView.text = @" APP集成了网络测速以及网络监控。方便检查网络的2G、3G、4G、WiFi的网速问题;单独的ping测试功能、Traceroute检测功能、DNS检测功能、端口检测等。简单易用的网络检测工具。"; 49 | textView.backgroundColor = [UIColor clearColor]; 50 | textView.font = [UIFont systemFontOfSize:16]; 51 | [self.view addSubview:textView]; 52 | 53 | static CGFloat maxHeight = 160.0f; 54 | CGRect frame = textView.frame; 55 | CGSize constraintSize = CGSizeMake(frame.size.width, MAXFLOAT); 56 | CGSize size = [textView sizeThatFits:constraintSize]; 57 | if (size.height >= maxHeight){ 58 | size.height = maxHeight; 59 | textView.scrollEnabled = YES; // 允许滚动 60 | } 61 | else{ 62 | textView.scrollEnabled = NO; // 不允许滚动,当textview的大小足以容纳它的text的时候,需要设置scrollEnabed为NO,否则会出现光标乱滚动的情况 63 | } 64 | textView.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, size.height ); 65 | 66 | 67 | } 68 | 69 | - (void)didReceiveMemoryWarning { 70 | [super didReceiveMemoryWarning]; 71 | // Dispose of any resources that can be recreated. 72 | } 73 | 74 | /* 75 | #pragma mark - Navigation 76 | 77 | // In a storyboard-based application, you will often want to do a little preparation before navigation 78 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 79 | // Get the new view controller using [segue destinationViewController]. 80 | // Pass the selected object to the new view controller. 81 | } 82 | */ 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /SpeedTest/Main/MainVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainVC.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseVC.h" 11 | @interface MainVC : BaseVC 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SpeedTest/Main/SetVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // SetVC.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "BaseVC.h" 11 | @interface SetVC : BaseVC 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SpeedTest/OtherController/BaseVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseVC.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BaseVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SpeedTest/OtherController/BaseVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseVC.m 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import "BaseVC.h" 10 | 11 | @interface BaseVC () 12 | 13 | @end 14 | 15 | @implementation BaseVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | [self.navigationController.navigationBar setBarTintColor:kMainScreenColor]; 21 | 22 | 23 | [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]]; 24 | 25 | self.view.backgroundColor = kMainViewBgColor; 26 | } 27 | 28 | - (void)didReceiveMemoryWarning { 29 | [super didReceiveMemoryWarning]; 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | /* 34 | #pragma mark - Navigation 35 | 36 | // In a storyboard-based application, you will often want to do a little preparation before navigation 37 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 38 | // Get the new view controller using [segue destinationViewController]. 39 | // Pass the selected object to the new view controller. 40 | } 41 | */ 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /SpeedTest/OtherController/NaviVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NaviVC.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NaviVC : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SpeedTest/OtherController/NaviVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NaviVC.m 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import "NaviVC.h" 10 | 11 | @interface NaviVC () 12 | 13 | @end 14 | 15 | @implementation NaviVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /SpeedTest/OtherController/TabVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabVC.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TabVC : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SpeedTest/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | #ifdef __OBJC__ 15 | 16 | #ifndef __OPTIMIZE__ 17 | #define NSLog(...) printf("DEBUG LOG:%s\n",[[NSString stringWithFormat:__VA_ARGS__] UTF8String]); 18 | #endif 19 | 20 | #endif 21 | 22 | //屏幕的宽和高 23 | #define kScreenWidth [UIScreen mainScreen].bounds.size.width 24 | #define kScreenHeight [UIScreen mainScreen].bounds.size.height 25 | 26 | 27 | #define kMainScreenColor [UIColor colorWithRed:0.004 green:0.651 blue:0.996 alpha:1.000] 28 | #define kLineColor [UIColor colorWithRed:240.0/255 green:240.0/255 blue:246.0/255 alpha:1] 29 | 30 | #define kMainViewBgColor [UIColor colorWithRed:246.0/255 green:246.0/255 blue:246.0/255 alpha:1] 31 | #import "EPProgressShow.h" 32 | 33 | /******************* 34 | APP评分跳转链接 35 | ******************* */ 36 | //#define APPCommentURL @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=1219112934&pageNumber=0&sortOrdering=2&mt=8" 37 | #define APPCommentURL @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=1216010634&pageNumber=0&sortOrdering=2&mt=8" 38 | 39 | #endif /* PrefixHeader_pch */ 40 | -------------------------------------------------------------------------------- /SpeedTest/ReplicatorHUD/ReplicatorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ReplicatorView.h 3 | // TransitionDemo 4 | // 5 | // Created by Apple on 15/7/14. 6 | // Copyright (c) 2015年 Linitial. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ReplicatorView : UIView 12 | 13 | //@property (nonatomic, strong) UIColor *loadingColor; 14 | // 15 | //@property (nonatomic, assign) NSInteger instanceCount; 16 | 17 | + (void)showReplicatorLoadingInView:(UIView *)superview; 18 | 19 | + (void)disMissReplicatorLoadingInView:(UIView *)view; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /SpeedTest/ReplicatorHUD/ReplicatorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ReplicatorView.m 3 | // TransitionDemo 4 | // 5 | // Created by Apple on 15/7/14. 6 | // Copyright (c) 2015年 Linitial. All rights reserved. 7 | // 8 | 9 | #import "ReplicatorView.h" 10 | 11 | @interface ReplicatorView () 12 | 13 | @property (nonatomic, strong) CAReplicatorLayer *repLayer; 14 | @property (nonatomic, strong) CAShapeLayer *insLayer; 15 | @property (nonatomic, strong) CABasicAnimation *animation; 16 | 17 | @end 18 | 19 | CGFloat const kLoadingWidth = 200.0; 20 | 21 | @implementation ReplicatorView 22 | 23 | - (instancetype)initWithView:(UIView *)view { 24 | self = [super init]; 25 | if (self) { 26 | // self.instanceCount = 20.0; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)setupLayers { 32 | 33 | _repLayer = [CAReplicatorLayer layer]; 34 | _repLayer.frame = self.bounds; 35 | _repLayer.instanceCount = 20; 36 | _repLayer.preservesDepth = NO; 37 | _repLayer.instanceDelay = 1/20.0; 38 | _repLayer.instanceColor = [UIColor whiteColor].CGColor; 39 | _repLayer.instanceTransform = CATransform3DMakeRotation((M_PI*2.0)/18, 0.0, 0.0, 1.0); 40 | 41 | _insLayer = [CAShapeLayer layer]; 42 | _insLayer.frame = CGRectMake(self.bounds.size.width/2.0, 0.0, 6.0, 6.0); 43 | _insLayer.cornerRadius = 6.0/2; 44 | _insLayer.backgroundColor = kMainScreenColor.CGColor; 45 | [_repLayer addSublayer:_insLayer]; 46 | 47 | _animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 48 | _animation.fromValue = @0.5; 49 | _animation.toValue = @1.5; 50 | _animation.repeatCount = HUGE; 51 | _animation.duration = 1.; 52 | [_insLayer addAnimation:_animation forKey:nil]; 53 | [self.layer addSublayer:_repLayer]; 54 | } 55 | 56 | + (void)showReplicatorLoadingInView:(UIView *)superview{ 57 | if ([self loadingHUDForView:superview]) { 58 | return; 59 | } 60 | ReplicatorView *loadingView = [[ReplicatorView alloc] initWithView:superview]; 61 | loadingView.frame = CGRectMake(0, 0, kLoadingWidth, kLoadingWidth); 62 | loadingView.center = superview.center; 63 | [superview addSubview:loadingView]; 64 | 65 | [loadingView show]; 66 | } 67 | 68 | - (void)show { 69 | [NSObject cancelPreviousPerformRequestsWithTarget:self]; 70 | [self setupLayers]; 71 | } 72 | 73 | + (void)disMissReplicatorLoadingInView:(UIView *)view { 74 | ReplicatorView *loading = [self loadingHUDForView:view]; 75 | if (loading != nil) { 76 | [loading hide]; 77 | } 78 | } 79 | 80 | - (void)hide { 81 | [UIView animateWithDuration:0.4 animations:^{ 82 | self.alpha = 0; 83 | } completion:^(BOOL finished) { 84 | _insLayer = nil; 85 | _repLayer = nil; 86 | [self removeFromSuperview]; 87 | }]; 88 | } 89 | 90 | + (id)loadingHUDForView:(UIView *)view { 91 | NSEnumerator *subviewsEnum = [view.subviews reverseObjectEnumerator]; 92 | for (UIView *subview in subviewsEnum) { 93 | if ([subview isKindOfClass:self]) { 94 | return (ReplicatorView *)subview; 95 | } 96 | } 97 | return nil; 98 | } 99 | 100 | 101 | - (void)dealloc { 102 | NSLog(@"%s",__func__); 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /SpeedTest/Tool/EPProgressShow.h: -------------------------------------------------------------------------------- 1 | // 2 | // EPProgressShow.h 3 | // ExpressionPackage-Demo 4 | // 5 | // Created by shen on 17/3/23. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EPProgressShow : NSObject 12 | 13 | + (instancetype)showHUDManager; 14 | 15 | - (void)showInfoWithStatus:(NSString *)status; 16 | 17 | - (void)showErrorWithStatus:(NSString *)status; 18 | 19 | - (void)showSuccessWithStatus:(NSString *)status; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /SpeedTest/Tool/EPProgressShow.m: -------------------------------------------------------------------------------- 1 | // 2 | // EPProgressShow.m 3 | // ExpressionPackage-Demo 4 | // 5 | // Created by shen on 17/3/23. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import "EPProgressShow.h" 10 | #import "SVProgressHUD.h" 11 | 12 | @implementation EPProgressShow 13 | 14 | static EPProgressShow *manager = nil; 15 | 16 | + (instancetype)showHUDManager{ 17 | 18 | if (!manager) { 19 | manager = [[EPProgressShow alloc] init]; 20 | } 21 | return manager; 22 | } 23 | -(void)showInfoWithStatus:(NSString *)status{ 24 | 25 | [SVProgressHUD showInfoWithStatus:status]; 26 | [SVProgressHUD dismissWithDelay:1.0]; 27 | // [SVProgressHUD setOffsetFromCenter:UIOffsetMake(0,kScreenWidth/2)]; 28 | 29 | } 30 | 31 | - (void)showErrorWithStatus:(NSString *)status{ 32 | 33 | [SVProgressHUD showSuccessWithStatus:status]; 34 | [SVProgressHUD dismissWithDelay:1.0]; 35 | // [SVProgressHUD setOffsetFromCenter:UIOffsetMake(0,kScreenWidth/2)]; 36 | } 37 | 38 | - (void)showSuccessWithStatus:(NSString *)status{ 39 | 40 | [SVProgressHUD showSuccessWithStatus:status]; 41 | [SVProgressHUD dismissWithDelay:1.0]; 42 | // [SVProgressHUD setOffsetFromCenter:UIOffsetMake(0,kScreenWidth/2)]; 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /SpeedTest/Tool/MeasurNetTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // MeasurNetTools.h 3 | // 4 | // 5 | // Created by jordan on 16/7/25. 6 | // Copyright © 2016年 MD313. All rights reserved. 7 | // 8 | 9 | typedef void (^measureBlock) (float speed); 10 | typedef void (^finishMeasureBlock) (float speed); 11 | 12 | #import 13 | 14 | @interface MeasurNetTools : NSObject 15 | 16 | /** 17 | * 初始化测速方法 18 | * 19 | * @param measureBlock 实时返回测速信息 20 | * @param finishMeasureBlock 最后完成时候返回平均测速信息 21 | * 22 | * @return MeasurNetTools对象 23 | */ 24 | - (instancetype)initWithblock:(measureBlock)measureBlock finishMeasureBlock:(finishMeasureBlock)finishMeasureBlock failedBlock:(void (^) (NSError *error))failedBlock; 25 | 26 | /** 27 | * 开始测速 28 | */ 29 | -(void)startMeasur; 30 | 31 | /** 32 | * 停止测速,会通过block立即返回测试信息 33 | */ 34 | -(void)stopMeasur; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /SpeedTest/Tool/NetWorkReachability.h: -------------------------------------------------------------------------------- 1 | // 2 | // NetWorkReachability.h 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef NS_ENUM(NSUInteger, NetWorkStatus) { 13 | 14 | NetWorkStatusNotReachable = 0, 15 | NetWorkStatusUnknown = 1, 16 | NetWorkStatusWWAN2G = 2, 17 | NetWorkStatusWWAN3G = 3, 18 | NetWorkStatusWWAN4G = 4, 19 | 20 | NetWorkStatusWiFi = 9, 21 | }; 22 | 23 | extern NSString *kNetWorkReachabilityChangedNotification; 24 | 25 | 26 | @interface NetWorkReachability : NSObject 27 | 28 | /*! 29 | * Use to check the reachability of a given host name. 30 | */ 31 | + (instancetype)reachabilityWithHostName:(NSString *)hostName; 32 | 33 | /*! 34 | * Use to check the reachability of a given IP address. 35 | */ 36 | + (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress; 37 | 38 | /*! 39 | * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. 40 | */ 41 | + (instancetype)reachabilityForInternetConnection; 42 | 43 | - (BOOL)startNotifier; 44 | 45 | - (void)stopNotifier; 46 | 47 | - (NetWorkStatus)currentReachabilityStatus; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /SpeedTest/Tool/QBTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // QBTools.h 3 | // 4 | // 5 | // Created by tanglh on 19/5/15. 6 | // Copyright (c) 2015 MD313. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QBTools : NSObject 12 | 13 | + (unsigned long long) antiFormatBandWith:(NSString *)sizeStr; 14 | 15 | + (NSString *)formattedFileSize:(unsigned long long)size; 16 | //suffixLenth 单位字符串长度 17 | + (NSString *)formattedFileSize:(unsigned long long)size suffixLenth:(NSInteger *)length; 18 | 19 | + (NSString *)formattedBandWidth:(unsigned long long)size; 20 | 21 | + (NSString *)formatBandWidth:(unsigned long long)size; 22 | 23 | + (int)formatBandWidthInt:(unsigned long long) size; 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /SpeedTest/Tool/UIImage+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Extension.h 3 | // SportsFans 4 | // 5 | // Created by qianfeng on 15/11/26. 6 | // Copyright (c) 2015年 1000phone. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Extension) 12 | 13 | //设置图片按照原图渲染 14 | +(instancetype)imageWithOriginalImageName:(NSString *)imageName; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /SpeedTest/Tool/UIImage+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Extension.m 3 | // SportsFans 4 | // 5 | // Created by qianfeng on 15/11/26. 6 | // Copyright (c) 2015年 1000phone. All rights reserved. 7 | // 8 | 9 | #import "UIImage+Extension.h" 10 | 11 | @implementation UIImage (Extension) 12 | 13 | 14 | +(instancetype)imageWithOriginalImageName:(NSString *)imageName{ 15 | 16 | return [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 17 | 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /SpeedTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SpeedTest 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SpeedTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SpeedTestTests/SpeedTestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpeedTestTests.m 3 | // SpeedTestTests 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SpeedTestTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SpeedTestTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /SpeedTestUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SpeedTestUITests/SpeedTestUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpeedTestUITests.m 3 | // SpeedTestUITests 4 | // 5 | // Created by shen on 17/4/14. 6 | // Copyright © 2017年 shen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SpeedTestUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SpeedTestUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------