JSAlertView.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // JSAlertView.h
  3. // JSAlertView
  4. //
  5. // Created by Jitendra Singh on 10/12/16.
  6. // Copyright © 2016 Jitendra Singh. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #define ALERT(x) [JSAlertView alert:x]
  10. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
  11. @interface JSAlertView : UIAlertController
  12. #else
  13. @interface JSAlertView : UIAlertView
  14. #endif
  15. // Displays simple alert message (no title) with 'Ok' button
  16. + (instancetype)alert:(NSString*)message;
  17. // Displays message (no title) with 'Yes' and 'No' button. It can be used to display confirmirmation alert.
  18. + (instancetype)confirm:(NSString*)message withCompletionHandler:(void(^)(BOOL accepted))completionHandler;
  19. // Same as previous one with addition option to show title
  20. + (instancetype)confirm:(NSString*)message withTitle:(NSString*)title withCompletionHandler:(void(^)(BOOL accepted))completionHandler;
  21. // Standard menthod for displaying alert, fully customizable.
  22. + (instancetype)alert:(NSString*)message withTitle:(NSString*)title buttons:(NSArray*)buttonTitles withCompletionHandler:(void(^)(NSInteger buttonIndex, NSString *buttonTitle))completionHandler;
  23. // Nextcloud
  24. + (BOOL)isOpenAlertWindows;
  25. @end