{"id":3172,"url":"https://github.com/dani-gavrilov/GDPerformanceView-Swift","last_synced_at":"2025-08-03T13:32:08.590Z","repository":{"id":38238671,"uuid":"78033811","full_name":"dani-gavrilov/GDPerformanceView-Swift","owner":"dani-gavrilov","description":"Shows FPS, CPU and memory usage, device model, app and iOS versions above the status bar and report FPS, CPU and memory usage via delegate.","archived":false,"fork":false,"pushed_at":"2021-08-17T04:05:56.000Z","size":1341,"stargazers_count":2250,"open_issues_count":5,"forks_count":157,"subscribers_count":40,"default_branch":"master","last_synced_at":"2024-04-24T19:26:14.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dani-gavrilov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["dani-gavrilov"]}},"created_at":"2017-01-04T16:41:28.000Z","updated_at":"2024-04-21T22:02:21.000Z","dependencies_parsed_at":"2022-07-12T01:31:14.883Z","dependency_job_id":null,"html_url":"https://github.com/dani-gavrilov/GDPerformanceView-Swift","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dani-gavrilov%2FGDPerformanceView-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dani-gavrilov%2FGDPerformanceView-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dani-gavrilov%2FGDPerformanceView-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dani-gavrilov%2FGDPerformanceView-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dani-gavrilov","download_url":"https://codeload.github.com/dani-gavrilov/GDPerformanceView-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228548567,"owners_count":17935221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:33.482Z","updated_at":"2024-12-07T01:30:38.629Z","avatar_url":"https://github.com/dani-gavrilov.png","language":"Swift","funding_links":["https://github.com/sponsors/dani-gavrilov","https://www.patreon.com/dani_gavrilov"],"categories":["Tools","WebSocket","Swift"],"sub_categories":["Web View","Other free courses"],"readme":"# GDPerformanceView-Swift\nShows FPS, CPU and memory usage, device model, app and iOS versions above the status bar and report FPS, CPU and memory usage via delegate.\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage) \n[![Pod Version](https://img.shields.io/badge/Pod-2.1.1-6193DF.svg)](https://cocoapods.org/)\n![Swift Version](https://img.shields.io/badge/xCode-12.0+-blue.svg)\n![Swift Version](https://img.shields.io/badge/iOS-9.0+-blue.svg) \n![Swift Version](https://img.shields.io/badge/Swift-5.0+-orange.svg)\n![Plaform](https://img.shields.io/badge/Platform-iOS-lightgrey.svg)\n![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg) \n\n![Alt text](https://github.com/dani-gavrilov/GDPerformanceView-Swift/blob/master/performance_view.PNG?raw=true \"Example PNG\")\n![Alt text](https://github.com/dani-gavrilov/GDPerformanceView-Swift/blob/master/performance_view_2.PNG?raw=true \"Example PNG\")\n![Alt text](https://github.com/dani-gavrilov/GDPerformanceView-Swift/blob/master/performance_view_3.PNG?raw=true \"Example PNG\")\n![Alt text](https://github.com/dani-gavrilov/GDPerformanceView-Swift/blob/master/performance_view_4.PNG?raw=true \"Example PNG\")\n\n## Installation\nSimply add GDPerformanceMonitoring folder with files to your project, or use CocoaPods.\n\n#### Carthage\nCreate a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add `$(SRCROOT)/Carthage/Build/iOS/GDPerformanceView.framework` to an iOS project.\n\n```ruby\ngithub \"dani-gavrilov/GDPerformanceView-Swift\" ~\u003e 2.1.1\n```\nDon't forget to import GDPerformanceView by adding: \n\n```swift\nimport GDPerformanceView\n```\n\n#### CocoaPods\nYou can use [CocoaPods](http://cocoapods.org/) to install `GDPerformanceView` by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget 'project_name' do\n\tpod 'GDPerformanceView-Swift', '~\u003e 2.1.1'\nend\n```\nDon't forget to import GDPerformanceView by adding: \n\n```swift\nimport GDPerformanceView_Swift\n```\n\n## Usage example\n\nSimply start monitoring. Performance view will be added above the status bar automatically.\nAlso, you can configure appearance as you like or just hide the monitoring view and use its delegate.\n\nYou can find example projects [here](https://github.com/dani-gavrilov/GDPerformanceViewExamples).\n\n#### Start monitoring\n\nBy default, monitoring is paused. Call the following command to start or resume monitoring:\n\n```swift\nPerformanceMonitor.shared().start()\n```\nor\n\n```swift\nself.performanceView = PerformanceMonitor()\nself.performanceView?. start()\n```\nThis won't show the monitoring view if it was hidden previously. To show it call the following command:\n\n```swift\nself.performanceView?.show()\n```\n\n#### Pause monitoring\n\nCall the following command to pause monitoring:\n\n```swift\nself.performanceView?.pause()\n```\n\nThis won't hide the monitoring view. To hide it call the following command:\n\n```swift\nself.performanceView?.hide()\n```\n\n#### Displayed information\n\nYou can change displayed information by changing options of the performance monitor:\n\n```swift\nself.performanceView?.performanceViewConfigurator.options = .all\n```\nYou can choose from:\n\n* performance - CPU usage and FPS.\n* memory - Memory usage.\n* application - Application version with build number.\n* device - Device model.\n* system - System name with version.\n\nAlso you can mix them, but order doesn't matter:\n\n```swift\nself.performanceView?.performanceViewConfigurator.options = [.performance, .application, .system]\n```\nBy default, set of [.performance, .application, .system] options is used.\n\nYou can also add your custom information by using:\n\n```swift\nself.performanceView?.performanceViewConfigurator.userInfo = .custom(string: \"Launch date \\(Date())\")\n```\nKeep in mind that custom string will not automatically fit the screen, use `\\n` if it is too long.\n\n#### Appearance\n\nYou can change monitoring view appearance by changing style of the performance monitor:\n\nCall the following command to change output information:\n\n```swift\nself.performanceView?.performanceViewConfigurator.style = .dark\n```\n\nYou can choose from:\n\n* dark - Black background, white text.\n* light - White background, black text.\n* custom - You can set background color, border color, border width, corner radius, text color and font.\n\nBy default, dark style is used.\n\nAlso you can override prefersStatusBarHidden and preferredStatusBarStyle to match your expectations:\n\n```swift\nself.performanceView?.statusBarConfigurator.statusBarHidden = false\nself.performanceView?.statusBarConfigurator.statusBarStyle = .lightContent\n```\n\n#### Interactions\n\nYou can interact with performance view via gesture recognizers. Add them by using:\n\n```swift\nself.performanceView?.performanceViewConfigurator.interactors = [tapGesture, swipeGesture]\n```\nIf interactors is nil or empty `point(inside:with:)` of the view will return false to make all touches pass underneath. So to remove interactors just call the following command:\n\n```swift\nself.performanceView?.performanceViewConfigurator.interactors = nil\n```\nBy default, interactors are nil.\n\n#### Delegate\n\nSet the delegate and implement its method:\n\n```swift\nself.performanceView?.delegate = self\n```\n\n```swift\nfunc performanceMonitor(didReport performanceReport: PerformanceReport) {\n\tprint(performanceReport.cpuUsage, performanceReport.fps, performanceReport.memoryUsage.used, performanceReport.memoryUsage.total)\n}\n```\n\n## Requirements\n- iOS 9.0+\n- xCode 12.0+\n\n## Donations\n\nWanna say thanks? You can do it using [Patreon](https://www.patreon.com/dani_gavrilov).\n\n## Meta\n\nDaniil Gavrilov - [VK](https://vk.com/dani_gavrilov) - [FB](https://facebook.com/danigavrilov)\n\nI will be pleased to know that your project uses this framework. You can send a link to your project in App Store to my email - [daniilmbox@gmail.com](mailto:daniilmbox@gmail.com).\n\n## License\n\nGDPerformanceView is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdani-gavrilov%2FGDPerformanceView-Swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdani-gavrilov%2FGDPerformanceView-Swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdani-gavrilov%2FGDPerformanceView-Swift/lists"}