在 StatusBar 上显示 FPS 状态
platform :ios, '7.0'
pod 'JPFPSStatus', '~> 0.1'
注意:请在 DEBUG 模式下使用 JPFPSStatus
在 AppDelegate.m 中添加代码
#import "JPFPSStatus.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. #if defined(DEBUG)||defined(_DEBUG) [[JPFPSStatus sharedInstance] open]; #endif return YES; }
#if defined(DEBUG)||defined(_DEBUG) [[JPFPSStatus sharedInstance] openWithHandler:^(NSInteger fpsValue) { NSLog(@"fpsvalue %@",@(fpsValue)); }]; #endif
#if defined(DEBUG)||defined(_DEBUG) [[JPFPSStatus sharedInstance] close]; #endif
所有源代码均在 MIT 许可证下。