FHHFPSIndicator can show FPS in your APP
See Demo/FHHFPSIndicatorDemo
- Add
pod "FHHFPSIndicator"
to your Podfile. - Run
pod install
orpod update
. - Import <FHHFPSIndicator/FHHFPSIndicator.h>.
- Drag all source files under floder
FHHFPSIndicator
to your project - Import the main header file:
#import "FHHFPSIndicator.h"
###Instruction you shoud call after the keyWindw becomes keyAndVisible;
Advice:Use FHHFPSIndicator in DEBUG mode
add the code in AppDelegate.m
#if defined(DEBUG) || defined(_DEBUG) #import "FHHFPSIndicator.h" #endif - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.window makeKeyAndVisible]; // add the follwing code after the window become keyAndVisible #if defined(DEBUG) || defined(_DEBUG) [[FHHFPSIndicator sharedFPSIndicator] show]; // [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopRight; #endif self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]]; return YES; }
FHHFPSIndicator is provided under the MIT license. See LICENSE file for details.
--- 中文介绍 ============== FHHFPSIndicator可以用于在iOS开发中显示当前画面的FPS.
查看并运行 Demo/FHHFPSIndicatorDemo
- 在 Podfile 中添加
pod "FHHFPSIndicator"
。 - 执行
pod install
或pod update
。 - 导入 <FHHFPSIndicator/FHHFPSIndicator.h>。
- 将
FHHFPSIndicator
文件夹中的所有源代码拽入项目中。 - 导入主头文件:
#import "FHHFPSIndicator.h"
。
###使用说明
在AppDelegate.m文件中的didFinishLaunchingWithOptions方法中,当执行了[self.window makeKeyAndVisible];
后,调用[[FHHFPSIndicator sharedFPSIndicator] show]
。
建议:在DEBUG模式下使用显示FPS功能
#if defined(DEBUG) || defined(_DEBUG) #import "FHHFPSIndicator.h" #endif - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; [self.window makeKeyAndVisible]; // add the follwing code after the window become keyAndVisible #if defined(DEBUG) || defined(_DEBUG) [[FHHFPSIndicator sharedFPSIndicator] show]; // [FHHFPSIndicator sharedFPSIndicator].fpsLabelPosition = FPSIndicatorPositionTopRight; #endif self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[HomeViewController alloc] init]]; return YES; }
FHHFPSIndicator 使用 MIT 许可证,详情见 LICENSE 文件。