Review changes
This commit is contained in:
parent
03152f9f8b
commit
e3422124f5
@ -24,6 +24,7 @@ extern NSString * const KeyPageMap;
|
|||||||
extern NSString * const KeySystemParameters;
|
extern NSString * const KeySystemParameters;
|
||||||
extern NSString * const KeyButtonMap;
|
extern NSString * const KeyButtonMap;
|
||||||
extern NSString * const KeyOpenSupport;
|
extern NSString * const KeyOpenSupport;
|
||||||
|
extern NSString * const KeyPostAction;
|
||||||
|
|
||||||
extern NSString * const KeyLinks;
|
extern NSString * const KeyLinks;
|
||||||
extern NSString * const KeyTitle;
|
extern NSString * const KeyTitle;
|
||||||
|
|||||||
@ -26,6 +26,7 @@ NSString * const KeyPageMap = @"PageMap";
|
|||||||
NSString * const KeySystemParameters = @"SystemParams";
|
NSString * const KeySystemParameters = @"SystemParams";
|
||||||
NSString * const KeyButtonMap = @"ButtonMap";
|
NSString * const KeyButtonMap = @"ButtonMap";
|
||||||
NSString * const KeyOpenSupport = @"openSupport";
|
NSString * const KeyOpenSupport = @"openSupport";
|
||||||
|
NSString * const KeyPostAction = @"PostAction";
|
||||||
|
|
||||||
NSString * const KeyLinks = @"Links";
|
NSString * const KeyLinks = @"Links";
|
||||||
NSString * const KeyTitle = @"title";
|
NSString * const KeyTitle = @"title";
|
||||||
|
|||||||
@ -26,6 +26,9 @@
|
|||||||
@property (nonatomic) BOOL backgroundLoad;
|
@property (nonatomic) BOOL backgroundLoad;
|
||||||
@property (nonatomic, getter=areDependenciesAdded) BOOL dependenciesAdded;
|
@property (nonatomic, getter=areDependenciesAdded) BOOL dependenciesAdded;
|
||||||
|
|
||||||
|
/// Legacy flag for if this operation will have an alert to show when finished.
|
||||||
|
@property (nonatomic, readonly) BOOL alertToShow;
|
||||||
|
|
||||||
// Initializes the operation with the request parameters object, data for page, and mvm view controller to handle the loading with.
|
// Initializes the operation with the request parameters object, data for page, and mvm view controller to handle the loading with.
|
||||||
- (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegateObject:(nullable DelegateObject *)delegateObject backgroundLoad:(BOOL)backgroundLoad;
|
- (nullable instancetype)initWithRequestParameters:(nullable MVMCoreRequestParameters *)requestParameters dataForPage:(nullable NSDictionary *)dataForPage delegateObject:(nullable DelegateObject *)delegateObject backgroundLoad:(BOOL)backgroundLoad;
|
||||||
|
|
||||||
@ -88,9 +91,6 @@
|
|||||||
// Displays the view controller to the screen.
|
// Displays the view controller to the screen.
|
||||||
+ (void)displayViewController:(nonnull UIViewController <MVMCoreViewControllerProtocol> *)viewController loadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error;
|
+ (void)displayViewController:(nonnull UIViewController <MVMCoreViewControllerProtocol> *)viewController loadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error;
|
||||||
|
|
||||||
/// Checks to see if the operation has content to show.
|
|
||||||
+ (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error;
|
|
||||||
|
|
||||||
// Handles the error based on the error object passed in. May log and/or display the error.
|
// Handles the error based on the error object passed in. May log and/or display the error.
|
||||||
+ (void)handleError:(nonnull MVMCoreErrorObject *)error loadObject:(nonnull MVMCoreLoadObject *)loadObject showAlertForErrorIfApplicable:(BOOL)showAlertForErrorIfApplicable;
|
+ (void)handleError:(nonnull MVMCoreErrorObject *)error loadObject:(nonnull MVMCoreLoadObject *)loadObject showAlertForErrorIfApplicable:(BOOL)showAlertForErrorIfApplicable;
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
@property (weak, nonatomic) NSURLSessionTask *sessionTask;
|
@property (weak, nonatomic) NSURLSessionTask *sessionTask;
|
||||||
|
|
||||||
// For temporarily storing any alert to show until we determine it's delegate.
|
// For temporarily storing any alert to show until we determine it's delegate.
|
||||||
@property (nonatomic) BOOL alertToShow;
|
@property (nonatomic, readwrite) BOOL alertToShow;
|
||||||
@property (strong, nonatomic, nullable) MVMCoreErrorObject *errorForAlertToShow;
|
@property (strong, nonatomic, nullable) MVMCoreErrorObject *errorForAlertToShow;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -167,7 +167,7 @@
|
|||||||
|
|
||||||
// Can continue loading with the page.
|
// Can continue loading with the page.
|
||||||
[MVMCoreLoadRequestOperation handleLoadObject:loadObject error:error];
|
[MVMCoreLoadRequestOperation handleLoadObject:loadObject error:error];
|
||||||
} else if ([MVMCoreLoadRequestOperation hasContentToShow:loadObject error:error] || loadObject.operation.backgroundLoad || loadObject.requestParameters.noViewControllerToLoad) {
|
} else if (loadObject.operation.backgroundLoad || loadObject.requestParameters.noViewControllerToLoad || ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(hasContentToShow:error:)] && [[MVMCoreObject sharedInstance].globalLoadDelegate hasContentToShow:loadObject error:error])) {
|
||||||
|
|
||||||
// Something to show, or nothing was expected to show, can finish.
|
// Something to show, or nothing was expected to show, can finish.
|
||||||
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
|
||||||
@ -732,10 +732,6 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error {
|
|
||||||
return loadObject.operation.alertToShow || [loadObject.responseJSON objectForKey:@"PostAction"] || [loadObject.responseJSON objectForKey:@"TopNotification"];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)handleError:(nonnull MVMCoreErrorObject *)error loadObject:(nonnull MVMCoreLoadObject *)loadObject showAlertForErrorIfApplicable:(BOOL)showAlertForErrorIfApplicable {
|
+ (void)handleError:(nonnull MVMCoreErrorObject *)error loadObject:(nonnull MVMCoreLoadObject *)loadObject showAlertForErrorIfApplicable:(BOOL)showAlertForErrorIfApplicable {
|
||||||
|
|
||||||
if ([loadObject.operation checkAndHandleForCancellation]) {
|
if ([loadObject.operation checkAndHandleForCancellation]) {
|
||||||
|
|||||||
@ -38,4 +38,7 @@
|
|||||||
// Shows the appropriate alert style for the given response info and/or error.
|
// Shows the appropriate alert style for the given response info and/or error.
|
||||||
- (void)createAndShowAlertForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error delegateObject:(nullable DelegateObject *)delegateObject;
|
- (void)createAndShowAlertForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error delegateObject:(nullable DelegateObject *)delegateObject;
|
||||||
|
|
||||||
|
/// Checks to see if the operation has content to show.
|
||||||
|
- (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user