[iOS] 显示 FPS 值在 iOS 状态栏的小东西

一、JPFPSStatus

README 中文

Show FPS Status on StatusBar

Podfile
platform :ios, '7.0'
pod 'JPFPSStatus', '~> 0.0.2'
Instruction

Note:Use JPFPSStatus in DEBUG mode

add the code in 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] open];
#endif

Licenses

All source code is licensed under theMIT License.

二、

iOS显示FPS值的工具FHHFPSIndicator

FHHFPSIndicator提供了三种位置显示FPS值,默认是'中偏下',此外还有‘中偏左’、‘中偏右’。iPhone4、5系列手机建议采用默认值来显示调试。

GitHub地址:https://github.com/jvjishou/FHHFPSIndicator

snapshot1.PNG

QQ截图20160704121203.png

集成方法和使用步骤:

将`FHHFPSIndicator`文件夹中的所有源代码拽入项目中。

然后在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;
}

注意:必须在:

[self.window makeKeyAndVisible];

之后添加。

详情请参考GitHub项目地址。




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值