JKToast.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // JKToast.h
  3. // JKToast
  4. //
  5. // Created by Jakey on 14-10-27.
  6. // Copyright (c)2014年 www.skyfox.org. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #define DEFAULT_DISPLAY_DURATION 2.0f
  11. #define Version_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f)
  12. typedef enum iToastLocal {
  13. localTop = 1000001,
  14. localBottom,
  15. localCenter
  16. }iToastLocal;
  17. @interface JKToast : NSObject {
  18. NSString *text;
  19. UILabel *textLab;
  20. UIButton *contentView;
  21. CGFloat duration;
  22. }
  23. + (void)showTopWithText:(NSString *)text;
  24. + (void)showBottomWithText:(NSString *)text;
  25. + (void)showCenterWithText:(NSString *)text;
  26. + (void)showWithText:(NSString *)text
  27. local:(iToastLocal)local
  28. duration:(CGFloat)duration;
  29. + (void)showWithText:(NSString *)text
  30. topOffset:(CGFloat)topOffset;
  31. + (void)showWithText:(NSString *)text
  32. topOffset:(CGFloat)topOffset
  33. duration:(CGFloat)duration;
  34. + (void)showWithText:(NSString *)text
  35. bottomOffset:(CGFloat)bottomOffset;
  36. + (void)showWithText:(NSString *)text
  37. bottomOffset:(CGFloat)bottomOffset
  38. duration:(CGFloat)duration;
  39. @end