├── BHBNetworkSpeedDemo ├── BHBNetworkSpeedDemo.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── bihongbo.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcuserdata │ │ └── bihongbo.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── BHBNetworkSpeedDemo.xcscheme │ └── project.pbxproj ├── BHBNetworkSpeedDemo │ ├── AppDelegate.h │ ├── main.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── BHBNetworkSpeed │ │ ├── BHBNetworkSpeed.h │ │ └── BHBNetworkSpeed.m │ ├── Info.plist │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ └── AppDelegate.m ├── BHBNetworkSpeedDemoTests │ ├── Info.plist │ └── BHBNetworkSpeedDemoTests.m └── BHBNetworkSpeedDemoUITests │ ├── Info.plist │ └── BHBNetworkSpeedDemoUITests.m └── README.md /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/project.xcworkspace/xcuserdata/bihongbo.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bb-coder/BHBNetworkSpeed/HEAD/BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/project.xcworkspace/xcuserdata/bihongbo.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // BHBNetworkSpeedDemo 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. 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 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // BHBNetworkSpeedDemo 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. 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 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/xcuserdata/bihongbo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemoTests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemoUITests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/xcuserdata/bihongbo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BHBNetworkSpeedDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F767E91C1BFDA52400D0723D 16 | 17 | primary 18 | 19 | 20 | F767E9351BFDA52400D0723D 21 | 22 | primary 23 | 24 | 25 | F767E9401BFDA52400D0723D 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/BHBNetworkSpeed/BHBNetworkSpeed.h: -------------------------------------------------------------------------------- 1 | // 2 | // BHBNetworkSpeed.h 3 | // BHBNetworkSpeedDemo 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #import 12 | 13 | 14 | @interface BHBNetworkSpeed : NSObject 15 | 16 | @property (nonatomic, copy, readonly) NSString * receivedNetworkSpeed; 17 | 18 | @property (nonatomic, copy, readonly) NSString * sendNetworkSpeed; 19 | 20 | + (instancetype)shareNetworkSpeed; 21 | 22 | - (void)startMonitoringNetworkSpeed; 23 | 24 | - (void)stopMonitoringNetworkSpeed; 25 | 26 | @end 27 | 28 | 29 | 30 | /** 31 | * @{@"received":@"100kB/s"} 32 | */ 33 | FOUNDATION_EXTERN NSString *const kNetworkReceivedSpeedNotification; 34 | 35 | /** 36 | * @{@"send":@"100kB/s"} 37 | */ 38 | FOUNDATION_EXTERN NSString *const kNetworkSendSpeedNotification; 39 | 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BHBNetworkSpeed 2 | iOS简单易用的下载上传速度(网速)监听工具 3 | 4 | ##使用方法: 5 | ###1.导入SystemConfiguration.framework 6 | 7 | ###2.开启监听 8 | 9 | [[BHBNetworkSpeed shareNetworkSpeed] startMonitoringNetworkSpeed]; 10 | 11 | ###3.注册下载网速通知 12 | 13 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(log) name:kNetworkReceivedSpeedNotification object:nil]; 14 | 15 | ###4.注册上传网速通知 16 | 17 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(log) name:kNetworkSendSpeedNotification object:nil]; 18 | 19 | ###5.读取网速 20 | 21 | - (void)log{ 22 | 23 | NSLog(@"received:%@",[BHBNetworkSpeed shareNetworkSpeed].receivedNetworkSpeed); 24 | 25 | NSLog(@"send:%@",[BHBNetworkSpeed shareNetworkSpeed].sendNetworkSpeed); 26 | 27 | } 28 | 29 | ###6.关闭监听 30 | 31 | [[BHBNetworkSpeed shareNetworkSpeed] stopMonitoringNetworkSpeed]; 32 | 33 | 34 | ####希望大家玩的开心😄,欢迎issue我! 35 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemoTests/BHBNetworkSpeedDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BHBNetworkSpeedDemoTests.m 3 | // BHBNetworkSpeedDemoTests 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BHBNetworkSpeedDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation BHBNetworkSpeedDemoTests 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 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIBackgroundModes 26 | 27 | newsstand-content 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemoUITests/BHBNetworkSpeedDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // BHBNetworkSpeedDemoUITests.m 3 | // BHBNetworkSpeedDemoUITests 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BHBNetworkSpeedDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation BHBNetworkSpeedDemoUITests 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 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/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 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // BHBNetworkSpeedDemo 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "BHBNetworkSpeed.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | 21 | [[BHBNetworkSpeed shareNetworkSpeed] startMonitoringNetworkSpeed]; 22 | 23 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(log) name:kNetworkReceivedSpeedNotification object:nil]; 24 | 25 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(log) name:kNetworkSendSpeedNotification object:nil]; 26 | 27 | return YES; 28 | } 29 | 30 | - (void)log{ 31 | 32 | NSLog(@"received:%@",[BHBNetworkSpeed shareNetworkSpeed].receivedNetworkSpeed); 33 | 34 | NSLog(@"send:%@",[BHBNetworkSpeed shareNetworkSpeed].sendNetworkSpeed); 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 throttle down OpenGL ES frame rates. Games should use this method to pause the game. 41 | } 42 | 43 | - (void)applicationDidEnterBackground:(UIApplication *)application { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | } 47 | 48 | - (void)applicationWillEnterForeground:(UIApplication *)application { 49 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | - (void)applicationWillTerminate:(UIApplication *)application { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/xcuserdata/bihongbo.xcuserdatad/xcschemes/BHBNetworkSpeedDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo/BHBNetworkSpeed/BHBNetworkSpeed.m: -------------------------------------------------------------------------------- 1 | // 2 | // BHBNetworkSpeed.m 3 | // BHBNetworkSpeedDemo 4 | // 5 | // Created by bihongbo on 15/11/19. 6 | // Copyright © 2015年 bihongbo. All rights reserved. 7 | // 8 | 9 | #import "BHBNetworkSpeed.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | /** 16 | * @{@"received":@"100kB/s"} 17 | */ 18 | NSString *const kNetworkReceivedSpeedNotification = @"kNetworkReceivedSpeedNotification"; 19 | 20 | /** 21 | * @{@"send":@"100kB/s"} 22 | */ 23 | NSString *const kNetworkSendSpeedNotification = @"kNetworkSendSpeedNotification"; 24 | 25 | @interface BHBNetworkSpeed () 26 | { 27 | uint32_t _iBytes; 28 | uint32_t _oBytes; 29 | uint32_t _allFlow; 30 | uint32_t _wifiIBytes; 31 | uint32_t _wifiOBytes; 32 | uint32_t _wifiFlow; 33 | uint32_t _wwanIBytes; 34 | uint32_t _wwanOBytes; 35 | uint32_t _wwanFlow; 36 | } 37 | 38 | @property (nonatomic, copy) NSString * receivedNetworkSpeed; 39 | 40 | @property (nonatomic, copy) NSString * sendNetworkSpeed; 41 | 42 | @property (nonatomic, strong) NSTimer * timer; 43 | 44 | @end 45 | 46 | @implementation BHBNetworkSpeed 47 | 48 | static BHBNetworkSpeed * instance = nil; 49 | 50 | + (instancetype)shareNetworkSpeed{ 51 | if(instance == nil){ 52 | static dispatch_once_t onceToken ; 53 | dispatch_once(&onceToken, ^{ 54 | instance = [[self alloc] init] ; 55 | }) ; 56 | } 57 | return instance; 58 | 59 | } 60 | 61 | + (instancetype)allocWithZone:(struct _NSZone *)zone{ 62 | 63 | if(instance == nil){ 64 | static dispatch_once_t onceToken; 65 | dispatch_once(&onceToken, ^{ 66 | 67 | instance = [super allocWithZone:zone]; 68 | 69 | }); 70 | } 71 | return instance; 72 | } 73 | 74 | -(instancetype)init{ 75 | 76 | static dispatch_once_t onceToken; 77 | dispatch_once(&onceToken, ^{ 78 | instance = [super init]; 79 | _iBytes = _oBytes = _allFlow = _wifiIBytes = _wifiOBytes = _wifiFlow = _wwanIBytes = _wwanOBytes = _wwanFlow = 0; 80 | }); 81 | return instance; 82 | 83 | } 84 | 85 | - (void)startMonitoringNetworkSpeed{ 86 | if(_timer) 87 | [self stopMonitoringNetworkSpeed]; 88 | _timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(netSpeedNotification) userInfo:nil repeats:YES]; 89 | } 90 | 91 | - (void)stopMonitoringNetworkSpeed{ 92 | if ([_timer isValid]) { 93 | [_timer invalidate]; 94 | } 95 | } 96 | 97 | - (void)netSpeedNotification{ 98 | [self checkNetworkflow]; 99 | } 100 | 101 | -(NSString *)bytesToAvaiUnit:(int)bytes 102 | { 103 | if(bytes < 1024) // B 104 | { 105 | return [NSString stringWithFormat:@"%dB", bytes]; 106 | } 107 | else if(bytes >= 1024 && bytes < 1024 * 1024) // KB 108 | { 109 | return [NSString stringWithFormat:@"%.1fKB", (double)bytes / 1024]; 110 | } 111 | else if(bytes >= 1024 * 1024 && bytes < 1024 * 1024 * 1024) // MB 112 | { 113 | return [NSString stringWithFormat:@"%.1fMB", (double)bytes / (1024 * 1024)]; 114 | } 115 | else // GB 116 | { 117 | return [NSString stringWithFormat:@"%.1fGB", (double)bytes / (1024 * 1024 * 1024)]; 118 | } 119 | } 120 | 121 | 122 | -(void)checkNetworkflow 123 | { 124 | struct ifaddrs *ifa_list = 0, *ifa; 125 | if (getifaddrs(&ifa_list) == -1) 126 | { 127 | return ; 128 | } 129 | 130 | uint32_t iBytes = 0; 131 | uint32_t oBytes = 0; 132 | uint32_t allFlow = 0; 133 | uint32_t wifiIBytes = 0; 134 | uint32_t wifiOBytes = 0; 135 | uint32_t wifiFlow = 0; 136 | uint32_t wwanIBytes = 0; 137 | uint32_t wwanOBytes = 0; 138 | uint32_t wwanFlow = 0; 139 | // struct timeval32 time; 140 | 141 | for (ifa = ifa_list; ifa; ifa = ifa->ifa_next) 142 | { 143 | if (AF_LINK != ifa->ifa_addr->sa_family) 144 | continue; 145 | 146 | if (!(ifa->ifa_flags & IFF_UP) && !(ifa->ifa_flags & IFF_RUNNING)) 147 | continue; 148 | 149 | if (ifa->ifa_data == 0) 150 | continue; 151 | 152 | // network flow 153 | if (strncmp(ifa->ifa_name, "lo", 2)) 154 | { 155 | struct if_data *if_data = (struct if_data *)ifa->ifa_data; 156 | 157 | iBytes += if_data->ifi_ibytes; 158 | oBytes += if_data->ifi_obytes; 159 | allFlow = iBytes + oBytes; 160 | // time = if_data->ifi_lastchange; 161 | } 162 | 163 | //wifi flow 164 | if (!strcmp(ifa->ifa_name, "en0")) 165 | { 166 | struct if_data *if_data = (struct if_data *)ifa->ifa_data; 167 | 168 | wifiIBytes += if_data->ifi_ibytes; 169 | wifiOBytes += if_data->ifi_obytes; 170 | wifiFlow = wifiIBytes + wifiOBytes; 171 | } 172 | 173 | //3G and gprs flow 174 | if (!strcmp(ifa->ifa_name, "pdp_ip0")) 175 | { 176 | struct if_data *if_data = (struct if_data *)ifa->ifa_data; 177 | 178 | wwanIBytes += if_data->ifi_ibytes; 179 | wwanOBytes += if_data->ifi_obytes; 180 | wwanFlow = wwanIBytes + wwanOBytes; 181 | } 182 | } 183 | freeifaddrs(ifa_list); 184 | 185 | 186 | if (_iBytes != 0) { 187 | self.receivedNetworkSpeed = [[self bytesToAvaiUnit:iBytes - _iBytes] stringByAppendingString:@"/s"]; 188 | [[NSNotificationCenter defaultCenter] postNotificationName:kNetworkReceivedSpeedNotification object:@{@"received":self.receivedNetworkSpeed}]; 189 | } 190 | 191 | _iBytes = iBytes; 192 | 193 | if (_oBytes != 0) { 194 | self.sendNetworkSpeed = [[self bytesToAvaiUnit:oBytes - _oBytes] stringByAppendingString:@"/s"]; 195 | [[NSNotificationCenter defaultCenter] postNotificationName:kNetworkSendSpeedNotification object:@{@"send":self.sendNetworkSpeed}]; 196 | } 197 | _oBytes = oBytes; 198 | 199 | // 200 | // NSLog(@"sentBytes==%@",sentBytes); 201 | // NSString *networkFlow = [self bytesToAvaiUnit:allFlow]; 202 | // // 203 | // NSLog(@"networkFlow==%@",networkFlow); 204 | // // 205 | // NSString *wifiReceived = [self bytesToAvaiUnit:wifiIBytes]; 206 | // 207 | // NSLog(@"wifiReceived==%@",wifiReceived); 208 | // 209 | // NSString *wifiSent = [self bytesToAvaiUnit: wifiOBytes]; 210 | // 211 | // NSLog(@"wifiSent==%@",wifiSent); 212 | // 213 | // NSString *wifiBytes = [self bytesToAvaiUnit:wifiFlow]; 214 | // // 215 | // NSLog(@"wifiBytes==%@",wifiBytes); 216 | // NSString *wwanReceived = [self bytesToAvaiUnit:wwanIBytes]; 217 | // 218 | // NSLog(@"wwanReceived==%@",wwanReceived); 219 | // NSString *wwanSent = [self bytesToAvaiUnit:wwanOBytes]; 220 | // 221 | // NSLog(@"wwanSent==%@",wwanSent); 222 | // NSString *wwanBytes = [self bytesToAvaiUnit:wwanFlow]; 223 | // // 224 | // NSLog(@"wwanBytes==%@",wwanBytes); 225 | } 226 | @end 227 | 228 | -------------------------------------------------------------------------------- /BHBNetworkSpeedDemo/BHBNetworkSpeedDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F74E107C1BFF192B00923DE3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F74E107B1BFF192B00923DE3 /* SystemConfiguration.framework */; }; 11 | F767E9221BFDA52400D0723D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F767E9211BFDA52400D0723D /* main.m */; }; 12 | F767E9251BFDA52400D0723D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F767E9241BFDA52400D0723D /* AppDelegate.m */; }; 13 | F767E92D1BFDA52400D0723D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F767E92C1BFDA52400D0723D /* Assets.xcassets */; }; 14 | F767E9301BFDA52400D0723D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F767E92E1BFDA52400D0723D /* LaunchScreen.storyboard */; }; 15 | F767E93B1BFDA52400D0723D /* BHBNetworkSpeedDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F767E93A1BFDA52400D0723D /* BHBNetworkSpeedDemoTests.m */; }; 16 | F767E9461BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F767E9451BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.m */; }; 17 | F767E9561BFDA56200D0723D /* BHBNetworkSpeed.m in Sources */ = {isa = PBXBuildFile; fileRef = F767E9551BFDA56200D0723D /* BHBNetworkSpeed.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | F767E9371BFDA52400D0723D /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = F767E9151BFDA52400D0723D /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = F767E91C1BFDA52400D0723D; 26 | remoteInfo = BHBNetworkSpeedDemo; 27 | }; 28 | F767E9421BFDA52400D0723D /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = F767E9151BFDA52400D0723D /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = F767E91C1BFDA52400D0723D; 33 | remoteInfo = BHBNetworkSpeedDemo; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | F74E107B1BFF192B00923DE3 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 39 | F767E91D1BFDA52400D0723D /* BHBNetworkSpeedDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BHBNetworkSpeedDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | F767E9211BFDA52400D0723D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | F767E9231BFDA52400D0723D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | F767E9241BFDA52400D0723D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | F767E92C1BFDA52400D0723D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 44 | F767E92F1BFDA52400D0723D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 45 | F767E9311BFDA52400D0723D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | F767E9361BFDA52400D0723D /* BHBNetworkSpeedDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BHBNetworkSpeedDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | F767E93A1BFDA52400D0723D /* BHBNetworkSpeedDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BHBNetworkSpeedDemoTests.m; sourceTree = ""; }; 48 | F767E93C1BFDA52400D0723D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | F767E9411BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BHBNetworkSpeedDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | F767E9451BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BHBNetworkSpeedDemoUITests.m; sourceTree = ""; }; 51 | F767E9471BFDA52400D0723D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | F767E9541BFDA56200D0723D /* BHBNetworkSpeed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BHBNetworkSpeed.h; sourceTree = ""; }; 53 | F767E9551BFDA56200D0723D /* BHBNetworkSpeed.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BHBNetworkSpeed.m; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | F767E91A1BFDA52400D0723D /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | F74E107C1BFF192B00923DE3 /* SystemConfiguration.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | F767E9331BFDA52400D0723D /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | F767E93E1BFDA52400D0723D /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | F767E9141BFDA52400D0723D = { 83 | isa = PBXGroup; 84 | children = ( 85 | F74E107B1BFF192B00923DE3 /* SystemConfiguration.framework */, 86 | F767E91F1BFDA52400D0723D /* BHBNetworkSpeedDemo */, 87 | F767E9391BFDA52400D0723D /* BHBNetworkSpeedDemoTests */, 88 | F767E9441BFDA52400D0723D /* BHBNetworkSpeedDemoUITests */, 89 | F767E91E1BFDA52400D0723D /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | F767E91E1BFDA52400D0723D /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | F767E91D1BFDA52400D0723D /* BHBNetworkSpeedDemo.app */, 97 | F767E9361BFDA52400D0723D /* BHBNetworkSpeedDemoTests.xctest */, 98 | F767E9411BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.xctest */, 99 | ); 100 | name = Products; 101 | sourceTree = ""; 102 | }; 103 | F767E91F1BFDA52400D0723D /* BHBNetworkSpeedDemo */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | F767E9531BFDA54F00D0723D /* BHBNetworkSpeed */, 107 | F767E9231BFDA52400D0723D /* AppDelegate.h */, 108 | F767E9241BFDA52400D0723D /* AppDelegate.m */, 109 | F767E92C1BFDA52400D0723D /* Assets.xcassets */, 110 | F767E92E1BFDA52400D0723D /* LaunchScreen.storyboard */, 111 | F767E9311BFDA52400D0723D /* Info.plist */, 112 | F767E9201BFDA52400D0723D /* Supporting Files */, 113 | ); 114 | path = BHBNetworkSpeedDemo; 115 | sourceTree = ""; 116 | }; 117 | F767E9201BFDA52400D0723D /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | F767E9211BFDA52400D0723D /* main.m */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | F767E9391BFDA52400D0723D /* BHBNetworkSpeedDemoTests */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | F767E93A1BFDA52400D0723D /* BHBNetworkSpeedDemoTests.m */, 129 | F767E93C1BFDA52400D0723D /* Info.plist */, 130 | ); 131 | path = BHBNetworkSpeedDemoTests; 132 | sourceTree = ""; 133 | }; 134 | F767E9441BFDA52400D0723D /* BHBNetworkSpeedDemoUITests */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | F767E9451BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.m */, 138 | F767E9471BFDA52400D0723D /* Info.plist */, 139 | ); 140 | path = BHBNetworkSpeedDemoUITests; 141 | sourceTree = ""; 142 | }; 143 | F767E9531BFDA54F00D0723D /* BHBNetworkSpeed */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | F767E9541BFDA56200D0723D /* BHBNetworkSpeed.h */, 147 | F767E9551BFDA56200D0723D /* BHBNetworkSpeed.m */, 148 | ); 149 | path = BHBNetworkSpeed; 150 | sourceTree = ""; 151 | }; 152 | /* End PBXGroup section */ 153 | 154 | /* Begin PBXNativeTarget section */ 155 | F767E91C1BFDA52400D0723D /* BHBNetworkSpeedDemo */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = F767E94A1BFDA52400D0723D /* Build configuration list for PBXNativeTarget "BHBNetworkSpeedDemo" */; 158 | buildPhases = ( 159 | F767E9191BFDA52400D0723D /* Sources */, 160 | F767E91A1BFDA52400D0723D /* Frameworks */, 161 | F767E91B1BFDA52400D0723D /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | ); 167 | name = BHBNetworkSpeedDemo; 168 | productName = BHBNetworkSpeedDemo; 169 | productReference = F767E91D1BFDA52400D0723D /* BHBNetworkSpeedDemo.app */; 170 | productType = "com.apple.product-type.application"; 171 | }; 172 | F767E9351BFDA52400D0723D /* BHBNetworkSpeedDemoTests */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = F767E94D1BFDA52400D0723D /* Build configuration list for PBXNativeTarget "BHBNetworkSpeedDemoTests" */; 175 | buildPhases = ( 176 | F767E9321BFDA52400D0723D /* Sources */, 177 | F767E9331BFDA52400D0723D /* Frameworks */, 178 | F767E9341BFDA52400D0723D /* Resources */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | F767E9381BFDA52400D0723D /* PBXTargetDependency */, 184 | ); 185 | name = BHBNetworkSpeedDemoTests; 186 | productName = BHBNetworkSpeedDemoTests; 187 | productReference = F767E9361BFDA52400D0723D /* BHBNetworkSpeedDemoTests.xctest */; 188 | productType = "com.apple.product-type.bundle.unit-test"; 189 | }; 190 | F767E9401BFDA52400D0723D /* BHBNetworkSpeedDemoUITests */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = F767E9501BFDA52400D0723D /* Build configuration list for PBXNativeTarget "BHBNetworkSpeedDemoUITests" */; 193 | buildPhases = ( 194 | F767E93D1BFDA52400D0723D /* Sources */, 195 | F767E93E1BFDA52400D0723D /* Frameworks */, 196 | F767E93F1BFDA52400D0723D /* Resources */, 197 | ); 198 | buildRules = ( 199 | ); 200 | dependencies = ( 201 | F767E9431BFDA52400D0723D /* PBXTargetDependency */, 202 | ); 203 | name = BHBNetworkSpeedDemoUITests; 204 | productName = BHBNetworkSpeedDemoUITests; 205 | productReference = F767E9411BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.xctest */; 206 | productType = "com.apple.product-type.bundle.ui-testing"; 207 | }; 208 | /* End PBXNativeTarget section */ 209 | 210 | /* Begin PBXProject section */ 211 | F767E9151BFDA52400D0723D /* Project object */ = { 212 | isa = PBXProject; 213 | attributes = { 214 | LastUpgradeCheck = 0710; 215 | ORGANIZATIONNAME = bihongbo; 216 | TargetAttributes = { 217 | F767E91C1BFDA52400D0723D = { 218 | CreatedOnToolsVersion = 7.1; 219 | SystemCapabilities = { 220 | com.apple.BackgroundModes = { 221 | enabled = 1; 222 | }; 223 | }; 224 | }; 225 | F767E9351BFDA52400D0723D = { 226 | CreatedOnToolsVersion = 7.1; 227 | TestTargetID = F767E91C1BFDA52400D0723D; 228 | }; 229 | F767E9401BFDA52400D0723D = { 230 | CreatedOnToolsVersion = 7.1; 231 | TestTargetID = F767E91C1BFDA52400D0723D; 232 | }; 233 | }; 234 | }; 235 | buildConfigurationList = F767E9181BFDA52400D0723D /* Build configuration list for PBXProject "BHBNetworkSpeedDemo" */; 236 | compatibilityVersion = "Xcode 3.2"; 237 | developmentRegion = English; 238 | hasScannedForEncodings = 0; 239 | knownRegions = ( 240 | en, 241 | Base, 242 | ); 243 | mainGroup = F767E9141BFDA52400D0723D; 244 | productRefGroup = F767E91E1BFDA52400D0723D /* Products */; 245 | projectDirPath = ""; 246 | projectRoot = ""; 247 | targets = ( 248 | F767E91C1BFDA52400D0723D /* BHBNetworkSpeedDemo */, 249 | F767E9351BFDA52400D0723D /* BHBNetworkSpeedDemoTests */, 250 | F767E9401BFDA52400D0723D /* BHBNetworkSpeedDemoUITests */, 251 | ); 252 | }; 253 | /* End PBXProject section */ 254 | 255 | /* Begin PBXResourcesBuildPhase section */ 256 | F767E91B1BFDA52400D0723D /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | F767E9301BFDA52400D0723D /* LaunchScreen.storyboard in Resources */, 261 | F767E92D1BFDA52400D0723D /* Assets.xcassets in Resources */, 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | F767E9341BFDA52400D0723D /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | F767E93F1BFDA52400D0723D /* Resources */ = { 273 | isa = PBXResourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXResourcesBuildPhase section */ 280 | 281 | /* Begin PBXSourcesBuildPhase section */ 282 | F767E9191BFDA52400D0723D /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | F767E9251BFDA52400D0723D /* AppDelegate.m in Sources */, 287 | F767E9221BFDA52400D0723D /* main.m in Sources */, 288 | F767E9561BFDA56200D0723D /* BHBNetworkSpeed.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | F767E9321BFDA52400D0723D /* Sources */ = { 293 | isa = PBXSourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | F767E93B1BFDA52400D0723D /* BHBNetworkSpeedDemoTests.m in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | F767E93D1BFDA52400D0723D /* Sources */ = { 301 | isa = PBXSourcesBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | F767E9461BFDA52400D0723D /* BHBNetworkSpeedDemoUITests.m in Sources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | /* End PBXSourcesBuildPhase section */ 309 | 310 | /* Begin PBXTargetDependency section */ 311 | F767E9381BFDA52400D0723D /* PBXTargetDependency */ = { 312 | isa = PBXTargetDependency; 313 | target = F767E91C1BFDA52400D0723D /* BHBNetworkSpeedDemo */; 314 | targetProxy = F767E9371BFDA52400D0723D /* PBXContainerItemProxy */; 315 | }; 316 | F767E9431BFDA52400D0723D /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = F767E91C1BFDA52400D0723D /* BHBNetworkSpeedDemo */; 319 | targetProxy = F767E9421BFDA52400D0723D /* PBXContainerItemProxy */; 320 | }; 321 | /* End PBXTargetDependency section */ 322 | 323 | /* Begin PBXVariantGroup section */ 324 | F767E92E1BFDA52400D0723D /* LaunchScreen.storyboard */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | F767E92F1BFDA52400D0723D /* Base */, 328 | ); 329 | name = LaunchScreen.storyboard; 330 | sourceTree = ""; 331 | }; 332 | /* End PBXVariantGroup section */ 333 | 334 | /* Begin XCBuildConfiguration section */ 335 | F767E9481BFDA52400D0723D /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 350 | CLANG_WARN_UNREACHABLE_CODE = YES; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 353 | COPY_PHASE_STRIP = NO; 354 | DEBUG_INFORMATION_FORMAT = dwarf; 355 | ENABLE_STRICT_OBJC_MSGSEND = YES; 356 | ENABLE_TESTABILITY = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu99; 358 | GCC_DYNAMIC_NO_PIC = NO; 359 | GCC_NO_COMMON_BLOCKS = YES; 360 | GCC_OPTIMIZATION_LEVEL = 0; 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 372 | MTL_ENABLE_DEBUG_INFO = YES; 373 | ONLY_ACTIVE_ARCH = YES; 374 | SDKROOT = iphoneos; 375 | }; 376 | name = Debug; 377 | }; 378 | F767E9491BFDA52400D0723D /* Release */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | ALWAYS_SEARCH_USER_PATHS = NO; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_BOOL_CONVERSION = YES; 387 | CLANG_WARN_CONSTANT_CONVERSION = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 393 | CLANG_WARN_UNREACHABLE_CODE = YES; 394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 396 | COPY_PHASE_STRIP = NO; 397 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 398 | ENABLE_NS_ASSERTIONS = NO; 399 | ENABLE_STRICT_OBJC_MSGSEND = YES; 400 | GCC_C_LANGUAGE_STANDARD = gnu99; 401 | GCC_NO_COMMON_BLOCKS = YES; 402 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 403 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 404 | GCC_WARN_UNDECLARED_SELECTOR = YES; 405 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 406 | GCC_WARN_UNUSED_FUNCTION = YES; 407 | GCC_WARN_UNUSED_VARIABLE = YES; 408 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 409 | MTL_ENABLE_DEBUG_INFO = NO; 410 | SDKROOT = iphoneos; 411 | VALIDATE_PRODUCT = YES; 412 | }; 413 | name = Release; 414 | }; 415 | F767E94B1BFDA52400D0723D /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 419 | CODE_SIGN_IDENTITY = "iPhone Developer"; 420 | INFOPLIST_FILE = BHBNetworkSpeedDemo/Info.plist; 421 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 422 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 423 | PRODUCT_BUNDLE_IDENTIFIER = com.bhb.BHBNetworkSpeedDemo; 424 | PRODUCT_NAME = "$(TARGET_NAME)"; 425 | }; 426 | name = Debug; 427 | }; 428 | F767E94C1BFDA52400D0723D /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CODE_SIGN_IDENTITY = "iPhone Developer"; 433 | INFOPLIST_FILE = BHBNetworkSpeedDemo/Info.plist; 434 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 435 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 436 | PRODUCT_BUNDLE_IDENTIFIER = com.bhb.BHBNetworkSpeedDemo; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | }; 439 | name = Release; 440 | }; 441 | F767E94E1BFDA52400D0723D /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | BUNDLE_LOADER = "$(TEST_HOST)"; 445 | INFOPLIST_FILE = BHBNetworkSpeedDemoTests/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = com.bhb.BHBNetworkSpeedDemoTests; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BHBNetworkSpeedDemo.app/BHBNetworkSpeedDemo"; 450 | }; 451 | name = Debug; 452 | }; 453 | F767E94F1BFDA52400D0723D /* Release */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | BUNDLE_LOADER = "$(TEST_HOST)"; 457 | INFOPLIST_FILE = BHBNetworkSpeedDemoTests/Info.plist; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = com.bhb.BHBNetworkSpeedDemoTests; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BHBNetworkSpeedDemo.app/BHBNetworkSpeedDemo"; 462 | }; 463 | name = Release; 464 | }; 465 | F767E9511BFDA52400D0723D /* Debug */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | INFOPLIST_FILE = BHBNetworkSpeedDemoUITests/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 470 | PRODUCT_BUNDLE_IDENTIFIER = com.bhb.BHBNetworkSpeedDemoUITests; 471 | PRODUCT_NAME = "$(TARGET_NAME)"; 472 | TEST_TARGET_NAME = BHBNetworkSpeedDemo; 473 | USES_XCTRUNNER = YES; 474 | }; 475 | name = Debug; 476 | }; 477 | F767E9521BFDA52400D0723D /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | INFOPLIST_FILE = BHBNetworkSpeedDemoUITests/Info.plist; 481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 482 | PRODUCT_BUNDLE_IDENTIFIER = com.bhb.BHBNetworkSpeedDemoUITests; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_TARGET_NAME = BHBNetworkSpeedDemo; 485 | USES_XCTRUNNER = YES; 486 | }; 487 | name = Release; 488 | }; 489 | /* End XCBuildConfiguration section */ 490 | 491 | /* Begin XCConfigurationList section */ 492 | F767E9181BFDA52400D0723D /* Build configuration list for PBXProject "BHBNetworkSpeedDemo" */ = { 493 | isa = XCConfigurationList; 494 | buildConfigurations = ( 495 | F767E9481BFDA52400D0723D /* Debug */, 496 | F767E9491BFDA52400D0723D /* Release */, 497 | ); 498 | defaultConfigurationIsVisible = 0; 499 | defaultConfigurationName = Release; 500 | }; 501 | F767E94A1BFDA52400D0723D /* Build configuration list for PBXNativeTarget "BHBNetworkSpeedDemo" */ = { 502 | isa = XCConfigurationList; 503 | buildConfigurations = ( 504 | F767E94B1BFDA52400D0723D /* Debug */, 505 | F767E94C1BFDA52400D0723D /* Release */, 506 | ); 507 | defaultConfigurationIsVisible = 0; 508 | defaultConfigurationName = Release; 509 | }; 510 | F767E94D1BFDA52400D0723D /* Build configuration list for PBXNativeTarget "BHBNetworkSpeedDemoTests" */ = { 511 | isa = XCConfigurationList; 512 | buildConfigurations = ( 513 | F767E94E1BFDA52400D0723D /* Debug */, 514 | F767E94F1BFDA52400D0723D /* Release */, 515 | ); 516 | defaultConfigurationIsVisible = 0; 517 | defaultConfigurationName = Release; 518 | }; 519 | F767E9501BFDA52400D0723D /* Build configuration list for PBXNativeTarget "BHBNetworkSpeedDemoUITests" */ = { 520 | isa = XCConfigurationList; 521 | buildConfigurations = ( 522 | F767E9511BFDA52400D0723D /* Debug */, 523 | F767E9521BFDA52400D0723D /* Release */, 524 | ); 525 | defaultConfigurationIsVisible = 0; 526 | defaultConfigurationName = Release; 527 | }; 528 | /* End XCConfigurationList section */ 529 | }; 530 | rootObject = F767E9151BFDA52400D0723D /* Project object */; 531 | } 532 | --------------------------------------------------------------------------------