APBToygerUtils.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // APFUtils.h
  3. // APFaceDetectBiz
  4. //
  5. // Created by 晗羽 on 8/25/16.
  6. // Copyright © 2016 DTF. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <APBToygerFacade/APBToygerFacadeDefine.h>
  10. //#import "APFaceDetectBizFacade.h"
  11. //主线程同步操作
  12. #define SYNC_MAINTHREAD_BEGIN_APBT [APBToygerUtils APBToygerMainThread:^{
  13. #define SYNC_MAINTHREAD_END_APBT }];
  14. #define LOCK(locker, ...) dispatch_semaphore_wait(locker, DISPATCH_TIME_FOREVER); \
  15. __VA_ARGS__; \
  16. dispatch_semaphore_signal(locker);
  17. @class MGLivenessDetectionFrameEncodedData;
  18. @interface APBToygerUtils : NSObject
  19. + (void)APBToygerMainThread:(dispatch_block_t)block;
  20. + (NSString *)getTextContentforKey:(NSString*)keyName;
  21. + (NSString *)localizedTextForKey:(NSString *)key;
  22. + (NSBundle *)getBundle;
  23. + (int)getCodefrom:(NSString *)bisToken withLength:(int)codeLen;
  24. //+ (NSString *)getActionNoticeByActionType:(APFLiveActionType) actionType;
  25. //检查文件是否存在
  26. + (BOOL) checkFileunderPath:(NSString *) filePath;
  27. //写入文件
  28. //如果文件存在,不重写,返回失败。
  29. //如果文件不再在,写入,返回写入结果
  30. + (BOOL) writeFileunderPath:(NSString *) filePath;
  31. //删除文件
  32. + (BOOL) removeFileunderPath:(NSString *) filePath;
  33. //随机文件名
  34. + (NSString *)randomString:(NSInteger)len;
  35. + (NSString *)localizedStringForKey:(NSString *)key;
  36. + (UIImage *)loadImageFromBundleNamed:(NSString *)imageName;
  37. + (UIWindow *)lastWindow;
  38. + (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize;
  39. @end