From 2b4e53fd426089c1c82313cfee1dc440f3399dc6 Mon Sep 17 00:00:00 2001 From: Michael Ochs Date: Thu, 11 Sep 2014 17:48:44 +0200 Subject: [PATCH 1/4] chore(ci): update travis configuration We ignore the Pods file in our .gitignore file. Therefore we need to run a pod install on the travis ci before we are able to build the project. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d44180..f3a60aa 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ # reference: http://www.objc.io/issue-6/travis-ci.html language: objective-c -# before_install: cd Example && pod install && cd - +before_install: cd Example && pod install && cd - script: - xctool test -workspace Example/HRSCustomErrorHandling.xcworkspace -scheme HRSCustomErrorHandling -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO From 415ba2b905ffeec8c75fb40e24db17118bc84f6f Mon Sep 17 00:00:00 2001 From: Michael Ochs Date: Thu, 11 Sep 2014 17:59:25 +0200 Subject: [PATCH 2/4] docs(ci): update documentation to be parable by appledoc Remove the asterisks in front of the lines to have documentation comments that can be parsed by appledoc, which is used by cocoadocs.org --- Pod/Classes/HRSErrorPresenter.h | 50 +++++----- Pod/Classes/HRSErrorRecoveryAttempter.h | 62 ++++++------ .../Private/HRSErrorPresenterDelegate.h | 24 ++--- .../UIResponder+HRSCustomErrorPresentation.h | 99 +++++++++---------- 4 files changed, 117 insertions(+), 118 deletions(-) diff --git a/Pod/Classes/HRSErrorPresenter.h b/Pod/Classes/HRSErrorPresenter.h index 0efffbb..95c2caa 100755 --- a/Pod/Classes/HRSErrorPresenter.h +++ b/Pod/Classes/HRSErrorPresenter.h @@ -17,39 +17,39 @@ @interface HRSErrorPresenter : UIAlertView /** - * @warning You should not set a custom delegate to a `HRSErrorPresenter`. + @warning You should not set a custom delegate to a `HRSErrorPresenter`. */ @property(nonatomic,assign) id delegate __unavailable; /** - * Creates a new `HRSErrorPresenter` object (a `UIAlertView`) that is fully - * configured with the passed-in error and linked with the given completion - * handler. - * - * @note This does not automatically present the alert view. You still need to - call `show` on the returned object. - * - * @param error The error that should be presented. - * @param completionHandler The completion handler that should be called after - error recovery. - * - * @return The fully configured presenter object, ready to be shown to the user. + Creates a new `HRSErrorPresenter` object (a `UIAlertView`) that is fully + configured with the passed-in error and linked with the given completion + handler. + + @note This does not automatically present the alert view. You still need to + call `show` on the returned object. + + @param error The error that should be presented. + @param completionHandler The completion handler that should be called after + error recovery. + + @return The fully configured presenter object, ready to be shown to the user. */ + (instancetype)presenterWithError:(NSError *)error completionHandler:(void (^)(BOOL))completionHandler; /** - * Initializes a `HRSErrorPresenter` object (a `UIAlertView`) that is fully - * configured with the passed-in error and linked with the given completion - * handler. - * - * @note This does not automatically present the alert view. You still need to - call `show` on the returned object. - * - * @param error The error that should be presented. - * @param completionHandler The completion handler that should be called after - error recovery. - * - * @return The fully configured presenter object, ready to be shown to the user. + Initializes a `HRSErrorPresenter` object (a `UIAlertView`) that is fully + configured with the passed-in error and linked with the given completion + handler. + + @note This does not automatically present the alert view. You still need to + call `show` on the returned object. + + @param error The error that should be presented. + @param completionHandler The completion handler that should be called after + error recovery. + + @return The fully configured presenter object, ready to be shown to the user. */ - (instancetype)initWithError:(NSError *)error completionHandler:(void (^)(BOOL))completionHandler; diff --git a/Pod/Classes/HRSErrorRecoveryAttempter.h b/Pod/Classes/HRSErrorRecoveryAttempter.h index 6d68db4..6a4891a 100755 --- a/Pod/Classes/HRSErrorRecoveryAttempter.h +++ b/Pod/Classes/HRSErrorRecoveryAttempter.h @@ -17,49 +17,49 @@ @interface HRSErrorRecoveryAttempter : NSObject /** - * Add a recovery option to the attempter that is used for presentation and - * error recovery. - * - * The recovery options are stored in the order they are added to the recovery - * attempter. The first option that is added should be the default option. The - * default option shout *not* be a destructive operation. - * - * @warning Make sure to add at least one recovery block that returns `NO`, - * such as a cancel recovery option, to make sure the user can break the error - * presentation cycle in the case your error recovery was not successful even - * though it should have been. - * - * @param title A localized title to be shown on a button to represent - the functionality of the recovery block. - * @param recoveryBlock The block that will be executed if the user selects - this recovery option. + Add a recovery option to the attempter that is used for presentation and error + recovery. + + The recovery options are stored in the order they are added to the recovery + attempter. The first option that is added should be the default option. The + default option shout *not* be a destructive operation. + + @warning Make sure to add at least one recovery block that returns `NO`, + such as a cancel recovery option, to make sure the user can break the + error presentation cycle in the case your error recovery was not + successful even though it should have been. + + @param title A localized title to be shown on a button to represent + the functionality of the recovery block. + @param recoveryBlock The block that will be executed if the user selects + this recovery option. */ - (void)addRecoveryOptionWithTitle:(NSString *)title recoveryAttempt:(BOOL(^)())recoveryBlock; /** - * A convenience method to adds a recovery option that does no recovery and is - * represented on a button as 'OK'. - * - * The text is localized in all languages supported by UIKit. + A convenience method to adds a recovery option that does no recovery and is + represented on a button as 'OK'. + + The text is localized in all languages supported by UIKit. */ - (void)addOkayRecoveryOption; /** - * A convenience method to adds a recovery option that does no recovery and is - * represented on a button as 'Cancel'. - * - * The text is localized in all languages supported by UIKit. + A convenience method to adds a recovery option that does no recovery and is + represented on a button as 'Cancel'. + + The text is localized in all languages supported by UIKit. */ - (void)addCancelRecoveryOption; /** - * The localized recovery option titles that have been added to the attempter. - * - * This method is ment to provide a convenience way to add the localized - * recovery options to a `NSError` as the `NSLocalizedRecoveryOptionsErrorKey`. - * - * @return The array with all localized recovery option titles. The first title - is the default recovery option. + The localized recovery option titles that have been added to the attempter. + + This method is ment to provide a convenience way to add the localized + recovery options to a `NSError` as the `NSLocalizedRecoveryOptionsErrorKey`. + + @return The array with all localized recovery option titles. The first title + is the default recovery option. */ - (NSArray *)localizedRecoveryOptions; diff --git a/Pod/Classes/Private/HRSErrorPresenterDelegate.h b/Pod/Classes/Private/HRSErrorPresenterDelegate.h index 36b683f..35db73c 100755 --- a/Pod/Classes/Private/HRSErrorPresenterDelegate.h +++ b/Pod/Classes/Private/HRSErrorPresenterDelegate.h @@ -17,18 +17,18 @@ @interface HRSErrorPresenterDelegate : NSObject /** - * Creates a presenter delegate to work closely together with the - * `HRSErrorPresenter`. - * - * @note You should not create such an object on your own, instead, this object - is presented for you when creating an `HRSErrorPresenter`. - * - * @param error The error the corresponding `HRSErrorPresenter` - will show. - * @param completionHandler The completion handler that should be invoked after - error recovery completed. - * - * @return The delegate to be used by the `HRSErrorPresenter` instance. + Creates a presenter delegate to work closely together with the + `HRSErrorPresenter`. + + @note You should not create such an object on your own, instead, this object + is presented for you when creating an `HRSErrorPresenter`. + + @param error The error the corresponding `HRSErrorPresenter` will + show. + @param completionHandler The completion handler that should be invoked after + error recovery completed. + + @return The delegate to be used by the `HRSErrorPresenter` instance. */ + (instancetype)delegateWithError:(NSError *)error completionHandler:(void(^)(BOOL))completionHandler; diff --git a/Pod/Classes/UIResponder+HRSCustomErrorPresentation.h b/Pod/Classes/UIResponder+HRSCustomErrorPresentation.h index 97ffb88..67049ac 100755 --- a/Pod/Classes/UIResponder+HRSCustomErrorPresentation.h +++ b/Pod/Classes/UIResponder+HRSCustomErrorPresentation.h @@ -17,60 +17,59 @@ @interface UIResponder (HRSCustomErrorPresentation) /** - * Presents an error to the user. - * - * The default implementation of this method will call `willPresentError:` with - * the error that was passed to this method. The resulting error will then be - * forwarded up the responder chain. If there is no next responder, the error - * is forwarded to the current `UIApplication` instance. - * - * If the responder that receives this message is the application delegate or - * it is the application itself and the application delegate does not inherit - * from `UIResponder` the error is presented in a `UIAlertView` dialog. - * - * After the user dismisses the alert view, the error recovery for this option - * is automatically started. After the error recovery, the completion handler - * is called, reporting whether the recovery was successful or not. - * - * It is recommended to retry the action that lead to the error in the first - * place when the error recovery was successful. - * - * @note You can override this method in your application delegate to create - your own custom error presentation UI. Make sure to let your delegate - inherit from `UIResponder` for this hook to work. - * - * @param error The error that should be presented to the user. - * @param completionHandler The completion handler that is called when the user - taps a button and the error recovery was completed. - didRecover Is true if the error recovery was - successful. You should retry the action - that lead to the error in this case. + Presents an error to the user. + + The default implementation of this method will call `willPresentError:` with + the error that was passed to this method. The resulting error will then be + forwarded up the responder chain. If there is no next responder, the error + is forwarded to the current `UIApplication` instance. + + If the responder that receives this message is the application delegate or it + is the application itself and the application delegate does not inherit from + `UIResponder` the error is presented in a `UIAlertView` dialog. + + After the user dismisses the alert view, the error recovery for this option is + automatically started. After the error recovery, the completion handler is + called, reporting whether the recovery was successful or not. + + It is recommended to retry the action that lead to the error in the first place + when the error recovery was successful. + + @note You can override this method in your application delegate to create your + own custom error presentation UI. Make sure to let your delegate inherit + from `UIResponder` for this hook to work. + + @param error The error that should be presented to the user. + @param completionHandler The completion handler that is called when the user + taps a button and the error recovery was completed. + didRecover Is true if the error recovery was + successful. You should retry the action that lead to + the error in this case. */ - (void)presentError:(NSError *)error completionHandler:(void (^)(BOOL didRecover))completionHandler; /** - * Called when the receiver is about to present or forward an error. The - * returned error is the error that is should actually be presented or - * forwarded. - * - * The default implementation of this method immediately returns the passed-in - * error. - * - * You can manipulate the passed-in error to change the presentation of the - * error in three ways: - * (1) return the error that was passed to the method to not change the error. - * (2) return nil to stop the error from being presented. - * (3) return a new error that will be presented instead. - It is recommended to only touch the parameters of the error you really - want to change and leave the rest as it is. E.g. when you want to change - the localized text that is shown to the user, leave the error domain, - the error code and all other keys from the `userInfo` dictionary as they - are to give other responders in the chain a chance to identify the error. - * - * @param error The error the receiver wants to present or forward. - * - * @return The error you want the receiver to present or forward or nil if you - do not want any error to be presented or forwarded. + Called when the receiver is about to present or forward an error. The returned + error is the error that is should actually be presented or forwarded. + + The default implementation of this method immediately returns the passed-in + error. + + You can manipulate the passed-in error to change the presentation of the error + in three ways: + (1) return the error that was passed to the method to not change the error. + (2) return nil to stop the error from being presented. + (3) return a new error that will be presented instead. + It is recommended to only touch the parameters of the error you really + want to change and leave the rest as it is. E.g. when you want to change + the localized text that is shown to the user, leave the error domain, the + error code and all other keys from the `userInfo` dictionary as they are to + give other responders in the chain a chance to identify the error. + + @param error The error the receiver wants to present or forward. + + @return The error you want the receiver to present or forward or nil if you + do not want any error to be presented or forwarded. */ - (NSError *)willPresentError:(NSError *)error; From bdf380f56a69215ce36a4f3b2535e3355a62a01f Mon Sep 17 00:00:00 2001 From: Michael Ochs Date: Fri, 12 Sep 2014 15:06:51 +0200 Subject: [PATCH 3/4] chore: bump version to 0.1.1 --- HRSCustomErrorHandling.podspec | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HRSCustomErrorHandling.podspec b/HRSCustomErrorHandling.podspec index 663404e..c945e7e 100644 --- a/HRSCustomErrorHandling.podspec +++ b/HRSCustomErrorHandling.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "HRSCustomErrorHandling" - s.version = "0.1.0" + s.version = "0.1.1" s.summary = "HRSCustomErrorHandling provides an easy way to handle error presentation and creation on iOS." s.description = <<-DESC HRSCustomErrorHandling is a small Framework that provides a base implementation for error handling in iOS applications. It deals with the problem to streamline the presentation of errors in various parts of an application as well as provide APIs to implement error specific recovery options the user of the application can choose from. diff --git a/VERSION b/VERSION index 6c6aa7c..6da28dd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.1 \ No newline at end of file From 91fa457275f9e4e6ced06aee2d9238637058a3c0 Mon Sep 17 00:00:00 2001 From: Michael Ochs Date: Fri, 12 Sep 2014 15:07:13 +0200 Subject: [PATCH 4/4] chore: add change log --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..db23708 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +#Changelog + +## v0.1.1 +- Minor fixes to support travis-ci as continuous integration server +- Reformat the documentation comments to support cocoadocs parsing + +## v0.1.0 +- Initial release \ No newline at end of file