加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iOS开发中显示实时的FPS值

发布时间:2020-12-15 02:05:26 所属栏目:百科 来源:网络整理
导读:OttoFPSButton 前言 在项目开发中,有的时候需要查看实时的 FPS 值,以此作为性能的参考。 优势 实时显示FPS值。 可以拖到任意位置贴边,不影响调试。 效果图 使用 将OttoFPSButton目录拖到目标工程下,在 AppDelegate.m 里面加入下面代码 #import "OttoFPSB

OttoFPSButton

前言

在项目开发中,有的时候需要查看实时的FPS值,以此作为性能的参考。

优势

  1. 实时显示FPS值。
  2. 可以拖到任意位置贴边,不影响调试。

效果图

使用效果

可随意拖动位置,不影响调试

使用

将OttoFPSButton目录拖到目标工程下,在AppDelegate.m里面加入下面代码

#import "OttoFPSButton.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.window makeKeyAndVisible];

CGRect frame = CGRectMake(0,300,80,30);
UIColor *btnBGColor = [UIColor colorWithWhite:0.000 alpha:0.700];
OttoFPSButton *btn = [OttoFPSButton setTouchWithFrame:frame titleColor:[UIColor whiteColor] titleFont:[UIFont systemFontOfSize:15] backgroundColor:btnBGColor backgroundImage:nil];
[self.window addSubview:btn];

return YES;
}

这样就能在项目中看到FPS的状态变化了。

点我下载Demo

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读