Name: KMCGeigerCounter
Owner: Medium
Description: A framerate meter that clicks like a Geiger counter when your animation drops a frame
Forked from: kconner/KMCGeigerCounter
Created: 2016-08-22 21:17:00.0
Updated: 2016-11-03 01:09:35.0
Pushed: 2016-04-13 07:23:13.0
Size: 846
Language: Objective-C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
KMCGeigerCounter is a framerate meter that clicks like a Geiger counter when your animation drops a frame.
A Geiger counter detects invisible radiation particles and alerts you to what you can't see. Dropped frames aren't invisible, but it can be hard to tell the difference between 55 and 60 fps. KMCGeigerCounter makes those five dropped frames obvious.
The onscreen framerate meter shows two numbers:
The meter is orange when you've dropped at least three frames in the past second.
pod 'KMCGeigerCounter'
Or copy these files into your project:
If you're not using CocoaPods, you may need to add these frameworks to your Link Binary With Libraries build phase:
In your UIApplicationDelegate
, enable the tool:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ?
[self.window makeKeyAndVisible];
[KMCGeigerCounter sharedGeigerCounter].enabled = YES;
}
Then, build and run your app. Navigate through your app and listen for clicks.
If you use view controller based status bar style, your -preferredStatusBarStyle
will be ignored, because UIKit asks the meter window for that instead of your main window. I could avoid this by giving the meter window a root view controller, but then that would affect navigation bar height. I'd appreciate any ideas about this.
Maybe. If the meter view causes frames to drop, the app's performance was probably toeing the line too closely in the first place.
Remember to turn off Silent mode, or you won't hear anything.
You should remove KMCGeigerCounter before shipping to the App Store. It can't be good for battery life.
The iOS Simulator doesn't simulate device performance, so consider enabling the tool only for device builds:
#if !TARGET_IPHONE_SIMULATOR
[KMCGeigerCounter sharedGeigerCounter].enabled = YES;
#endif