Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core into feature/ONEAPP-3998
This commit is contained in:
commit
ba8621cea1
@ -109,6 +109,7 @@
|
|||||||
AF7069A02880F0EB00077CF6 /* ActionOpenPageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF70699F2880F0EB00077CF6 /* ActionOpenPageHandler.swift */; };
|
AF7069A02880F0EB00077CF6 /* ActionOpenPageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF70699F2880F0EB00077CF6 /* ActionOpenPageHandler.swift */; };
|
||||||
AF787413286DEF8B00670588 /* ActionBackHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF787412286DEF8B00670588 /* ActionBackHandler.swift */; };
|
AF787413286DEF8B00670588 /* ActionBackHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF787412286DEF8B00670588 /* ActionBackHandler.swift */; };
|
||||||
AF8D13392774EA1D008AF4A9 /* ActionOpenUrlHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF8D13382774EA1D008AF4A9 /* ActionOpenUrlHandler.swift */; };
|
AF8D13392774EA1D008AF4A9 /* ActionOpenUrlHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF8D13382774EA1D008AF4A9 /* ActionOpenUrlHandler.swift */; };
|
||||||
|
AFA4931E29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4931D29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift */; };
|
||||||
AFBB96341FBA34310008D868 /* MVMCoreErrorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96321FBA34310008D868 /* MVMCoreErrorConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AFBB96341FBA34310008D868 /* MVMCoreErrorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96321FBA34310008D868 /* MVMCoreErrorConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
AFBB96351FBA34310008D868 /* MVMCoreErrorConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96331FBA34310008D868 /* MVMCoreErrorConstants.m */; };
|
AFBB96351FBA34310008D868 /* MVMCoreErrorConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96331FBA34310008D868 /* MVMCoreErrorConstants.m */; };
|
||||||
AFBB96381FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96371FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AFBB96381FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96371FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
@ -133,8 +134,6 @@
|
|||||||
AFBB96951FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96771FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AFBB96951FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96771FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
AFBB96961FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96781FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AFBB96961FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96781FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
AFBB96971FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96791FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m */; };
|
AFBB96971FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96791FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m */; };
|
||||||
AFBB96981FBA3A9A0008D868 /* MVMCoreAlertController.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
||||||
AFBB96991FBA3A9A0008D868 /* MVMCoreAlertController.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */; };
|
|
||||||
AFBB96B01FBA3B590008D868 /* MVMCoreDispatchUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AFBB96B01FBA3B590008D868 /* MVMCoreDispatchUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
AFBB96B11FBA3B590008D868 /* MVMCoreDispatchUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96AD1FBA3B590008D868 /* MVMCoreDispatchUtility.m */; };
|
AFBB96B11FBA3B590008D868 /* MVMCoreDispatchUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96AD1FBA3B590008D868 /* MVMCoreDispatchUtility.m */; };
|
||||||
AFBB96B21FBA3B590008D868 /* MVMCoreGetterUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AFBB96B21FBA3B590008D868 /* MVMCoreGetterUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
@ -273,6 +272,7 @@
|
|||||||
AF70699F2880F0EB00077CF6 /* ActionOpenPageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenPageHandler.swift; sourceTree = "<group>"; };
|
AF70699F2880F0EB00077CF6 /* ActionOpenPageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenPageHandler.swift; sourceTree = "<group>"; };
|
||||||
AF787412286DEF8B00670588 /* ActionBackHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionBackHandler.swift; sourceTree = "<group>"; };
|
AF787412286DEF8B00670588 /* ActionBackHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionBackHandler.swift; sourceTree = "<group>"; };
|
||||||
AF8D13382774EA1D008AF4A9 /* ActionOpenUrlHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenUrlHandler.swift; sourceTree = "<group>"; };
|
AF8D13382774EA1D008AF4A9 /* ActionOpenUrlHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenUrlHandler.swift; sourceTree = "<group>"; };
|
||||||
|
AFA4931D29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreActionUtility+Extension.swift"; sourceTree = "<group>"; };
|
||||||
AFBB96321FBA34310008D868 /* MVMCoreErrorConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreErrorConstants.h; sourceTree = "<group>"; };
|
AFBB96321FBA34310008D868 /* MVMCoreErrorConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreErrorConstants.h; sourceTree = "<group>"; };
|
||||||
AFBB96331FBA34310008D868 /* MVMCoreErrorConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreErrorConstants.m; sourceTree = "<group>"; };
|
AFBB96331FBA34310008D868 /* MVMCoreErrorConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreErrorConstants.m; sourceTree = "<group>"; };
|
||||||
AFBB96371FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadDelegateProtocol.h; sourceTree = "<group>"; };
|
AFBB96371FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadDelegateProtocol.h; sourceTree = "<group>"; };
|
||||||
@ -297,8 +297,6 @@
|
|||||||
AFBB96771FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCorePresentationDelegateProtocol.h; sourceTree = "<group>"; };
|
AFBB96771FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCorePresentationDelegateProtocol.h; sourceTree = "<group>"; };
|
||||||
AFBB96781FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCorePresentViewControllerOperation.h; sourceTree = "<group>"; };
|
AFBB96781FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCorePresentViewControllerOperation.h; sourceTree = "<group>"; };
|
||||||
AFBB96791FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCorePresentViewControllerOperation.m; sourceTree = "<group>"; };
|
AFBB96791FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCorePresentViewControllerOperation.m; sourceTree = "<group>"; };
|
||||||
AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertController.h; sourceTree = "<group>"; };
|
|
||||||
AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertController.m; sourceTree = "<group>"; };
|
|
||||||
AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreDispatchUtility.h; sourceTree = "<group>"; };
|
AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreDispatchUtility.h; sourceTree = "<group>"; };
|
||||||
AFBB96AD1FBA3B590008D868 /* MVMCoreDispatchUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreDispatchUtility.m; sourceTree = "<group>"; };
|
AFBB96AD1FBA3B590008D868 /* MVMCoreDispatchUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreDispatchUtility.m; sourceTree = "<group>"; };
|
||||||
AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreGetterUtility.h; sourceTree = "<group>"; };
|
AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreGetterUtility.h; sourceTree = "<group>"; };
|
||||||
@ -391,7 +389,6 @@
|
|||||||
8876D5D41FB50AAB00EB2E3D /* Utility */,
|
8876D5D41FB50AAB00EB2E3D /* Utility */,
|
||||||
AF43A7191FC5BE9E008E9347 /* MainProtocols */,
|
AF43A7191FC5BE9E008E9347 /* MainProtocols */,
|
||||||
AFBB96B41FBA3CEC0008D868 /* ActionHandling */,
|
AFBB96B41FBA3CEC0008D868 /* ActionHandling */,
|
||||||
AFBB967A1FBA3A9A0008D868 /* AlertHandling */,
|
|
||||||
AFBB966B1FBA3A9A0008D868 /* PresentationHandling */,
|
AFBB966B1FBA3A9A0008D868 /* PresentationHandling */,
|
||||||
AFBB96361FBA39E70008D868 /* LoadHandling */,
|
AFBB96361FBA39E70008D868 /* LoadHandling */,
|
||||||
AFBB96131FBA26650008D868 /* ViewControllerMapping */,
|
AFBB96131FBA26650008D868 /* ViewControllerMapping */,
|
||||||
@ -611,15 +608,6 @@
|
|||||||
path = PresentationHandling;
|
path = PresentationHandling;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
AFBB967A1FBA3A9A0008D868 /* AlertHandling */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */,
|
|
||||||
AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */,
|
|
||||||
);
|
|
||||||
path = AlertHandling;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
AFBB96AB1FBA3B590008D868 /* Helpers */ = {
|
AFBB96AB1FBA3B590008D868 /* Helpers */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -630,6 +618,7 @@
|
|||||||
D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */,
|
D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */,
|
||||||
AF43A5851FBB67D6008E9347 /* MVMCoreActionUtility.h */,
|
AF43A5851FBB67D6008E9347 /* MVMCoreActionUtility.h */,
|
||||||
AF43A5861FBB67D6008E9347 /* MVMCoreActionUtility.m */,
|
AF43A5861FBB67D6008E9347 /* MVMCoreActionUtility.m */,
|
||||||
|
AFA4931D29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift */,
|
||||||
);
|
);
|
||||||
path = Helpers;
|
path = Helpers;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -756,7 +745,6 @@
|
|||||||
8876D5EC1FB50AB000EB2E3D /* NSDictionary+MFConvenience.h in Headers */,
|
8876D5EC1FB50AB000EB2E3D /* NSDictionary+MFConvenience.h in Headers */,
|
||||||
AFFCFA651FCCC0D700FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h in Headers */,
|
AFFCFA651FCCC0D700FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h in Headers */,
|
||||||
AF1201832108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h in Headers */,
|
AF1201832108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h in Headers */,
|
||||||
AFBB96981FBA3A9A0008D868 /* MVMCoreAlertController.h in Headers */,
|
|
||||||
881D26961FCC9D180079C521 /* MVMCoreOperation.h in Headers */,
|
881D26961FCC9D180079C521 /* MVMCoreOperation.h in Headers */,
|
||||||
8876D5EA1FB50AB000EB2E3D /* NSDecimalNumber+MFConvenience.h in Headers */,
|
8876D5EA1FB50AB000EB2E3D /* NSDecimalNumber+MFConvenience.h in Headers */,
|
||||||
AF43A7201FC5D2BA008E9347 /* MVMCoreViewManagerProtocol.h in Headers */,
|
AF43A7201FC5D2BA008E9347 /* MVMCoreViewManagerProtocol.h in Headers */,
|
||||||
@ -905,7 +893,6 @@
|
|||||||
BB780ADF250F8C890030BD2F /* ActionNoopModel.swift in Sources */,
|
BB780ADF250F8C890030BD2F /* ActionNoopModel.swift in Sources */,
|
||||||
D2E1FAD92260C3E400AEFD8C /* DelegateObject.swift in Sources */,
|
D2E1FAD92260C3E400AEFD8C /* DelegateObject.swift in Sources */,
|
||||||
01F2A03623A80A7300D954D8 /* ActionModelProtocol.swift in Sources */,
|
01F2A03623A80A7300D954D8 /* ActionModelProtocol.swift in Sources */,
|
||||||
AFBB96991FBA3A9A0008D868 /* MVMCoreAlertController.m in Sources */,
|
|
||||||
881D26941FCC9D180079C521 /* MVMCoreOperation.m in Sources */,
|
881D26941FCC9D180079C521 /* MVMCoreOperation.m in Sources */,
|
||||||
AFED77A41FCCA29400BAE689 /* MVMCoreViewControllerMappingObject.m in Sources */,
|
AFED77A41FCCA29400BAE689 /* MVMCoreViewControllerMappingObject.m in Sources */,
|
||||||
01C851CF23CF7B260021F976 /* JSONMap.swift in Sources */,
|
01C851CF23CF7B260021F976 /* JSONMap.swift in Sources */,
|
||||||
@ -916,6 +903,7 @@
|
|||||||
AF43A74D1FC6109F008E9347 /* MVMCoreSessionObject.m in Sources */,
|
AF43A74D1FC6109F008E9347 /* MVMCoreSessionObject.m in Sources */,
|
||||||
D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */,
|
D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */,
|
||||||
AFBB96901FBA3A9A0008D868 /* MVMCoreNavigationObject.m in Sources */,
|
AFBB96901FBA3A9A0008D868 /* MVMCoreNavigationObject.m in Sources */,
|
||||||
|
AFA4931E29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift in Sources */,
|
||||||
1DAD0FFE26AAB40000216E83 /* ActionRunJavaScriptModel.swift in Sources */,
|
1DAD0FFE26AAB40000216E83 /* ActionRunJavaScriptModel.swift in Sources */,
|
||||||
946EE1AB237B5C940036751F /* Decoder.swift in Sources */,
|
946EE1AB237B5C940036751F /* Decoder.swift in Sources */,
|
||||||
2723337D28BD53C2004EAEE0 /* Date+Extension.swift in Sources */,
|
2723337D28BD53C2004EAEE0 /* Date+Extension.swift in Sources */,
|
||||||
|
|||||||
@ -129,7 +129,7 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Logs the error.
|
/// Logs the error.
|
||||||
@objc open func defaultHandleActionError(_ error: MVMCoreErrorObject, additionalData: [AnyHashable: Any]?) {
|
@objc open func defaultHandleActionError(_ error: MVMCoreErrorObject, additionalData: [AnyHashable: Any]? = nil, delegateObject: DelegateObject? = nil) {
|
||||||
guard error.logError else { return }
|
guard error.logError else { return }
|
||||||
MVMCoreLoggingHandler.addError(toLog: error)
|
MVMCoreLoggingHandler.addError(toLog: error)
|
||||||
error.logError = false // Further attempts to log the same error will be skipped. (Legacy action flow.)
|
error.logError = false // Further attempts to log the same error will be skipped. (Legacy action flow.)
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
//
|
|
||||||
// MVMCoreAlertController.h
|
|
||||||
// alerts
|
|
||||||
//
|
|
||||||
// Created by Scott Pfeil on 10/22/14.
|
|
||||||
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
|
|
||||||
//
|
|
||||||
// Used by our alert handler. Not for subclassing. Simply keeps track of if it's visible. Tries to parallel the UIAlertView to make it easier for the MVMCoreAlertHandler.
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
@class MVMCoreAlertObject;
|
|
||||||
|
|
||||||
@interface MVMCoreAlertController : UIAlertController
|
|
||||||
|
|
||||||
@property (nonatomic, readonly, getter=isVisible) BOOL visible;
|
|
||||||
@property (nullable, nonatomic, strong) MVMCoreAlertObject *alertObject;
|
|
||||||
|
|
||||||
@end
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
//
|
|
||||||
// MVMAlertController.m
|
|
||||||
// alerts
|
|
||||||
//
|
|
||||||
// Created by Scott Pfeil on 10/22/14.
|
|
||||||
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "MVMCoreAlertController.h"
|
|
||||||
#import "MVMCoreLoggingHandler.h"
|
|
||||||
#import "MVMCoreGetterUtility.h"
|
|
||||||
|
|
||||||
@interface MVMCoreAlertController ()
|
|
||||||
|
|
||||||
@property (nonatomic, readwrite, getter=isVisible) BOOL visible;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MVMCoreAlertController
|
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated {
|
|
||||||
[super viewDidAppear:animated];
|
|
||||||
|
|
||||||
[self willChangeValueForKey:@"isVisible"];
|
|
||||||
self.visible = YES;
|
|
||||||
[self didChangeValueForKey:@"isVisible"];
|
|
||||||
[MVMCoreLoggingHandler logAlertForAlertController:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated {
|
|
||||||
[super viewDidDisappear:animated];
|
|
||||||
[self willChangeValueForKey:@"isVisible"];
|
|
||||||
self.visible = NO;
|
|
||||||
[self didChangeValueForKey:@"isVisible"];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)description {
|
|
||||||
return [NSString stringWithFormat:@"%@|title=%@|message=%@", [super description],self.title,self.message];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
|
||||||
if ([MVMCoreGetterUtility isOnIPad]) {
|
|
||||||
return UIInterfaceOrientationMaskAll;
|
|
||||||
} else {
|
|
||||||
return UIInterfaceOrientationMaskPortrait;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
@ -11,7 +11,6 @@
|
|||||||
#import <MVMCore/MVMCoreViewControllerProtocol.h>
|
#import <MVMCore/MVMCoreViewControllerProtocol.h>
|
||||||
@class MVMCoreRequestParameters;
|
@class MVMCoreRequestParameters;
|
||||||
@class MVMCoreErrorObject;
|
@class MVMCoreErrorObject;
|
||||||
@class MVMCoreAlertObject;
|
|
||||||
@class MVMCoreLoadObject;
|
@class MVMCoreLoadObject;
|
||||||
|
|
||||||
@protocol MVMCoreLoadDelegateProtocol
|
@protocol MVMCoreLoadDelegateProtocol
|
||||||
|
|||||||
@ -134,31 +134,7 @@
|
|||||||
|
|
||||||
- (nullable NSURLRequest *)requestWithParameters:(nonnull MVMCoreRequestParameters *)requestParameters error:(MVMCoreErrorObject *_Nonnull *_Nonnull)error {
|
- (nullable NSURLRequest *)requestWithParameters:(nonnull MVMCoreRequestParameters *)requestParameters error:(MVMCoreErrorObject *_Nonnull *_Nonnull)error {
|
||||||
|
|
||||||
NSURL *url = requestParameters.URL;
|
NSURL *url = [requestParameters resolveURL:[MVMCoreSessionObject sharedGlobal]];
|
||||||
if (!url) {
|
|
||||||
if (requestParameters.alternateBaseURL) {
|
|
||||||
url = requestParameters.alternateBaseURL;
|
|
||||||
} else {
|
|
||||||
url = [MVMCoreSessionObject sharedGlobal].baseURL ?: [NSURL URLWithString:URLProdPostpayBase];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Appends the context root.
|
|
||||||
if (requestParameters.contextRoot) {
|
|
||||||
url = [url URLByAppendingPathComponent:requestParameters.contextRoot];
|
|
||||||
} else if ([MVMCoreSessionObject sharedGlobal].contextRoot) {
|
|
||||||
url = [url URLByAppendingPathComponent:[MVMCoreSessionObject sharedGlobal].contextRoot];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Appends the page type
|
|
||||||
if (requestParameters.pageType) {
|
|
||||||
url = [url URLByAppendingPathComponent:requestParameters.pageType];
|
|
||||||
}
|
|
||||||
|
|
||||||
// This has changed since the initial agreement. Seems server always needs page type now.
|
|
||||||
/* else if (requestParameters.modules) {
|
|
||||||
url = [url URLByAppendingPathComponent:KeyModuleMap];
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adds modules needed to the request parameters.
|
// Adds modules needed to the request parameters.
|
||||||
if (requestParameters.modules.count > 0) {
|
if (requestParameters.modules.count > 0) {
|
||||||
|
|||||||
@ -111,6 +111,8 @@
|
|||||||
- (void)main {
|
- (void)main {
|
||||||
MVMCoreLog(@"Load Operation begun for page type %@, background load %@, delegate %@", self.requestParameters.pageType, @(self.backgroundLoad),self.delegateObject.loadDelegate);
|
MVMCoreLog(@"Load Operation begun for page type %@, background load %@, delegate %@", self.requestParameters.pageType, @(self.backgroundLoad),self.delegateObject.loadDelegate);
|
||||||
|
|
||||||
|
[self.requestParameters resolveURL:[MVMCoreSessionObject sharedGlobal]];
|
||||||
|
|
||||||
// Always check for cancellation before launching the task.
|
// Always check for cancellation before launching the task.
|
||||||
if ([self checkAndHandleForCancellation]) {
|
if ([self checkAndHandleForCancellation]) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <MVMCore/MVMCoreSessionObject.h>
|
||||||
|
|
||||||
// The loading style.
|
// The loading style.
|
||||||
// MFLoadStyleDefault: This means it has not been explicitely set by the developer. Standard push.
|
// MFLoadStyleDefault: This means it has not been explicitely set by the developer. Standard push.
|
||||||
@ -124,4 +125,7 @@ typedef NS_ENUM(NSInteger, MFLoadStyle) {
|
|||||||
/// Returns optional and required modules
|
/// Returns optional and required modules
|
||||||
- (nullable NSArray<NSString *> *)allModules;
|
- (nullable NSArray<NSString *> *)allModules;
|
||||||
|
|
||||||
|
/// Resolves the URL given the session object and the current request parameters.
|
||||||
|
- (nonnull NSURL *)resolveURL:(nonnull MVMCoreSessionObject *)sessionObject;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -10,9 +10,12 @@
|
|||||||
#import "NSDictionary+MFConvenience.h"
|
#import "NSDictionary+MFConvenience.h"
|
||||||
#import "MVMCoreJSONConstants.h"
|
#import "MVMCoreJSONConstants.h"
|
||||||
#import "MVMCoreViewControllerMappingObject.h"
|
#import "MVMCoreViewControllerMappingObject.h"
|
||||||
|
#import "MVMCoreConstants.h"
|
||||||
|
|
||||||
@interface MVMCoreRequestParameters ()
|
@interface MVMCoreRequestParameters ()
|
||||||
|
|
||||||
|
@property (nonatomic, strong, nullable) NSURL *determinedURL;
|
||||||
|
|
||||||
- (nullable instancetype)initWithExtraParameters:(nullable NSDictionary *)extraParameters;
|
- (nullable instancetype)initWithExtraParameters:(nullable NSDictionary *)extraParameters;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -86,6 +89,56 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setAlternateBaseURL:(NSURL *)alternateBaseURL {
|
||||||
|
_alternateBaseURL = alternateBaseURL;
|
||||||
|
_URL = self.determinedURL; // Reset resolution when changed.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setPageType:(NSString *)pageType {
|
||||||
|
_pageType = pageType;
|
||||||
|
_URL = self.determinedURL; // Reset resolution when changed.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setContextRoot:(NSString *)contextRoot {
|
||||||
|
_contextRoot = contextRoot;
|
||||||
|
_URL = self.determinedURL; // Reset resolution when changed.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setURL:(NSURL *)URL {
|
||||||
|
self.determinedURL = URL; // If set directly, this becomes the ultimate URL.
|
||||||
|
_URL = URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSURL *)resolveURL:(MVMCoreSessionObject *)sessionObject {
|
||||||
|
|
||||||
|
if (self.URL) {
|
||||||
|
// Previously resovled.
|
||||||
|
return self.URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSURL *url;
|
||||||
|
if (self.alternateBaseURL) {
|
||||||
|
url = self.alternateBaseURL;
|
||||||
|
} else {
|
||||||
|
url = sessionObject.baseURL ?: [NSURL URLWithString:URLProdPostpayBase];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Appends the context root.
|
||||||
|
if (self.contextRoot) {
|
||||||
|
url = [url URLByAppendingPathComponent:self.contextRoot];
|
||||||
|
} else if (sessionObject.contextRoot) {
|
||||||
|
url = [url URLByAppendingPathComponent:[MVMCoreSessionObject sharedGlobal].contextRoot];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Appends the page type
|
||||||
|
if (self.pageType) {
|
||||||
|
url = [url URLByAppendingPathComponent:self.pageType];
|
||||||
|
}
|
||||||
|
|
||||||
|
_URL = url;
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)addRequestParameters:(nonnull NSDictionary *)parameters {
|
- (void)addRequestParameters:(nonnull NSDictionary *)parameters {
|
||||||
|
|
||||||
if ([parameters count] > 0) {
|
if ([parameters count] > 0) {
|
||||||
@ -152,6 +205,7 @@
|
|||||||
copyObject.customTimeoutTime = self.customTimeoutTime;
|
copyObject.customTimeoutTime = self.customTimeoutTime;
|
||||||
copyObject.backgroundRequest = self.backgroundRequest;
|
copyObject.backgroundRequest = self.backgroundRequest;
|
||||||
copyObject.URL = self.URL;
|
copyObject.URL = self.URL;
|
||||||
|
copyObject.determinedURL = self.determinedURL;
|
||||||
copyObject.actionMap = self.actionMap;
|
copyObject.actionMap = self.actionMap;
|
||||||
return copyObject;
|
return copyObject;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[];
|
|||||||
#import <MVMCore/MVMCorePresentViewControllerOperation.h>
|
#import <MVMCore/MVMCorePresentViewControllerOperation.h>
|
||||||
#import <MVMCore/MVMCoreNavigationOperation.h>
|
#import <MVMCore/MVMCoreNavigationOperation.h>
|
||||||
#import <MVMCore/MVMCoreViewControllerAnimatedTransitioning.h>
|
#import <MVMCore/MVMCoreViewControllerAnimatedTransitioning.h>
|
||||||
#import <MVMCore/MVMCoreAlertController.h>
|
|
||||||
|
|
||||||
// Action Handling
|
// Action Handling
|
||||||
#import <MVMCore/MVMCoreActionDelegateProtocol.h>
|
#import <MVMCore/MVMCoreActionDelegateProtocol.h>
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
@class MVMCoreAlertController;
|
|
||||||
|
|
||||||
@protocol MVMCoreLoggingDelegateProtocol <NSObject>
|
@protocol MVMCoreLoggingDelegateProtocol <NSObject>
|
||||||
|
|
||||||
@ -25,7 +24,4 @@
|
|||||||
// Log that the load has finished.
|
// Log that the load has finished.
|
||||||
- (void)logLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController <MVMCoreViewControllerProtocol> *)loadedViewController error:(nullable MVMCoreErrorObject *)error;
|
- (void)logLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController <MVMCoreViewControllerProtocol> *)loadedViewController error:(nullable MVMCoreErrorObject *)error;
|
||||||
|
|
||||||
// Log alert
|
|
||||||
- (void)logAlertForAlertController:(nullable MVMCoreAlertController *)alertController;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
#import <MVMCore/MVMCoreViewControllerProtocol.h>
|
#import <MVMCore/MVMCoreViewControllerProtocol.h>
|
||||||
#import <MVMCore/MVMCoreLoadObject.h>
|
#import <MVMCore/MVMCoreLoadObject.h>
|
||||||
#import <MVMCore/MVMCoreLoggingDelegateProtocol.h>
|
#import <MVMCore/MVMCoreLoggingDelegateProtocol.h>
|
||||||
@class MVMCoreAlertController;
|
|
||||||
|
|
||||||
#define MVMCoreLog(fmt, ...) \
|
#define MVMCoreLog(fmt, ...) \
|
||||||
[MVMCoreLoggingHandler logDebugMessageWithDelegate:[NSString stringWithFormat:(@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__]];
|
[MVMCoreLoggingHandler logDebugMessageWithDelegate:[NSString stringWithFormat:(@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__]];
|
||||||
@ -24,7 +23,6 @@
|
|||||||
+ (void)logDebugMessageWithDelegate:(nullable NSString *)message;
|
+ (void)logDebugMessageWithDelegate:(nullable NSString *)message;
|
||||||
+ (void)logWithDelegateWithObject:(nullable id)object withName:(nullable NSString *)name withExtraInfo:(nullable NSDictionary *)extra;
|
+ (void)logWithDelegateWithObject:(nullable id)object withName:(nullable NSString *)name withExtraInfo:(nullable NSDictionary *)extra;
|
||||||
+ (void)logWithDelegateLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController <MVMCoreViewControllerProtocol> *)loadedViewController error:(nullable MVMCoreErrorObject *)error;
|
+ (void)logWithDelegateLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController <MVMCoreViewControllerProtocol> *)loadedViewController error:(nullable MVMCoreErrorObject *)error;
|
||||||
+ (void)logAlertForAlertController:(nullable MVMCoreAlertController *)alertController;
|
|
||||||
- (void)recordEvent:(nonnull NSString *)name attributes:(nullable NSDictionary<NSString *, id> *)attributes;
|
- (void)recordEvent:(nonnull NSString *)name attributes:(nullable NSDictionary<NSString *, id> *)attributes;
|
||||||
|
|
||||||
#pragma mark MVMCoreLoggingDelegateProtocol
|
#pragma mark MVMCoreLoggingDelegateProtocol
|
||||||
|
|||||||
@ -45,12 +45,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)logAlertForAlertController:(nullable MVMCoreAlertController *)alertController {
|
|
||||||
if ([[MVMCoreObject sharedInstance].loggingDelegate respondsToSelector:@selector(logAlertForAlertController:)]) {
|
|
||||||
[[MVMCoreObject sharedInstance].loggingDelegate logAlertForAlertController:alertController];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)recordEvent:(nonnull NSString *)name attributes:(nullable NSDictionary<NSString *, id> *)attributes {}
|
- (void)recordEvent:(nonnull NSString *)name attributes:(nullable NSDictionary<NSString *, id> *)attributes {}
|
||||||
|
|
||||||
#pragma mark - logging delegate
|
#pragma mark - logging delegate
|
||||||
|
|||||||
@ -136,9 +136,6 @@
|
|||||||
// Use this to dismiss all presented view controllers stacked on the bottom one.
|
// Use this to dismiss all presented view controllers stacked on the bottom one.
|
||||||
- (void)dismissToBottom:(BOOL)animated;
|
- (void)dismissToBottom:(BOOL)animated;
|
||||||
|
|
||||||
// Removes all queued up items.
|
|
||||||
- (void)cancelPresentation;
|
|
||||||
|
|
||||||
#pragma mark - Presentation Extra
|
#pragma mark - Presentation Extra
|
||||||
|
|
||||||
// Use this to present.
|
// Use this to present.
|
||||||
|
|||||||
@ -46,9 +46,6 @@
|
|||||||
self.navigationQueue = [[NSOperationQueue alloc] init];
|
self.navigationQueue = [[NSOperationQueue alloc] init];
|
||||||
self.navigationQueue.maxConcurrentOperationCount = 1;
|
self.navigationQueue.maxConcurrentOperationCount = 1;
|
||||||
|
|
||||||
self.presentationQueue = [[NSOperationQueue alloc] init];
|
|
||||||
self.presentationQueue.maxConcurrentOperationCount = 1;
|
|
||||||
|
|
||||||
self.delegates = (NSHashTable <MVMCorePresentationDelegateProtocol>*)[NSHashTable weakObjectsHashTable];
|
self.delegates = (NSHashTable <MVMCorePresentationDelegateProtocol>*)[NSHashTable weakObjectsHashTable];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
@ -308,10 +305,6 @@
|
|||||||
[self dismissToBottom:animated delegate:nil completionHandler:NULL];
|
[self dismissToBottom:animated delegate:nil completionHandler:NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cancelPresentation {
|
|
||||||
[self.presentationQueue cancelAllOperations];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Presentation Extra
|
#pragma mark - Presentation Extra
|
||||||
|
|
||||||
- (void)presentViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated delegate:(nullable NSObject<MVMCorePresentationDelegateProtocol>*)delegate completionHandler:(nullable void (^)(void))completionBlock {
|
- (void)presentViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated delegate:(nullable NSObject<MVMCorePresentationDelegateProtocol>*)delegate completionHandler:(nullable void (^)(void))completionBlock {
|
||||||
@ -325,7 +318,7 @@
|
|||||||
MVMCorePresentViewControllerOperation *operation = [[MVMCorePresentViewControllerOperation alloc] initWithPresentingViewController:controllerToPresentOn presentedViewController:viewController animated:animated];
|
MVMCorePresentViewControllerOperation *operation = [[MVMCorePresentViewControllerOperation alloc] initWithPresentingViewController:controllerToPresentOn presentedViewController:viewController animated:animated];
|
||||||
operation.delegate = delegate;
|
operation.delegate = delegate;
|
||||||
operation.completionBlock = completionBlock;
|
operation.completionBlock = completionBlock;
|
||||||
[self.presentationQueue addOperation:operation];
|
[self.navigationQueue addOperation:operation];
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MVMCorePresentViewControllerOperation.h"
|
#import "MVMCorePresentViewControllerOperation.h"
|
||||||
#import "MVMCoreAlertController.h"
|
|
||||||
#import "MVMCorePresentAnimationOperation.h"
|
#import "MVMCorePresentAnimationOperation.h"
|
||||||
#import "MVMCoreDispatchUtility.h"
|
#import "MVMCoreDispatchUtility.h"
|
||||||
#import "MVMCoreConstants.h"
|
#import "MVMCoreConstants.h"
|
||||||
@ -18,20 +17,10 @@
|
|||||||
@property (nullable, strong, nonatomic) UIViewController *presentedViewController;
|
@property (nullable, strong, nonatomic) UIViewController *presentedViewController;
|
||||||
@property (nonatomic) BOOL animate;
|
@property (nonatomic) BOOL animate;
|
||||||
|
|
||||||
@property (nonatomic) BOOL beingObserved;
|
|
||||||
@property (nullable, weak, nonatomic) MVMCoreAlertController *alertController;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MVMCorePresentViewControllerOperation
|
@implementation MVMCorePresentViewControllerOperation
|
||||||
|
|
||||||
// The context for kvo
|
|
||||||
static void * XXContext = &XXContext;
|
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[self stopObservingAlertView];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (nullable instancetype)initWithPresentingViewController:(nullable UIViewController *)presentingViewController presentedViewController:(nullable UIViewController *)presentedViewController animated:(BOOL)animated {
|
- (nullable instancetype)initWithPresentingViewController:(nullable UIViewController *)presentingViewController presentedViewController:(nullable UIViewController *)presentedViewController animated:(BOOL)animated {
|
||||||
|
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
@ -67,57 +56,19 @@ static void * XXContext = &XXContext;
|
|||||||
controllerToPresentOn = controllerToPresentOn.presentedViewController;
|
controllerToPresentOn = controllerToPresentOn.presentedViewController;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If an alert is showing, don't present until the alerts are dismissed.
|
MVMCorePresentAnimationOperation *animationOperation = [[MVMCorePresentAnimationOperation alloc] initWithPresentingViewController:controllerToPresentOn presentedViewController:self.presentedViewController animated:self.animate];
|
||||||
if ([controllerToPresentOn isKindOfClass:[MVMCoreAlertController class]]) {
|
animationOperation.delegate = self.delegate;
|
||||||
[self observeForAlertDismissal:(MVMCoreAlertController *)controllerToPresentOn];
|
[animationOperation setCompletionBlock:^{
|
||||||
} else {
|
[self markAsFinished];
|
||||||
MVMCorePresentAnimationOperation *animationOperation = [[MVMCorePresentAnimationOperation alloc] initWithPresentingViewController:controllerToPresentOn presentedViewController:self.presentedViewController animated:self.animate];
|
// Notify that page has changed
|
||||||
animationOperation.delegate = self.delegate;
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
[animationOperation setCompletionBlock:^{
|
[[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil];
|
||||||
[self markAsFinished];
|
});
|
||||||
// Notify that page has changed
|
}];
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
[[NSOperationQueue mainQueue] addOperation:animationOperation];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil];
|
|
||||||
});
|
|
||||||
}];
|
|
||||||
[[NSOperationQueue mainQueue] addOperation:animationOperation];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
[self markAsFinished];
|
[self markAsFinished];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cancel {
|
|
||||||
[super cancel];
|
|
||||||
[self stopObservingAlertView];
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Observer Functions
|
|
||||||
|
|
||||||
- (void)observeForAlertDismissal:(MVMCoreAlertController *)alertController {
|
|
||||||
if (!self.beingObserved) {
|
|
||||||
self.beingObserved = YES;
|
|
||||||
self.alertController = alertController;
|
|
||||||
[alertController addObserver:self forKeyPath:@"visible" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:XXContext];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)stopObservingAlertView {
|
|
||||||
if (self.beingObserved) {
|
|
||||||
[self.alertController removeObserver:self forKeyPath:@"visible" context:XXContext];
|
|
||||||
self.alertController = nil;
|
|
||||||
self.beingObserved = NO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
|
||||||
|
|
||||||
if (context == XXContext && [keyPath isEqualToString:@"visible"]) {
|
|
||||||
if (![object isVisible]) {
|
|
||||||
[self stopObservingAlertView];
|
|
||||||
[self present];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// MVMCoreActionUtility+Extension.swift
|
||||||
|
// MVMCore
|
||||||
|
//
|
||||||
|
// Created by Scott Pfeil on 4/11/23.
|
||||||
|
// Copyright © 2023 myverizon. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
public extension MVMCoreActionUtility {
|
||||||
|
static func fatalClassCheck<T>(object: AnyObject?) -> T {
|
||||||
|
guard let object = object else {
|
||||||
|
fatalError("Object \(T.self) is nil.")
|
||||||
|
}
|
||||||
|
guard let instance = object as? T else {
|
||||||
|
fatalError("\(object) is not an instance of \(T.self)")
|
||||||
|
}
|
||||||
|
return instance
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user