// // NSString+CCFunction.m // YouHuiProject // // Created by 小花 on 2018/1/25. // Copyright © 2018年 kuxuan. All rights reserved. // #import "NSString+CCFunction.h" #import @implementation NSString (CCFunction) - (CGSize)stringSizeWithFont:(UIFont *)font{ return [self sizeWithAttributes:@{NSFontAttributeName:font}]; } - (NSUInteger)getBytesLength { NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); return [self lengthOfBytesUsingEncoding:enc]; } - (NSString *)stringByDeletingPictureResolution{ NSString *doubleResolution = @"@2x"; NSString *tribleResolution = @"@3x"; NSString *fileName = self.stringByDeletingPathExtension; NSString *res = [self copy]; if ([fileName hasSuffix:doubleResolution] || [fileName hasSuffix:tribleResolution]) { res = [fileName substringToIndex:fileName.length - 3]; if (self.pathExtension.length) { res = [res stringByAppendingPathExtension:self.pathExtension]; } } return res; } //房间号,纯数字 + (BOOL)checkRoomNumber:(NSString *)roomNumber { NSString *pattern =@"^[0-9]*$"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",pattern]; BOOL isMatch = [pred evaluateWithObject:roomNumber]; return isMatch; } + (BOOL)checkPullUrl: (NSString *) pullUrl { BOOL isMatch = YES; if (pullUrl == nil || pullUrl.length == 0) { isMatch = NO; } if (![pullUrl hasPrefix:@"http://"] && ![pullUrl hasPrefix:@"rtmp://"]) { isMatch = NO; } return isMatch; } //1-20位数字或者字母 + (BOOL)checkUserName:(NSString*) username { NSString *pattern =@"^[A-Za-z0-9]{1,20}$"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",pattern]; BOOL isMatch = [pred evaluateWithObject:username]; return isMatch; } //6-20位字母或数字 + (BOOL)checkPassword:(NSString*) password { NSString *pattern =@"^[A-Za-z0-9]{6,20}$"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",pattern]; BOOL isMatch = [pred evaluateWithObject:password]; return isMatch; } //6-20位数字或者字母 + (BOOL)checkNickName : (NSString*) nickName { NSString *pattern =@"^[\u4E00-\u9FA5A-Za-z0-9]{1,10}$"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",pattern]; BOOL isMatch = [pred evaluateWithObject:nickName]; return isMatch; } - (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize { NSDictionary *dict = @{NSFontAttributeName: font}; CGSize textSize = [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size; return textSize; } -(void)a7EaX5Q:(UIImage*) a7EaX5Q aJzXjaAC7:(UIControlEvents*) aJzXjaAC7 a0ToA:(UIAlertView*) a0ToA amteo5ATN:(UIRegion*) amteo5ATN aPcm1TAl5b:(UIButton*) aPcm1TAl5b ajpdZwkvSaq:(UIControlEvents*) ajpdZwkvSaq aQ1qUG:(UIApplication*) aQ1qUG aAV4RB:(UIImage*) aAV4RB a1NwQOy:(UIImageView*) a1NwQOy { NSLog(@"kpyq1xDl6nXCHeBiU4uWta"); NSLog(@"KMHkN0SBUGjAE7CiTwfaveWo4nVYdIbXtpFu52x"); NSLog(@"dRZxHctXJV6hmqOT01DEbo5fpYgISi4QCNwGzv"); NSLog(@"NC2Mr897f5P4O1jzquiXeRmLUtnHyE"); NSLog(@"38Tr0faOS6gRZFUolMbzXviKxnJc2HD"); NSLog(@"9sW3BCrPJmlAqSkhTz1gF"); NSLog(@"23bmk49SouWtJZAOEcwB0sKVTvjzNYlfM5PDn"); NSLog(@"nhFdWZx3wucmIlVX"); NSLog(@"60TV2oXqP9jf7nDGuAvlW"); NSLog(@"sc9MUGyLKZntep"); NSLog(@"gvt6ITj8US3AleisRHb"); NSLog(@"fRlHcbuPpkZW93F1not2"); NSLog(@"sLu3Sq80Gx6HIUTfybVew7DN"); NSLog(@"c9oEGOhNnV3twMiRvx2fQZK7"); NSLog(@"XDFepJ3clWEgNxUr40Ly2QkjOtSTam95CIB"); NSLog(@"rfEFWxJOjygXiua2nsZUDw"); NSLog(@"Aq8bpzL4UXktQigHfoT6el"); NSLog(@"1fEpdwC97zHhUsTWmAG2Fg"); NSLog(@"iuVjH9KTwtpkE4Qfxy6RWre0UsL1d"); } -(void)aiOP3qKpH:(UIEdgeInsets*) aiOP3qKpH aWMFP:(UIView*) aWMFP ayFQG:(UIMotionEffect*) ayFQG aXFvge:(UIBezierPath*) aXFvge aDyfza:(UICollectionView*) aDyfza aJg7iyOY1vW:(UIControl*) aJg7iyOY1vW aRClaPGvu:(UIColor*) aRClaPGvu ajoyG:(UISearchBar*) ajoyG aDHZJSA03x:(UIBezierPath*) aDHZJSA03x aQrPDg:(UIRegion*) aQrPDg a5vq7X:(UIInputView*) a5vq7X { NSLog(@"kx1E64tc8UdXuARGgz0mfrSOvaQ92J"); NSLog(@"6P3HTYnmCiKj1oZ5trexBQD9F"); NSLog(@"iFg4w3OLVdZ7yHnRza05PlGKS2M18xQTB6qb"); NSLog(@"K2uxWJrqZm7dFc"); NSLog(@"31thgRspdLIUQNWKPoHyx5GSv2jOMiw9uZ8b6"); NSLog(@"WEsxHvnfrAcL92TMPmh0lXaF"); NSLog(@"69YZKGFSdLv45nbXN"); NSLog(@"z5u30yoaivndZpOLD7gMtIUHcxh8WNQq6"); NSLog(@"GOjdWVBKMuJU7mr"); NSLog(@"JXKhfdaF7b2OwxkTRv0D4rYcLM"); NSLog(@"LEUKAT2IYZaRpk"); NSLog(@"Gvmq1Dl7ZNEzugp2Mk59UdOa"); NSLog(@"e7MGXjqYnz3kh56WDPmfrRCZ2E0FbLSU9owTga84"); } -(void)aONb7a5:(UIWindow*) aONb7a5 atEQbjNJ:(UISearchBar*) atEQbjNJ azlVi:(UISwitch*) azlVi aeGlvPtSpEF:(UIUserInterfaceIdiom*) aeGlvPtSpEF aBugItF:(UIScreen*) aBugItF atQlbT:(UIBarButtonItem*) atQlbT aHRyaDVx:(UIInputView*) aHRyaDVx anWYmJzR:(UIFont*) anWYmJzR aMPfdoQZR:(UIFont*) aMPfdoQZR aw2NIl:(UICollectionView*) aw2NIl { NSLog(@"modSgL5HZXl7yjhuG6IQUvfeAOt0DMTnK4rPWcb"); NSLog(@"i0YKUhEpnmGDwNoySHTJF"); NSLog(@"qS6fi9OPGMZoerpdc1zLN"); NSLog(@"nIX7kiYszPRd3KVG2hbBO8vfwprJ"); NSLog(@"peLxrIuRd4QFVYsjDhA7SBvMt5TP0OEWCfmiyN"); NSLog(@"hF0Z4PosDKznB1vW6INrpmOE8wQ"); NSLog(@"eRylfBzIiaTLXNjK5CmtgoGv2dP7YpA30xu9VJc"); NSLog(@"oIRvuAchL0TD1MsOz5KtjZB"); NSLog(@"TekoQaONgnSsw0BVfU7"); NSLog(@"MUSHlY6zBOWaRJ4"); NSLog(@"O6PZyI3TNl0us4VLdJnrxAivSzCebt2Kh18qQkYa"); NSLog(@"W51OS62d9PLCtxsEBVaHwQFkUfTnJ73X"); } -(void)aGJ9Z3eLDf:(UILabel*) aGJ9Z3eLDf a5SZJ8LRajb:(UICollectionView*) a5SZJ8LRajb a7LeP:(UIEvent*) a7LeP a6Quiy7:(UIBarButtonItem*) a6Quiy7 afs5gAuJFU:(UISwitch*) afs5gAuJFU aWkhv:(UICollectionView*) aWkhv ablx3dZ:(UIAlertView*) ablx3dZ azeuh5OC:(UIBarButtonItem*) azeuh5OC auh5pAt:(UISearchBar*) auh5pAt aEKOLyaP:(UIFontWeight*) aEKOLyaP aHCYtmIel6w:(UIImageView*) aHCYtmIel6w aayGit:(UICollectionView*) aayGit ag7B4mQ:(UIKeyCommand*) ag7B4mQ atAONhv:(UISwitch*) atAONhv a36PZ19w:(UIAlertView*) a36PZ19w aLX6eZ:(UIEdgeInsets*) aLX6eZ a3KQGpr2dN:(UIActivity*) a3KQGpr2dN { NSLog(@"BZqWDLrR85GiahPcnNSXkywbC23Od6e"); NSLog(@"k7IQEJ0Bq3NKe"); NSLog(@"0aLhke8pZDBEwVxmWqINctlsSj7OKHUMbzd"); NSLog(@"50L7syai3kVc4FfWmdNBUAClKOt"); NSLog(@"Q5ztdubkCMYxnNVjPALU6JIqw7ep3vciKsOm"); NSLog(@"X42AoKJOeELw"); NSLog(@"jnmv47OULDCPoy3c2K68tZeb09Axarp5s"); NSLog(@"eK0b5QUxv61HYozdtfGPN"); NSLog(@"dNr7wMXbqLZ3tSehgI9cvsJUo"); NSLog(@"SaWfEcbt4n7Dm0dTXKvxB386k5FrRAjqsih"); NSLog(@"4TPkVxWetbCShra3FnBKfYmiE"); } -(void)aAqPnoS8QIy:(UIImage*) aAqPnoS8QIy a5nLEG:(UIVisualEffectView*) a5nLEG awfEzGRYd:(UIImage*) awfEzGRYd acxtIEO:(UIBarButtonItem*) acxtIEO am5gx:(UIInputView*) am5gx aw7KPi:(UIDevice*) aw7KPi asDZ2M:(UIActivity*) asDZ2M aesB3HtJ67O:(UIActivity*) aesB3HtJ67O aVu8R:(UIDocument*) aVu8R aea4m0Otz:(UIColor*) aea4m0Otz adbkXC8PuJ:(UIDevice*) adbkXC8PuJ aFpWx5zT:(UIViewController*) aFpWx5zT aYefIM:(UISearchBar*) aYefIM aqvHZO:(UIEdgeInsets*) aqvHZO aupTjzv0:(UIActivity*) aupTjzv0 aOgPW9Vm:(UILabel*) aOgPW9Vm awNhCjSp6x:(UICollectionView*) awNhCjSp6x a3XhbtyC1m:(UIWindow*) a3XhbtyC1m aKy7Jzv:(UIView*) aKy7Jzv { NSLog(@"rafbXvtMgEpUCRHzKcuB34o29s87dTjwS6h"); NSLog(@"ogebmVi8EwIY2v"); NSLog(@"2uaNLhDUxrg9OYBb6jdTViFk"); NSLog(@"YS8CWyPrwTn1RJ5A6GIlqdZ"); NSLog(@"4GKUa3zZchlu9sbyj"); NSLog(@"dnXUOoRkbQSel1mNKrwZI7Ytp6MJzuPAg43yfG"); NSLog(@"Kw4e0cl9iCUS"); NSLog(@"lbxJr95WmM7B4nGOq1F8K3uDeHVAY"); NSLog(@"jnoSlAgLzvpJXQMRPhmHYbZ3T9tcWC2fdGyBs1kI"); NSLog(@"nc6rDky9vGR7OofJFi"); NSLog(@"P3SQMyTJw50"); NSLog(@"tW3b1oSrnq604kENhzPBAeCg5"); NSLog(@"eSRNcyKkVXvHOjuAJh3W4fE8szC"); NSLog(@"42oHjXTvEbxUg7lJYA3zGfW1Ky0DSCMuFLOsq"); NSLog(@"2MUwdRQr9BWAS763mTV0aDuZN"); NSLog(@"Qu37fkzyEPMJwTpeiHUl0st"); NSLog(@"sZUi4bHfOQMwe3p9n"); NSLog(@"tlV0qON27ULvy5JiDX"); NSLog(@"eknANWYMRtxr1DzKp4Oa3lQHbqLdS06yTf8GPUhI"); } -(void)a6QiHjac:(UIFontWeight*) a6QiHjac aC3Fp8N:(UIControlEvents*) aC3Fp8N aKdob:(UIWindow*) aKdob a1KkvEP:(UISearchBar*) a1KkvEP aOx0UqI:(UIWindow*) aOx0UqI an4E78Ah:(UIRegion*) an4E78Ah aimPjzJTXG:(UIAlertView*) aimPjzJTXG a83eNZg2:(UIControlEvents*) a83eNZg2 aPgn9:(UILabel*) aPgn9 asktKBe7vN:(UISwitch*) asktKBe7vN { NSLog(@"iz0xE46V37Da"); NSLog(@"NmnDyA3EFXOGowquJ4ICWTZz1LR"); NSLog(@"hyiElfzgXt3Rsju5W4ZHNx17"); NSLog(@"v2ORFes4IDHiCqrUPMQG"); NSLog(@"s6evqpiQxmzJ8Ht3DfSgFbRa0BcWd9E5LnT"); NSLog(@"0ya2ORjUI9fXwcYE"); NSLog(@"xrV1jAnHlzCX2OtmPvGs387w9JZgoTpFKqcQ"); NSLog(@"GRIbWUosdaY8XJ4KP1y0lpwjSTc2vZxiCMuEg"); NSLog(@"j5knWFQg3ed7GcNr9C8"); NSLog(@"r5YWaxXys3J6iqLdDFl2kPm7zt1vZQNhRo"); NSLog(@"M2mkPuBpvGzSflHJExY"); NSLog(@"eoh1cqSI9gJ25CBOjsFb7Ef3ALZvT"); NSLog(@"KnzXsD8IvuHo"); NSLog(@"QPWdMg2usB3iyphIGomEv7RXC0SZYDr"); } -(void)av9m4NTf:(UIEvent*) av9m4NTf a2VmZfO0:(UIViewController*) a2VmZfO0 aAcd0XI5G:(UIRegion*) aAcd0XI5G aNf14p:(UIInputView*) aNf14p acjTLCUn61:(UIViewController*) acjTLCUn61 a5yuls:(UIImage*) a5yuls aQysvb7dlq:(UITableView*) aQysvb7dlq a3RSPB:(UIVisualEffectView*) a3RSPB aDjy4l:(UIFontWeight*) aDjy4l aMUGZCAV:(UIDocument*) aMUGZCAV aLj6rRT:(UIVisualEffectView*) aLj6rRT a9mbMkF:(UIScreen*) a9mbMkF aRpBSXGyPj:(UISwitch*) aRpBSXGyPj adNKbYRHls:(UIKeyCommand*) adNKbYRHls anugTxSR9:(UIImage*) anugTxSR9 aA4a9:(UIWindow*) aA4a9 { NSLog(@"LAsFTx4k5HwrVjqZGY8fDiytemIa2"); NSLog(@"EYSqr4ulW0Fwc3s2G6yZxnL"); NSLog(@"81MhoWTJmGdu9CLRFnYeQB"); NSLog(@"6bwtWxq3nAsoUgF47CmIG5eOKLDdrlvaH80"); NSLog(@"VSMgJHI6doQARb"); NSLog(@"w09QekBPtGYoOFNCcmpMbZURSd32JyvzaLVIWs"); NSLog(@"AWSCEairnHbefyxO81JG4cBZo"); NSLog(@"VLk37wCmPuliMYfU1n86"); NSLog(@"eojLi89w1qOrBVgUv0JYXa"); NSLog(@"6daNw9HpzblOMhTxy8i"); NSLog(@"spkU7uP18FtRbvHQGfmcarOxK52"); NSLog(@"hNigYM6DeGw7rHJ2KZvA5L"); NSLog(@"bVLDc9ulnmExRChZXJiNP2d0g5tArasfUwjTpz"); NSLog(@"LMWsGCbJkuv4"); } -(void)alo8x37:(UIBarButtonItem*) alo8x37 ab2VIQ:(UIView*) ab2VIQ axqksBmUNQ:(UIMotionEffect*) axqksBmUNQ aUKmQjNw:(UIControl*) aUKmQjNw a2l4ogyN85j:(UIBarButtonItem*) a2l4ogyN85j a3HSnjY:(UIUserInterfaceIdiom*) a3HSnjY a6QmIk:(UIWindow*) a6QmIk aWpHSNK1q:(UIButton*) aWpHSNK1q atwGbhNH0:(UIActivity*) atwGbhNH0 aQMxAvo:(UIVisualEffectView*) aQMxAvo aJxLe3hnugR:(UIApplication*) aJxLe3hnugR amSbl:(UILabel*) amSbl aIrhy:(UIAlertView*) aIrhy aWmvPYq:(UIBezierPath*) aWmvPYq aKUHMplTSni:(UIMotionEffect*) aKUHMplTSni aVPCGfQn:(UIRegion*) aVPCGfQn { NSLog(@"faFN2shqeEgluQBoMHkmGZcvtSnLx4YpKICJUi"); NSLog(@"GsefD97kTj8LFixp6gJ"); NSLog(@"uJ0rwlC2f38tgPbxN7XKUOnWGiREZqk"); NSLog(@"HfpJIYFZoeRgj9nK01UQtv3NV7qLSkcaBrXsb"); NSLog(@"2YI9dzlm3RBWxV"); NSLog(@"AetFPrk89BmW1"); NSLog(@"xpAI7K9tjq8wOUJ"); NSLog(@"UIhXymZbgR3p"); NSLog(@"TMWA59z2UdBywVDvknogEp78RHP1cSjJlI6Kaq0u"); NSLog(@"mWVAqEdOoShjJFraiv17XNQzG4tZnwfP5YKb"); NSLog(@"LYWX13DHQ9U0tdVirbPFjxNsvu"); NSLog(@"5fzrwPTGbHkBnWjuFySlQCMd4ts"); NSLog(@"yciGIg389CoLPUQEWB7X1D0v4x2l"); } -(void)abTuHdEo:(UIBarButtonItem*) abTuHdEo a9PN03:(UIEdgeInsets*) a9PN03 ah5CNM91q:(UIImage*) ah5CNM91q aiOdG:(UICollectionView*) aiOdG aXDaWx:(UILabel*) aXDaWx aqyQx5:(UIEdgeInsets*) aqyQx5 axdvhm:(UIBarButtonItem*) axdvhm a3YbAXtE:(UIApplication*) a3YbAXtE aj2OVt80:(UIImageView*) aj2OVt80 aqfJrd:(UIView*) aqfJrd auiQHBLx:(UIBezierPath*) auiQHBLx afpiAexv:(UIButton*) afpiAexv aVivbhl:(UIKeyCommand*) aVivbhl aYVB7b4eA1I:(UIActivity*) aYVB7b4eA1I a6aehMKR:(UISwitch*) a6aehMKR al8ivemD:(UIUserInterfaceIdiom*) al8ivemD abFCfw4y:(UIView*) abFCfw4y aflSEM:(UIInputView*) aflSEM { NSLog(@"SmQkfPJcT7XjxR1LsVdI4H2MnZ80CrUOvbFag"); NSLog(@"JSz4E6wX710oKymDC9UfelHAq"); NSLog(@"Gy7WnOTBJz"); NSLog(@"Lsn8YbkqpziFWfUBwDd2N4TV3olJRcaCASyrPI"); NSLog(@"8IAWn543ZVi29zSyLodH"); NSLog(@"USXa1TmD04VrPf"); NSLog(@"AOovWgR5V9Nzx4eUbh"); NSLog(@"JHcsqhEQpZiDjFWaOSrMA"); NSLog(@"8cFuytoPkjA36iXOQqC"); NSLog(@"21YwhaWkXf6djq30l"); } -(void)arh74UDkfL:(UIMotionEffect*) arh74UDkfL aB5MOE:(UIControlEvents*) aB5MOE a9H0X6:(UIImage*) a9H0X6 a7tmBe:(UIButton*) a7tmBe auqaWlU7:(UIRegion*) auqaWlU7 aE5pO:(UIScreen*) aE5pO a2JpBw:(UIBarButtonItem*) a2JpBw aedi08aRCB:(UIView*) aedi08aRCB aCYvZM4:(UIFont*) aCYvZM4 aFUZI8uLc6x:(UIControlEvents*) aFUZI8uLc6x afZgX:(UIEdgeInsets*) afZgX { NSLog(@"TU0zlfm5S6NEYij8wrMRcsA9nhb2tZGpxqKvu7He"); NSLog(@"p4CHwqz8KmhQlZ5v9"); NSLog(@"t9YQVhBSZ56elNRyF1jraJoWbML"); NSLog(@"Fx2A47d6s5XucMbNVt"); NSLog(@"VthELQI1FS5DbNznr2Wv0U7Bw3"); NSLog(@"F8px0Nqy7MHXgv2EjcToSlKRhAz1ewYbD3dUu5m"); NSLog(@"zhDgj8rcMWqkRo6bOIX0UPyBKpTC4xVG7iA"); NSLog(@"16go2qlkx3bPjQScnRazwYys"); NSLog(@"8FIWe2MXynHCGiKRPVvsgmTYjB5tJU"); NSLog(@"RCqOM96uFPhfaKBzYpgNAl8SrvVEwdojJ"); } @end