YSFPSStatus version 0.0.1

YSFPSStatus version 0.0.1

kyson 维护。



YSFPSStatus version 0.0.1

  • 作者
  • kyson

YSFPSStatus

在状态栏上显示 FPS。(ps: FPS(每秒帧数) 是一秒钟渲染多少帧,FPS 的值最佳为大约 60,一般来说小于这个值就较为卡顿了。)

使用

YSFPSStatus 直接使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// 只在DEBUG模式下使用
#if defined(DEBUG)||defined(_DEBUG)
    [[YSFPSStatus sharedInstance] open];
#endif

//#if defined(DEBUG)||defined(_DEBUG)
//    [[YSFPSStatus sharedInstance] openWithHandler:^(NSInteger fpsValue) {
//        NSLog(@"fpsvalue %@",@(fpsValue));
//    }];
//#endif

    return YES;
}

YSFPSLabel 自定义使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ...

#if defined(DEBUG)||defined(_DEBUG)
    YSFPSLabel *fpsLabel = [[YSFPSLabel alloc] initWithFrame:CGRectMake(10, 300, 60, 30)];
//    fpsLabel.fpsHandler = ^(NSInteger fpsValue) {
//        NSLog(@"fpsvalue %@",@(fpsValue));
//    };
    [self.window.rootViewController.view addSubview:fpsLabel];
#endif

    return YES;
}

![]()