OttoFPSButton
前言
在项目开发中,有的时候需要查看实时的FPS
值,以此作为性能的参考。
优势
- 实时显示FPS值。
- 可以拖到任意位置贴边,不影响调试。
效果图
使用
将OttoFPSButton目录拖到目标工程下,在AppDelegate.m
里面加入下面代码12345678910111213#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
的状态变化了。