UI component representing a set of metrics for analyzing the performance of your application.
- Platform: iOS 13 or later
- Swift version: Swift 5.x or later
To include MetricsView into a Swift Package Manager package, add it to the dependencies attribute defined in your Package.swift file. You can select the version using the majorVersion and minor parameters. For example:
dependencies: [
.Package(url: "https://github.com/uxn0w/MetricsView.git", majorVersion: <majorVersion>, minor: <minor>)
]When configure this way, the metric view will always be on top of the other views.
- Go to SceneDelegate/scene(_ scene:, willConnectTo session:, options connectionOptions:)
- Create MetricsWindow
let metricsWindow = MetricsWindow(windowScene: windowScene)- Set metrics
metricsWindow.metrics = [.cpu, .fps, .hitches, .memory]- Set window
- Create MetricsView
let metricsView = MetricsView()- Set metrics
metricsView.metrics = [.cpu, .fps, .hitches, .memory]- Add metrics view to your subview
