Latest 1.3.1
Homepage https://github.com/dani-gavrilov/GDPerformanceView
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Foundation, QuartzCore
Authors

Shows FPS, CPU usage, app and iOS versions above the status bar and report FPS and CPU usage via delegate.

Pod Version
Swift Version
Swift Version
Plaform
License MIT

Alt text
Alt text
Alt text
Alt text

Installation

Simply add GDPerformanceMonitoring folder with files to your project, or use CocoaPods.

Podfile

You can use CocoaPods to install GDPerformanceView by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!

target 'project_name' do
    pod 'GDPerformanceView', '~> 1.3.1'
end

Don’t forget to import GDPerformanceView by adding:

#import <GDPerformanceView/GDPerformanceMonitor.h>

Usage example

Simply start monitoring. Performance view will be added above the status bar automatically.
Also, you can configure appearance as you like or just hide the monitoring view and use its delegate.

Start monitoring

Call to start or resume monitoring and show monitoring view.

[[GDPerformanceMonitor sharedInstance] startMonitoring];
self.performanceMonitor = [GDPerformanceMonitor alloc] init];
[self.performanceMonitor startMonitoring];

Stop monitoring

Call when you’re done with performance monitoring.

[self.performanceMonitor stopMonitoring];

Call to hide and pause monitoring.

[self.performanceMonitor pauseMonitoring];

Configuration

Call to change appearance.

[self.performanceMonitor configureWithConfiguration:^(UILabel *textLabel) {
    [textLabel setBackgroundColor:[UIColor blackColor]];
    [textLabel setTextColor:[UIColor whiteColor]];
    [textLabel.layer setBorderColor:[[UIColor blackColor] CGColor]];
}];

Call to change output information.

[self.performanceMonitor setAppVersionHidden:YES]
[self.performanceMonitor setDeviceVersionHidden:YES];

Call to hide monitoring view.

[self.performanceMonitor hideMonitoring];

Call to change status bar appearance.

[self.performanceMonitor configureStatusBarAppearanceWithPrefersStatusBarHidden:NO preferredStatusBarStyle:UIStatusBarStyleLightContent];

Start monitoring and configure

[self.performanceMonitor startMonitoringWithConfiguration:^(UILabel *textLabel) {
    [textLabel setBackgroundColor:[UIColor blackColor]];
    [textLabel setTextColor:[UIColor whiteColor]];
    [textLabel.layer setBorderColor:[[UIColor blackColor] CGColor]];
}];

Delegate

Set the delegate and implement its method.

[self.performanceMonitor setDelegate:self];
- (void)performanceMonitorDidReportFPS:(int)fpsValue CPU:(float)cpuValue {
    NSLog(@"%d %f", fpsValue, cpuValue);
}

Requirements

  • iOS 8.0+
  • xCode 8.2+

Meta

Daniil Gavrilov – VKFB

GDPerformanceView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "GDPerformanceView",
    "version": "1.3.1",
    "summary": "Shows FPS, CPU usage, app and iOS versions above the status bar and report FPS and CPU usage via delegate.",
    "homepage": "https://github.com/dani-gavrilov/GDPerformanceView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Gavrilov Daniil": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/dani-gavrilov/GDPerformanceView.git",
        "tag": "1.3.1"
    },
    "source_files": "GDPerformanceView/GDPerformanceMonitoring/*",
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This