EPSErrorHandling provides a category on UIViewController
(ErrorHandling
) which adds a method for presenting errors:
- (void)eps_presentError:(NSError *)error;
By default, eps_presentError:
will show an alert using the localizedDescription
of error
as its title, and localizedFailureReason
as the message. This method should be overridden in subclasses of UIViewController
to customize error handling for specific situations.
EPSErrorHandling can be used as a standard way to handles errors generated by RACCommand
objects. For example:
[self rac_liftSelector:@selector(eps_presentError:) withSignals:self.viewModel.loginCommand.errors, nil];
EPSErrorHandling is available through CocoaPods, to install it simply add the following line to your Podfile:
pod "EPSErrorHandling"
Alternatively, include UIViewController+ErrorHandling.h
and UIViewController+ErrorHandling.m
in your project.
EPSErrorHandling is available under the MIT license. See the LICENSE file for more info.