{"id":20620782,"url":"https://github.com/irons163/iralertmanager","last_synced_at":"2026-04-16T21:35:01.639Z","repository":{"id":56915163,"uuid":"202516221","full_name":"irons163/IRAlertManager","owner":"irons163","description":"IRAlertManager is a powerful alert manager for iOS, which can handle different alert frameworks.","archived":false,"fork":false,"pushed_at":"2020-01-30T06:59:45.000Z","size":581,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T13:38:56.744Z","etag":null,"topics":["alert","alert-manager","alertmanager","ios","objcective-c"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irons163.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-15T09:47:44.000Z","updated_at":"2020-01-30T06:58:46.000Z","dependencies_parsed_at":"2022-08-20T20:50:31.012Z","dependency_job_id":null,"html_url":"https://github.com/irons163/IRAlertManager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRAlertManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRAlertManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRAlertManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRAlertManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irons163","download_url":"https://codeload.github.com/irons163/IRAlertManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242298971,"owners_count":20104922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alert","alert-manager","alertmanager","ios","objcective-c"],"created_at":"2024-11-16T12:15:40.160Z","updated_at":"2026-04-16T21:35:01.537Z","avatar_url":"https://github.com/irons163.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/badge/build-%20passing%20-brightgreen.svg)\n![Platform](https://img.shields.io/badge/Platform-%20iOS%20-blue.svg)\n\n# IRAlertManager \n\n- IRAlertManager is a powerful alert manager for iOS, which can handle different alert frameworks.\n\n## Features\n- Handle different alert frameworks.\n- Support a global loading view.\n\n## Install\n### Git\n- Git clone this project.\n- Copy this project into your own project.\n- Add the .xcodeproj into you  project and link it as embed framework.\n#### Options\n- You can remove the `demo` and `ScreenShots` folder.\n\n### Cocoapods\n- Add `pod 'IRAlertManager'`  in the `Podfile`\n- `pod install`\n\n## Usage\n\n### Basic\n\n- The `demo` show three diffrent alert systems, include `Apple system alert`,  `XFDialogBuilder`, and `LGAlertView`.\n\n- Assum you want to handle with a alert system named `DEMOAlert`, you can follow as below:\n\n- Create a new class `IRDEMOAlert` extends `IRAlert`, and Import `IRAlertManager`\n```obj-c\n#import \u003cIRAlertManager/IRAlertManager.h\u003e\n\ntypedef NS_ENUM(NSUInteger, IRDEMOAlertStyle) {\n    IRDEMOAlertStyleAlert       = 0,\n    IRDEMOAlertStyleActionSheet = 1\n};\n\n@interface IRDEMOAlert : IRAlert\n\n- (instancetype)initWithTitle:(nullable NSString *)title\n               message:(nullable NSString *)message\n                 style:(IRDEMOAlertStyle)style\n         buttonActions:(nullable NSArray\u003cIRAlertAction *\u003e *)buttonActions\n    cancelButtonAction:(nullable IRAlertAction *)cancelButtonAction\ndestructiveButtonAction:(nullable IRAlertAction *)destructiveButtonAction;\n\n@end\n\n```\n\n- Write the initial codes for create the `DEMOAlert` instanse inside\n```obj-c\n- (instancetype)initWithTitle:(nullable NSString *)title\n               message:(nullable NSString *)message\n                 style:(IRAlertLGStyle)style\n         buttonActions:(nullable NSArray\u003cIRAlertAction *\u003e *)buttonActions\n    cancelButtonAction:(nullable IRAlertAction *)cancelButtonAction\ndestructiveButtonAction:(nullable IRAlertAction *)destructiveButtonAction {\n    if(self = [super init]){\n        NSMutableArray\u003cNSString *\u003e * titles = [self titlesWithButtonActions:buttonActions];\n        \n        alert = [[DEMOAlert alloc] initWithTitle:title message:message style:(DEMOAlertStyle)style buttonTitles:titles cancelButtonTitle:cancelButtonAction.title destructiveButtonTitle:destructiveButtonAction.title];\n        \n        [self setupButtonActions:buttonActions cancelButtonAction:cancelButtonAction destructiveButtonAction:destructiveButtonAction];\n        [self registerForKeyboardNotifications];\n    }\n    \n    return self;\n}\n```\n\n- Override `IRAlert` methods\n```obj-c\n-(void)setBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor;\n-(void)setCornerRadius:(CGFloat)cornerRadius;\n-(void)addAction:(IRAlertAction*)action;\n```\n\n- Let the `IRAlertAction`  work for `DEMOAlert`, this is the most difficualt part, you need know how to use `DEMOAlert`, and make `DEMOAlert` call the handler of `IRAlertAction`. In this example, `DEMOAlert` has `actionHandler`, `cancelHandler`, and `destructiveHandler`, and each handler is mapping to `IRAlertAction`\n```objc\n- (void)setupButtonActions:(NSArray\u003cIRAlertAction *\u003e * _Nullable)buttonActions cancelButtonAction:(IRAlertAction * _Nullable)cancelButtonAction destructiveButtonAction:(IRAlertAction * _Nullable)destructiveButtonAction {\n    __weak IRDEMOAlert* wself = self;\n    \n    alert.actionHandler = ^(DEMOAlert * _Nonnull alertView, NSUInteger index, NSString * _Nullable title) {\n        if(index \u003e= buttonActions.count)\n            return;\n        \n        IRAlertAction *action = [buttonActions objectAtIndex:index];\n        action.handler(action);\n    };\n    \n    alert.cancelHandler = ^(DEMOAlert * _Nonnull alertView) {\n        if (cancelButtonAction) {\n            cancelButtonAction.handler(cancelButtonAction);\n        }\n    };\n    \n    alert.destructiveHandler = ^(DEMOAlert * _Nonnull alertView) {\n        if (destructiveButtonAction) {\n            destructiveButtonAction.handler(destructiveButtonAction);\n        }\n    };\n}\n\n```\n\n- Show or Hide alert with `IRAlertManager`.\n```objc\n[[IRAlertManager sharedInstance] showAlert:alert];\n\n[[IRAlertManager sharedInstance] hideAlert:alert];\n```\n\n- Show or Hide global loading view with `IRAlertManager`.\n```objc\n\n[[IRAlertManager sharedInstance] showLoadingViewWithTarget:self backgroundImage:[ViewController imageWithColor:[UIColor greenColor] Size:[UIScreen mainScreen].bounds.size]];\n\n[[IRAlertManager sharedInstance] hideLoadingViewWithTarget:self];\n```\n\n- Show `DEMOAlert` with loading view\n```objc\n- (IBAction)showDEMOAlert:(id)sender {\n    IRAlertAction *commitAction = [[IRAlertAction alloc] init];\n    commitAction.title = @\"OK\";\n    commitAction.style = IRAlertActionStyleDefault;\n\n    IRAlertAction *cancelAction = [[IRAlertAction alloc] init];\n    cancelAction.title = @\"Cancel\";\n    cancelAction.style = IRAlertActionStyleCancel;\n    \n    alert = [[IRDEMOAlert alloc] initWithTitle:nil message:nil style:IRDEMOAlertStyleAlert buttonActions:@[commitAction] cancelButtonAction:cancelAction destructiveButtonAction:nil];\n    \n    __weak IRAlert *wAlert = alert;\n    commitAction.handler = ^(IRAlertAction * _Nonnull action) {\n        [[IRAlertManager sharedInstance] hideAlert:wAlert];\n    };\n    __weak ViewController *wSelf = self;\n    cancelAction.handler = ^(IRAlertAction * _Nonnull action) {\n        [[IRAlertManager sharedInstance] hideLoadingViewWithTarget:wSelf];\n    };\n    \n    [alert setCornerRadius:20];\n    [[IRAlertManager sharedInstance] showAlert:alert];\n}\n```\n\n## Screenshots\n| Show Alert for XFDialogBuilder | Show Custom View for XFDialogBuilder |\n|:---:|:---:|\n|![Show Alert for XFDialogBuilder](./ScreenShots/demo2.png)|![Show Custom View for XFDialogBuilder](./ScreenShots/demo3.png)| \n| Show Alert for LGAlert | Show Custom View for LGAlert |\n|![Show Alert for LGAlert](./ScreenShots/demo4.png)|![Show Custom View for LGAlert ](./ScreenShots/demo5.png)| \n| Show System Action Sheet | Show System Alert |\n|![Show System Action Sheet](./ScreenShots/demo6.png)|![Show System Alert](./ScreenShots/demo7.png)| \n| Main Page | Show System Alert And Loding Page |\n|![Main Page](./ScreenShots/demo1.png)|![Show System Alert And Loding Page](./ScreenShots/demo8.png)| \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firons163%2Firalertmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firons163%2Firalertmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firons163%2Firalertmanager/lists"}