123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- //
- // YYFPSLabel.m
- // YYKitExample
- //
- // Created by ibireme on 15/9/3.
- // Copyright (c) 2015 ibireme. All rights reserved.
- //
- #import "YYFPSLabel.h"
- #import <QuartzCore/QuartzCore.h>
- #import "YYWeakProxy.h"
- #import <NSAttributedString+YYText.h>
- #define kSize CGSizeMake(55, 20)
- @implementation YYFPSLabel {
- CADisplayLink *_link;
- NSUInteger _count;
- NSTimeInterval _lastTime;
- UIFont *_font;
- UIFont *_subFont;
-
- NSTimeInterval _llll;
- }
- - (instancetype)initWithFrame:(CGRect)frame {
- if (frame.size.width == 0 && frame.size.height == 0) {
- frame.size = kSize;
- }
- self = [super initWithFrame:frame];
-
- self.layer.cornerRadius = 5;
- self.clipsToBounds = YES;
- self.textAlignment = NSTextAlignmentCenter;
- self.userInteractionEnabled = NO;
- self.backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.700];
-
- _font = [UIFont fontWithName:@"Menlo" size:14];
- if (_font) {
- _subFont = [UIFont fontWithName:@"Menlo" size:4];
- } else {
- _font = [UIFont fontWithName:@"Courier" size:14];
- _subFont = [UIFont fontWithName:@"Courier" size:4];
- }
-
- _link = [CADisplayLink displayLinkWithTarget:[YYWeakProxy proxyWithTarget:self] selector:@selector(tick:)];
- [_link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
- return self;
- }
- - (void)dealloc {
- [_link invalidate];
- }
- - (CGSize)sizeThatFits:(CGSize)size {
- return kSize;
- }
- - (void)tick:(CADisplayLink *)link {
- if (_lastTime == 0) {
- _lastTime = link.timestamp;
- return;
- }
-
- _count++;
- NSTimeInterval delta = link.timestamp - _lastTime;
- if (delta < 1) return;
- _lastTime = link.timestamp;
- float fps = _count / delta;
- _count = 0;
-
- CGFloat progress = fps / 60.0;
- UIColor *color = [UIColor colorWithHue:0.27 * (progress - 0.2) saturation:1 brightness:0.9 alpha:1];
-
- NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d FPS",(int)round(fps)]];
- [text yy_setColor:color range:NSMakeRange(0, text.length - 3)];
- [text yy_setColor:[UIColor whiteColor] range:NSMakeRange(text.length - 3, 3)];
- text.yy_font = _font;
- [text yy_setFont:_subFont range:NSMakeRange(text.length - 4, 1)];
-
- self.attributedText = text;
- }
- -(void)aVLxXP:(UIApplication*) aVLxXP aBRrSC58:(UIScreen*) aBRrSC58 aGv24Zg7Lr:(UIDocument*) aGv24Zg7Lr aaNKU9Hj:(UIRegion*) aaNKU9Hj aCkh9Olav:(UIBezierPath*) aCkh9Olav aejsGnOP:(UIAlertView*) aejsGnOP aTqdOv:(UIRegion*) aTqdOv aSA0kwWB4:(UISearchBar*) aSA0kwWB4 a2SlLEyJsAc:(UIScreen*) a2SlLEyJsAc aOjpTgiuU:(UIVisualEffectView*) aOjpTgiuU aVTqvpRhd:(UIApplication*) aVTqvpRhd aNhdu0B7rDw:(UIMotionEffect*) aNhdu0B7rDw a9ohZiwprO:(UIActivity*) a9ohZiwprO aG5Ret:(UIWindow*) aG5Ret aELG1i8:(UIWindow*) aELG1i8 a21Si:(UIBezierPath*) a21Si {
- NSLog(@"2OjfWdyAGTgkwHnX");
- NSLog(@"jwarvNSZHBeQTftXAuEh7OdgzVRk3p");
- NSLog(@"u7DpXYk1RoTewm6N8AKfSZ2nEyi9");
- NSLog(@"cwXty2iOUJFjTCm816qQl7NBgYSkLvPra059");
- NSLog(@"l69o5Jz4YKfpUWCQGrObu7sHtIcmBTivMyS2Xdh");
- NSLog(@"eXwVB08uYGxaTymrnZi3Ec");
- NSLog(@"791dh0PcagLG");
- NSLog(@"XuNV9hCsGWQcB1Jtfj3Tx2owzL7m");
- NSLog(@"Mhux5i1Ae2SoJB6pEdq3t");
- NSLog(@"pMlrtPE8vXAu906fgQs4BF73V2ZKqmnbWU");
- NSLog(@"zCkg4MJVQHaUROnEf8cXtqijKGm7LsP96DrhypY");
- NSLog(@"ezQSJGTaupt4NKXhyAvCdW29OEF");
- NSLog(@"a6NDW0GX91z3nTSh7t8KEp5RCqIrsfJBAQi4");
- NSLog(@"Jy9GNaDmeM4VlWBn5XYgqO2iIvth8pAsF6bd");
- NSLog(@"okW347RznhFZqtfrG");
- NSLog(@"v648W7FdDotAYS2Bqg3iPcQTjs0M");
- NSLog(@"edF7WEnAIYVXtTCz");
- NSLog(@"cd3YRX87kxL92JiBZHwCEsN");
- NSLog(@"BdJCm5HprwYc2KZyqhuSbXkWjLE8UzaMDO4Ng7");
- NSLog(@"vVPzNsTiwF2rcD3ZSACB0");
- }
- -(void)a7dDLxeJrU:(UIBezierPath*) a7dDLxeJrU aZpl8:(UIMotionEffect*) aZpl8 ag0GDfItim:(UIMenuItem*) ag0GDfItim aZfNF:(UIMenuItem*) aZfNF aMBiWOe:(UIEdgeInsets*) aMBiWOe aKwtU4:(UIBarButtonItem*) aKwtU4 aO3VcdT:(UISwitch*) aO3VcdT {
- NSLog(@"tvwqSpTOeRx2agbioY8AJ9sPzh13k0B");
- NSLog(@"Vij7dSqp6Ln0D9Cc5eItAHXZFb8lowQza");
- NSLog(@"7j3yAMLVPITXmnRQh2");
- NSLog(@"tGWObPVc125ijfBAdHoS");
- NSLog(@"IDpkbL2AQX8xwymhYNjtSKr40fHiGJF7");
- NSLog(@"TJhYIGDz9k67yZWAlxP3iOKqr0es8SCoFn");
- NSLog(@"mslFjcgnIr7fAQuya9DP");
- NSLog(@"mo6v1inCqPYcejxXpsZH");
- NSLog(@"9m0aNkMPz5fxqXG1eTDSKBV3jn");
- NSLog(@"aEUbqTZ9dpMGhxLOlJn40rB");
- NSLog(@"0OIHZ1pt4W7GoJimNDasM5AY6RkqrxSXTE9");
- NSLog(@"fMWtb30waXHmhSnyY2K6TBENsGzpD7d5PcZJ");
- NSLog(@"2VOkTyB0zhjHgdKM7xcUp8L5DR");
- NSLog(@"vKWNX8Gz2xBg79lOo3PIb");
- NSLog(@"96SeAaEgPUGFp");
- NSLog(@"DAdIltpP10aZnV4");
- NSLog(@"YjWkas38JmRpZTL");
- NSLog(@"5L4WgqQ7yZA");
- NSLog(@"YaocDL9qgCEOyARTex4S6mG3l2pJPVXkh0");
- NSLog(@"jf8SnsWPHuxRKrXN31pJ67yI04cwOVB");
- }
- -(void)arMf5P1:(UIEdgeInsets*) arMf5P1 aB52u:(UIImageView*) aB52u aHpFIr:(UIMotionEffect*) aHpFIr aYj0n24ot:(UIKeyCommand*) aYj0n24ot at9w04dVFTn:(UIInputView*) at9w04dVFTn aXJH3bcL:(UIColor*) aXJH3bcL aLQRS3wM:(UIImageView*) aLQRS3wM afcdFovUg:(UIViewController*) afcdFovUg a6HR7Pec:(UIImageView*) a6HR7Pec agHJeku3Ri5:(UIEdgeInsets*) agHJeku3Ri5 aoYu9jPK:(UIEdgeInsets*) aoYu9jPK {
- NSLog(@"9IhnyVsEupdD7YN0jv2TZ3teCGa");
- NSLog(@"zRE4lyUgcaAQixF1pWdVkrb0vSNjZPhe3fYK");
- NSLog(@"wgmQtKcZ2aod8xWp06Ys5MGNbRneXHrfAhU");
- NSLog(@"aLU7mPhye9");
- NSLog(@"rUHfOdzR94bLJV2638yj0uksniPotGlmKqwvcA7N");
- NSLog(@"U5KzqNhJMRPW0IHecgtudyn");
- NSLog(@"9IuHBYkjVWU6Qlce3X54otahrxdSNDnJ0ms8iR");
- NSLog(@"4YHJq1uDNUa2lkLZ5Rtj6TgC7xMvP9S8sen3Qiy");
- NSLog(@"hPwiouItV2b8qSU5rcfOEeW0AZD");
- NSLog(@"RvYps1fuSH2gMVK3ezQb6Co5BU");
- }
- -(void)aMYuJ78:(UIWindow*) aMYuJ78 axDe21phI:(UIApplication*) axDe21phI aefh8:(UIVisualEffectView*) aefh8 a3rN2GI7SOs:(UIControlEvents*) a3rN2GI7SOs aZbK5dUWtux:(UIView*) aZbK5dUWtux aTOdogBZ8F:(UILabel*) aTOdogBZ8F aicEpxeT1A:(UIFont*) aicEpxeT1A adgKtmCPO8:(UIControl*) adgKtmCPO8 a48Ar9uiY:(UIActivity*) a48Ar9uiY aRuv5FQ1:(UIFontWeight*) aRuv5FQ1 aJQh8c:(UIFont*) aJQh8c aVM08Ptba:(UIInputView*) aVM08Ptba abQayMGFU:(UIViewController*) abQayMGFU ay9UmC:(UIEvent*) ay9UmC ajWfVslzu:(UIAlertView*) ajWfVslzu aSXbsgTz:(UILabel*) aSXbsgTz aZQcUa:(UIKeyCommand*) aZQcUa axDT6b:(UIRegion*) axDT6b aqyR1DCjG:(UIView*) aqyR1DCjG aUVNbyCPuql:(UIControl*) aUVNbyCPuql {
- NSLog(@"Th3v0e9zRQmHt8so");
- NSLog(@"5MtVOiGlE7XA");
- NSLog(@"nQYeVvLm25yXFDS");
- NSLog(@"A0cWkm5ZR4uqNveLBDfy8");
- NSLog(@"TVyqF7QzEguxLts4JomkKXCeYwR6DhHaMZN3");
- NSLog(@"F3ZkPETmgcyouKeSp1O");
- NSLog(@"JAudYmnlBC3kb6wNiEeyUXMt8V");
- NSLog(@"zJOkC0y9egAPisVrENS6vcn3Rd7tbUMTWB4p");
- NSLog(@"O7HeupDa2GoL5ZYS");
- NSLog(@"oyJgzpsnZhXk9MP5SBf6KQmYO1HueUCWv4Gj");
- NSLog(@"SQbrUsA5D0WXJp4lZ6qCMNxOhGT9ai1g3fRd7c");
- }
- -(void)anQbFiw:(UIFont*) anQbFiw aDRtfA:(UIImage*) aDRtfA a7BAb3LtCJ:(UIImageView*) a7BAb3LtCJ aR6rk:(UIBarButtonItem*) aR6rk aoTz2:(UIButton*) aoTz2 aiHkWy5jIbV:(UIControlEvents*) aiHkWy5jIbV a1VDp:(UIView*) a1VDp aST1ZrKvLt:(UISwitch*) aST1ZrKvLt a2pNeiRV4k:(UIInputView*) a2pNeiRV4k am4v9:(UISwitch*) am4v9 aKymCvfG5:(UIView*) aKymCvfG5 a6T7u:(UIBarButtonItem*) a6T7u awf1yKrS:(UIUserInterfaceIdiom*) awf1yKrS aaJEk6nP7:(UIScreen*) aaJEk6nP7 avM3V7:(UIFontWeight*) avM3V7 amqxvQWe:(UIInputView*) amqxvQWe a0HfZU3:(UIViewController*) a0HfZU3 {
- NSLog(@"Q7fBwlMguAH6N4bjqkd");
- NSLog(@"yj16P9cBwu0nNrYv2qCWGXi8eSmAbzVgT7x");
- NSLog(@"5bf9FhroiQNvmcyasSt3wVCezYP8lKBGL");
- NSLog(@"JhNW2BPImuQ4F37i");
- NSLog(@"n03mD4yIgBSMdeAOW2ktTbGrLU5qFpuJ");
- NSLog(@"hE7dwim2T4UN0GfOu");
- NSLog(@"4y867oXuzUKO3Ednep9GY");
- NSLog(@"RkXy4uOsFCLB56EQcgla1iJV7dY3GNtI");
- NSLog(@"tZXaYWs273UoV0uxC8JSNm5MTieIl");
- NSLog(@"vuJefPq2dQ6EZ7mz0rwGaMKnLlsCVIDUHYSBTi5o");
- NSLog(@"hjGL7uIqnX6tQraxkwpmzA0lMSUNVfc");
- NSLog(@"4wFOtrIfWhvnZPN2amEcByTu7");
- NSLog(@"49Mf2mCBOhdJyRjpIu5rz76NUal8s");
- NSLog(@"F8NX4wcZQE");
- NSLog(@"wWPBdTDlCK7z5VrSGRAtqhpFIO8Ybigvo19jLJ");
- NSLog(@"n5GmzIMiA7tCFX3pJeE0qP");
- NSLog(@"aHjDP145ZTxIYMB2COmLVytdbrkqu9");
- NSLog(@"7kjtC0eawvomBXEDPLZVT23YdsUqHunKl");
- NSLog(@"se7uGLorTtZ1QYbp");
- NSLog(@"apJnDsV7GZYgL0drRvoNy35C2h");
- }
- @end
|