FHHFPSIndicator.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // FHHFPSIndicator.h
  3. // FHHFPSIndicator:https://github.com/jvjishou/FHHFPSIndicator
  4. //
  5. // Created by 002 on 16/6/27.
  6. // Copyright © 2016年 002. All rights reserved.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import <Foundation/Foundation.h>
  12. #import <UIKit/UIKit.h>
  13. #import "UIWindow+FHH.h"
  14. // FpsLabel's position. Default is FPSIndicatorPositionBottomCenter
  15. // If your device is iPhone4's or iPhone5's series,use FPSIndicatorPositionBottomCenter to make the fpsLabel show completed.
  16. typedef enum {
  17. FPSIndicatorPositionTopLeft, ///<left-center on statusBar
  18. FPSIndicatorPositionTopRight, ///<right-center on statusBar
  19. FPSIndicatorPositionBottomCenter ///<under the statusBar
  20. } FPSIndicatorPosition;
  21. @interface FHHFPSIndicator : NSObject
  22. #pragma mark - Attribute
  23. ///=============================================================================
  24. /// @name Attribute
  25. ///=============================================================================
  26. @property(nonatomic,assign) FPSIndicatorPosition fpsLabelPosition;
  27. #pragma mark - Initializer
  28. ///=============================================================================
  29. /// @name Initializer
  30. ///=============================================================================
  31. /**
  32. Returns global shared FHHFPSIndicator instance.
  33. @return The singleton FHHFPSIndicator instance.
  34. */
  35. + (FHHFPSIndicator *)sharedFPSIndicator;
  36. #pragma mark - Access Methods
  37. ///=============================================================================
  38. /// @name Access Methods
  39. ///=============================================================================
  40. /**
  41. Set fpsLabel.textColor
  42. @param color The color to be setted for fpsLabel.textColor. If nil,the default Color will be setted.
  43. */
  44. - (void)setFpsLabelColor:(UIColor *)color;
  45. /**
  46. Show fpsLabel at the top of keyWindow
  47. Note:If you change the keyWindow,you shoud call this function again after the new keyWindw becomes keyAndVisible.
  48. */
  49. - (void)show;
  50. /**
  51. Hide fpsLabel
  52. Note:If you call this function in the code,the fpsLabel will always be hided in the keyWindow until you call 'show' function again.
  53. */
  54. - (void)hide;
  55. /**
  56. return ture if fpsLabel shown on the screen.otherwhise return false
  57. */
  58. - (BOOL)isShowingFps;
  59. @end