/UIAlertView-NSErrorAddition

UIAlertView + NSError category library.

Primary LanguageObjective-CMIT LicenseMIT

UIAlertView-NSErrorAddition

CI Status Version License Platform

UIAlertView + NSError category library.

img

Installation

UIAlertView-NSErrorAddition is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "UIAlertView-NSErrorAddition"

Usage

You can try it:

pod try UIAlertView-NSErrorAddition

Basic use case.

NSDictionary *userInfo = @{
    NSLocalizedDescriptionKey : @"Network Error",
    NSLocalizedFailureReasonErrorKey : @"Doesn't connect to network",
    NSLocalizedRecoverySuggestionErrorKey : @"Reload page after check the network.",
    NSLocalizedRecoveryOptionsErrorKey : @[@"OK"]
};

NSError *error = [NSError errorWithDomain:[[NSBundle bundleForClass:[self class]] bundleIdentifier] code:0 userInfo:userInfo];
UIAlertView *alertView = [[UIAlertView alloc] initWithError:error];
[alertView show];

Each key mapping to UIAlertView parts.

img

More Detail

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT