Coder Social home page Coder Social logo

augmify / gdperformanceview-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dani-gavrilov/gdperformanceview-swift

0.0 0.0 0.0 176 KB

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

License: MIT License

Ruby 3.00% Swift 97.00%

gdperformanceview-swift's Introduction

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

Alt text Alt text Alt text Alt text

Installation

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

Podfile

platform :ios, '8.0'
use_frameworks!

target 'project_name' do
	pod 'GDPerformanceView-Swift', '~> 1.0.2'
end

Usage

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.performanceView = GDPerformanceMonitor.init()
self.performanceView?.startMonitoring()

Stop monitoring

Call when you're done with performance monitoring.

self.performanceView?.stopMonitoring()

Call to hide and pause monitoring.

self.performanceView?.pauseMonitoring()

Configuration

Call to change appearance.

self.performanceView?.configure(configuration: { (textLabel) in
	textLabel?.backgroundColor = UIColor.black
	textLabel?.textColor = UIColor.white
	textLabel?.layer.borderColor = UIColor.black.cgColor
})

Call to change output information.

self.performanceView?.appVersionHidden = true
self.performanceView?.deviceVersionHidden = true

Call to hide monitoring view.

self.performanceView?.hideMonitoring()

Start monitoring and configure

self.performanceView?.startMonitoring(configuration: { (textLabel) in
	textLabel?.backgroundColor = UIColor.black
	textLabel?.textColor = UIColor.white
	textLabel?.layer.borderColor = UIColor.black.cgColor
})

Delegate

Set the delegate and implement its method.

self.performanceView?.delegate = self
func performanceMonitorDidReport(fpsValue: Float, cpuValue: Float) {
	print(fpsValue, cpuValue)
}

Requirements

  • iOS 8.0+

License

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

gdperformanceview-swift's People

Contributors

dani-gavrilov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.