Merge branch 'develop' of gitlab.verizon.com:BPHV_MIPS/mvm_core into develop

This commit is contained in:
Kevin G Christiano 2020-10-30 14:23:13 -04:00
commit 499879a5a5
37 changed files with 14 additions and 2303 deletions

View File

@ -21,20 +21,14 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
0184D3DB24B7D5A600A05369 /* ActionAlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0184D3DA24B7D5A600A05369 /* ActionAlertModel.swift */; };
0184D3E324B8D0C600A05369 /* MVMCoreAlertObject+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0184D3E224B8D0C600A05369 /* MVMCoreAlertObject+Swift.swift */; };
0184D3FD24BE54A300A05369 /* UIAlertActionStyle+Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0184D3FC24BE54A300A05369 /* UIAlertActionStyle+Codable.swift */; };
0184D3FF24BE554A00A05369 /* AlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0184D3FE24BE554A00A05369 /* AlertModel.swift */; };
01C851CF23CF7B260021F976 /* JSONMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01C851CE23CF7B260021F976 /* JSONMap.swift */; };
01C851D123CF97FE0021F976 /* ActionBackModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01C851D023CF97FE0021F976 /* ActionBackModel.swift */; };
01DF561421F90ADC00CC099B /* Dictionary+MFConvenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF561321F90ADC00CC099B /* Dictionary+MFConvenience.swift */; };
01F2A03623A80A7300D954D8 /* ActionModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03523A80A7300D954D8 /* ActionModelProtocol.swift */; };
01F2A03923A812DD00D954D8 /* ActionOpenUrlModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03823A812DD00D954D8 /* ActionOpenUrlModel.swift */; };
01F2A04C23A82B1B00D954D8 /* ActionCallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A04B23A82B1B00D954D8 /* ActionCallModel.swift */; };
01F2A04E23A82CF500D954D8 /* ActionPopupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A04D23A82CF500D954D8 /* ActionPopupModel.swift */; };
01F2A05223A8325100D954D8 /* ModelMapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A05123A8325100D954D8 /* ModelMapping.swift */; };
0A42538F23F3414800554656 /* Codable+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A42538E23F3414800554656 /* Codable+Helpers.swift */; };
0A62624824C1DFDC00C316B9 /* UIAlertControllerStyle+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A62624724C1DFDC00C316B9 /* UIAlertControllerStyle+Extension.swift */; };
0AFF597A23FC6E60005C24E8 /* ActionShareModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AFF597923FC6E60005C24E8 /* ActionShareModel.swift */; };
30349BF11FCCA78A00546A1E /* MVMCoreSessionTimeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 30349BEF1FCCA78A00546A1E /* MVMCoreSessionTimeHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
30349BF21FCCA78A00546A1E /* MVMCoreSessionTimeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 30349BF01FCCA78A00546A1E /* MVMCoreSessionTimeHandler.m */; };
@ -114,19 +108,6 @@
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 */; };
AFBB969A1FBA3A9A0008D868 /* MVMCoreAlertDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB967D1FBA3A9A0008D868 /* MVMCoreAlertDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB969B1FBA3A9A0008D868 /* MVMCoreAlertHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB967E1FBA3A9A0008D868 /* MVMCoreAlertHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB969C1FBA3A9A0008D868 /* MVMCoreAlertHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB967F1FBA3A9A0008D868 /* MVMCoreAlertHandler.m */; };
AFBB969D1FBA3A9A0008D868 /* MVMCoreAlertObject.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96801FBA3A9A0008D868 /* MVMCoreAlertObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB969E1FBA3A9A0008D868 /* MVMCoreAlertObject.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96811FBA3A9A0008D868 /* MVMCoreAlertObject.m */; };
AFBB969F1FBA3A9A0008D868 /* MVMCoreAlertOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96821FBA3A9A0008D868 /* MVMCoreAlertOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB96A01FBA3A9A0008D868 /* MVMCoreAlertOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96831FBA3A9A0008D868 /* MVMCoreAlertOperation.m */; };
AFBB96A11FBA3A9A0008D868 /* MVMCoreTopAlertAnimationDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96841FBA3A9A0008D868 /* MVMCoreTopAlertAnimationDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB96A21FBA3A9A0008D868 /* MVMCoreTopAlertDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96851FBA3A9A0008D868 /* MVMCoreTopAlertDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB96A31FBA3A9A0008D868 /* MVMCoreTopAlertObject.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96861FBA3A9A0008D868 /* MVMCoreTopAlertObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB96A41FBA3A9A0008D868 /* MVMCoreTopAlertObject.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96871FBA3A9A0008D868 /* MVMCoreTopAlertObject.m */; };
AFBB96A51FBA3A9A0008D868 /* MVMCoreTopAlertOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96881FBA3A9A0008D868 /* MVMCoreTopAlertOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFBB96A61FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96891FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m */; };
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 */; };
AFBB96B21FBA3B590008D868 /* MVMCoreGetterUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -136,8 +117,6 @@
AFBB96BA1FBA3CEC0008D868 /* MVMCoreActionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96B71FBA3CEC0008D868 /* MVMCoreActionHandler.m */; };
AFBB96EC1FBA4A260008D868 /* MFHardCodedServerResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96E91FBA4A260008D868 /* MFHardCodedServerResponse.h */; };
AFBB96ED1FBA4A260008D868 /* MFHardCodedServerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96EA1FBA4A260008D868 /* MFHardCodedServerResponse.m */; };
AFC5FA161FFC2E2A00C244CF /* MVMCoreGlobalTopAlertDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFC5FA141FFC2E2A00C244CF /* MVMCoreGlobalTopAlertDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFC5FA1D1FFC39C700C244CF /* MVMCoreTopAlertViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFC5FA1C1FFC39C700C244CF /* MVMCoreTopAlertViewProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFEA17A8209B6A1C00BC6740 /* MVMCoreBlockOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AFEA17A6209B6A1C00BC6740 /* MVMCoreBlockOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFEA17A9209B6A1C00BC6740 /* MVMCoreBlockOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AFEA17A7209B6A1C00BC6740 /* MVMCoreBlockOperation.m */; };
AFED77A11FCCA29400BAE689 /* MVMCoreViewControllerNibMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = AFED77991FCCA29300BAE689 /* MVMCoreViewControllerNibMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -158,7 +137,6 @@
BB780ADF250F8C890030BD2F /* ActionNoopModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB780ADE250F8C890030BD2F /* ActionNoopModel.swift */; };
D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */; };
D282AAB82240342D00C46919 /* NSNumber+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB72240342D00C46919 /* NSNumber+Extension.swift */; };
D2CAC7C82510F0C500C75681 /* MVMCoreAlertHandler+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2CAC7C72510F0C500C75681 /* MVMCoreAlertHandler+Extension.swift */; };
D2DEDCB723C63F3B00C44CC4 /* Clamping.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */; };
D2DEDCB923C6400600C44CC4 /* UnitInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCB823C6400600C44CC4 /* UnitInterval.swift */; };
D2DEDCBB23C65BC300C44CC4 /* Percent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCBA23C65BC300C44CC4 /* Percent.swift */; };
@ -166,22 +144,16 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0184D3DA24B7D5A600A05369 /* ActionAlertModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionAlertModel.swift; sourceTree = "<group>"; };
0184D3E224B8D0C600A05369 /* MVMCoreAlertObject+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreAlertObject+Swift.swift"; sourceTree = "<group>"; };
0184D3FC24BE54A300A05369 /* UIAlertActionStyle+Codable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAlertActionStyle+Codable.swift"; sourceTree = "<group>"; };
0184D3FE24BE554A00A05369 /* AlertModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertModel.swift; sourceTree = "<group>"; };
01C851CE23CF7B260021F976 /* JSONMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONMap.swift; sourceTree = "<group>"; };
01C851D023CF97FE0021F976 /* ActionBackModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionBackModel.swift; sourceTree = "<group>"; };
01DF561321F90ADC00CC099B /* Dictionary+MFConvenience.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Dictionary+MFConvenience.swift"; sourceTree = "<group>"; };
01F2A03523A80A7300D954D8 /* ActionModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionModelProtocol.swift; sourceTree = "<group>"; };
01F2A03823A812DD00D954D8 /* ActionOpenUrlModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenUrlModel.swift; sourceTree = "<group>"; };
01F2A04B23A82B1B00D954D8 /* ActionCallModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCallModel.swift; sourceTree = "<group>"; };
01F2A04D23A82CF500D954D8 /* ActionPopupModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionPopupModel.swift; sourceTree = "<group>"; };
01F2A05123A8325100D954D8 /* ModelMapping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelMapping.swift; sourceTree = "<group>"; };
0A11030B20864F94008ADD90 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
0A11030C20864F9A008ADD90 /* es-MX */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-MX"; path = "es-MX.lproj/Localizable.strings"; sourceTree = "<group>"; };
0A42538E23F3414800554656 /* Codable+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Codable+Helpers.swift"; sourceTree = "<group>"; };
0A62624724C1DFDC00C316B9 /* UIAlertControllerStyle+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAlertControllerStyle+Extension.swift"; sourceTree = "<group>"; };
0AFF597923FC6E60005C24E8 /* ActionShareModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionShareModel.swift; sourceTree = "<group>"; };
30349BEF1FCCA78A00546A1E /* MVMCoreSessionTimeHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreSessionTimeHandler.h; sourceTree = "<group>"; };
30349BF01FCCA78A00546A1E /* MVMCoreSessionTimeHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreSessionTimeHandler.m; sourceTree = "<group>"; };
@ -266,19 +238,6 @@
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>"; };
AFBB967D1FBA3A9A0008D868 /* MVMCoreAlertDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertDelegateProtocol.h; sourceTree = "<group>"; };
AFBB967E1FBA3A9A0008D868 /* MVMCoreAlertHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertHandler.h; sourceTree = "<group>"; };
AFBB967F1FBA3A9A0008D868 /* MVMCoreAlertHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertHandler.m; sourceTree = "<group>"; };
AFBB96801FBA3A9A0008D868 /* MVMCoreAlertObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertObject.h; sourceTree = "<group>"; };
AFBB96811FBA3A9A0008D868 /* MVMCoreAlertObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertObject.m; sourceTree = "<group>"; };
AFBB96821FBA3A9A0008D868 /* MVMCoreAlertOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertOperation.h; sourceTree = "<group>"; };
AFBB96831FBA3A9A0008D868 /* MVMCoreAlertOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertOperation.m; sourceTree = "<group>"; };
AFBB96841FBA3A9A0008D868 /* MVMCoreTopAlertAnimationDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertAnimationDelegateProtocol.h; sourceTree = "<group>"; };
AFBB96851FBA3A9A0008D868 /* MVMCoreTopAlertDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertDelegateProtocol.h; sourceTree = "<group>"; };
AFBB96861FBA3A9A0008D868 /* MVMCoreTopAlertObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertObject.h; sourceTree = "<group>"; };
AFBB96871FBA3A9A0008D868 /* MVMCoreTopAlertObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreTopAlertObject.m; sourceTree = "<group>"; };
AFBB96881FBA3A9A0008D868 /* MVMCoreTopAlertOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertOperation.h; sourceTree = "<group>"; };
AFBB96891FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreTopAlertOperation.m; 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>"; };
AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreGetterUtility.h; sourceTree = "<group>"; };
@ -289,8 +248,6 @@
AFBB96D21FBA44420008D868 /* VZWAuthentication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VZWAuthentication.framework; path = ../../SharedFrameworks/VZWAuthentication.framework; sourceTree = "<group>"; };
AFBB96E91FBA4A260008D868 /* MFHardCodedServerResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFHardCodedServerResponse.h; sourceTree = "<group>"; };
AFBB96EA1FBA4A260008D868 /* MFHardCodedServerResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFHardCodedServerResponse.m; sourceTree = "<group>"; };
AFC5FA141FFC2E2A00C244CF /* MVMCoreGlobalTopAlertDelegateProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreGlobalTopAlertDelegateProtocol.h; sourceTree = "<group>"; };
AFC5FA1C1FFC39C700C244CF /* MVMCoreTopAlertViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertViewProtocol.h; sourceTree = "<group>"; };
AFEA17A6209B6A1C00BC6740 /* MVMCoreBlockOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreBlockOperation.h; sourceTree = "<group>"; };
AFEA17A7209B6A1C00BC6740 /* MVMCoreBlockOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreBlockOperation.m; sourceTree = "<group>"; };
AFED77991FCCA29300BAE689 /* MVMCoreViewControllerNibMappingObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreViewControllerNibMappingObject.h; sourceTree = "<group>"; };
@ -311,7 +268,6 @@
BB780ADE250F8C890030BD2F /* ActionNoopModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionNoopModel.swift; sourceTree = "<group>"; };
D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreGetterUtility+Extension.swift"; sourceTree = "<group>"; };
D282AAB72240342D00C46919 /* NSNumber+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSNumber+Extension.swift"; sourceTree = "<group>"; };
D2CAC7C72510F0C500C75681 /* MVMCoreAlertHandler+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreAlertHandler+Extension.swift"; sourceTree = "<group>"; };
D2DEDCB623C63F3B00C44CC4 /* Clamping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Clamping.swift; sourceTree = "<group>"; };
D2DEDCB823C6400600C44CC4 /* UnitInterval.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnitInterval.swift; sourceTree = "<group>"; };
D2DEDCBA23C65BC300C44CC4 /* Percent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Percent.swift; sourceTree = "<group>"; };
@ -330,15 +286,6 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0A62624624C1DFB700C316B9 /* Alert Extensions */ = {
isa = PBXGroup;
children = (
0184D3FC24BE54A300A05369 /* UIAlertActionStyle+Codable.swift */,
0A62624724C1DFDC00C316B9 /* UIAlertControllerStyle+Extension.swift */,
);
path = "Alert Extensions";
sourceTree = "<group>";
};
8876D5BF1FB50A9E00EB2E3D = {
isa = PBXGroup;
children = (
@ -458,13 +405,10 @@
946EE1B6237B66630036751F /* ActionType */ = {
isa = PBXGroup;
children = (
0A62624624C1DFB700C316B9 /* Alert Extensions */,
01F2A03523A80A7300D954D8 /* ActionModelProtocol.swift */,
946EE1BB237B691A0036751F /* ActionOpenPageModel.swift */,
01F2A03823A812DD00D954D8 /* ActionOpenUrlModel.swift */,
0184D3DA24B7D5A600A05369 /* ActionAlertModel.swift */,
01F2A04B23A82B1B00D954D8 /* ActionCallModel.swift */,
01F2A04D23A82CF500D954D8 /* ActionPopupModel.swift */,
01C851D023CF97FE0021F976 /* ActionBackModel.swift */,
0AFF597923FC6E60005C24E8 /* ActionShareModel.swift */,
94C014D024211869005811A9 /* ActionRestartModel.swift */,
@ -472,7 +416,6 @@
94C014D424211AF0005811A9 /* ActionCancelModel.swift */,
94C014D824212360005811A9 /* ActionSettingModel.swift */,
BB780ADE250F8C890030BD2F /* ActionNoopModel.swift */,
0184D3FE24BE554A00A05369 /* AlertModel.swift */,
);
path = ActionType;
sourceTree = "<group>";
@ -516,7 +459,6 @@
AF43A7401FC5FA6F008E9347 /* MVMCoreViewProtocol.h */,
AFEEE8181FCDDE6B00B5EDD0 /* MVMCoreLoggingDelegateProtocol.h */,
AF43A7001FC4B227008E9347 /* MVMCoreGlobalLoadProtocol.h */,
AFC5FA141FFC2E2A00C244CF /* MVMCoreGlobalTopAlertDelegateProtocol.h */,
);
path = MainProtocols;
sourceTree = "<group>";
@ -594,22 +536,6 @@
children = (
AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */,
AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */,
AFBB967D1FBA3A9A0008D868 /* MVMCoreAlertDelegateProtocol.h */,
AFBB967E1FBA3A9A0008D868 /* MVMCoreAlertHandler.h */,
AFBB967F1FBA3A9A0008D868 /* MVMCoreAlertHandler.m */,
D2CAC7C72510F0C500C75681 /* MVMCoreAlertHandler+Extension.swift */,
AFBB96801FBA3A9A0008D868 /* MVMCoreAlertObject.h */,
AFBB96811FBA3A9A0008D868 /* MVMCoreAlertObject.m */,
0184D3E224B8D0C600A05369 /* MVMCoreAlertObject+Swift.swift */,
AFBB96821FBA3A9A0008D868 /* MVMCoreAlertOperation.h */,
AFBB96831FBA3A9A0008D868 /* MVMCoreAlertOperation.m */,
AFBB96841FBA3A9A0008D868 /* MVMCoreTopAlertAnimationDelegateProtocol.h */,
AFBB96851FBA3A9A0008D868 /* MVMCoreTopAlertDelegateProtocol.h */,
AFC5FA1C1FFC39C700C244CF /* MVMCoreTopAlertViewProtocol.h */,
AFBB96861FBA3A9A0008D868 /* MVMCoreTopAlertObject.h */,
AFBB96871FBA3A9A0008D868 /* MVMCoreTopAlertObject.m */,
AFBB96881FBA3A9A0008D868 /* MVMCoreTopAlertOperation.h */,
AFBB96891FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m */,
);
path = AlertHandling;
sourceTree = "<group>";
@ -708,7 +634,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
AFBB96A21FBA3A9A0008D868 /* MVMCoreTopAlertDelegateProtocol.h in Headers */,
AF43A7411FC5FA6F008E9347 /* MVMCoreViewProtocol.h in Headers */,
AFBB96EC1FBA4A260008D868 /* MFHardCodedServerResponse.h in Headers */,
AFBB96B21FBA3B590008D868 /* MVMCoreGetterUtility.h in Headers */,
@ -721,7 +646,6 @@
8876D5EC1FB50AB000EB2E3D /* NSDictionary+MFConvenience.h in Headers */,
AFFCFA651FCCC0D700FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h in Headers */,
AF1201832108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h in Headers */,
AFBB96A31FBA3A9A0008D868 /* MVMCoreTopAlertObject.h in Headers */,
AFBB96981FBA3A9A0008D868 /* MVMCoreAlertController.h in Headers */,
881D26961FCC9D180079C521 /* MVMCoreOperation.h in Headers */,
8876D5EA1FB50AB000EB2E3D /* NSDecimalNumber+MFConvenience.h in Headers */,
@ -730,8 +654,6 @@
AFBB96341FBA34310008D868 /* MVMCoreErrorConstants.h in Headers */,
A332F33F20C7231700DCD9D9 /* MVMCoreViewControllerAnimatedTransitioning.h in Headers */,
AFBB968D1FBA3A9A0008D868 /* MVMCoreNavigationHandler.h in Headers */,
AFBB96A51FBA3A9A0008D868 /* MVMCoreTopAlertOperation.h in Headers */,
AFBB96A11FBA3A9A0008D868 /* MVMCoreTopAlertAnimationDelegateProtocol.h in Headers */,
AFBB96951FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h in Headers */,
AFED77A51FCCA29400BAE689 /* MVMCoreViewControllerProgrammaticMappingObject.h in Headers */,
AF43A5871FBB67D6008E9347 /* MVMCoreActionUtility.h in Headers */,
@ -739,9 +661,7 @@
AFBB96601FBA3A570008D868 /* MVMCoreLoadObject.h in Headers */,
AF43A7061FC4D7A2008E9347 /* MVMCoreObject.h in Headers */,
AFED77A11FCCA29400BAE689 /* MVMCoreViewControllerNibMappingObject.h in Headers */,
AFBB969F1FBA3A9A0008D868 /* MVMCoreAlertOperation.h in Headers */,
AF43A71B1FC5BEBB008E9347 /* MVMCoreViewControllerProtocol.h in Headers */,
AFC5FA161FFC2E2A00C244CF /* MVMCoreGlobalTopAlertDelegateProtocol.h in Headers */,
AFBB96381FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h in Headers */,
AFBB96B01FBA3B590008D868 /* MVMCoreDispatchUtility.h in Headers */,
8876D5E81FB50AB000EB2E3D /* NSArray+MFConvenience.h in Headers */,
@ -751,8 +671,6 @@
AF43A7011FC4B227008E9347 /* MVMCoreGlobalLoadProtocol.h in Headers */,
AF43A5771FBA5B7C008E9347 /* MVMCoreJSONConstants.h in Headers */,
AFBB96631FBA3A570008D868 /* MVMCoreLoadRequestOperation.h in Headers */,
AFC5FA1D1FFC39C700C244CF /* MVMCoreTopAlertViewProtocol.h in Headers */,
AFBB969D1FBA3A9A0008D868 /* MVMCoreAlertObject.h in Headers */,
8876D5CE1FB50A9E00EB2E3D /* MVMCore.h in Headers */,
AF43A57B1FBA5E6A008E9347 /* MVMCoreHardcodedStringsConstants.h in Headers */,
AFBB96B81FBA3CEC0008D868 /* MVMCoreActionDelegateProtocol.h in Headers */,
@ -760,14 +678,12 @@
AF43A70B1FC4F415008E9347 /* MVMCoreCache.h in Headers */,
AFEA17A8209B6A1C00BC6740 /* MVMCoreBlockOperation.h in Headers */,
AF43A5831FBB66DE008E9347 /* MVMCoreConstants.h in Headers */,
AFBB969A1FBA3A9A0008D868 /* MVMCoreAlertDelegateProtocol.h in Headers */,
AFED77A81FCCA29400BAE689 /* MVMCoreViewControllerStoryBoardMappingObject.h in Headers */,
AFEEE8191FCDEB8D00B5EDD0 /* MVMCoreLoggingDelegateProtocol.h in Headers */,
AFBB96B91FBA3CEC0008D868 /* MVMCoreActionHandler.h in Headers */,
AF43A74C1FC6109F008E9347 /* MVMCoreSessionObject.h in Headers */,
8876D5F41FB50AB000EB2E3D /* UILabel+MFCustom.h in Headers */,
AFFCFA681FCCC0D700FD0730 /* MVMCoreLoadingViewControllerProtocol.h in Headers */,
AFBB969B1FBA3A9A0008D868 /* MVMCoreAlertHandler.h in Headers */,
AFED77A21FCCA29400BAE689 /* MVMCoreViewControllerMappingObject.h in Headers */,
AFFCFA661FCCC0D700FD0730 /* MVMCoreLoadingOverlayHandler.h in Headers */,
);
@ -868,7 +784,6 @@
buildActionMask = 2147483647;
files = (
AFED77A71FCCA29400BAE689 /* MVMCoreViewControllerProgrammaticMappingObject.m in Sources */,
AFBB96A01FBA3A9A0008D868 /* MVMCoreAlertOperation.m in Sources */,
946EE1A7237B5B1C0036751F /* ModelRegistry.swift in Sources */,
AFBB96641FBA3A570008D868 /* MVMCoreLoadHandler.m in Sources */,
AFFCFA671FCCC0D700FD0730 /* MVMCoreLoadingOverlayHandler.m in Sources */,
@ -878,7 +793,6 @@
01F2A03623A80A7300D954D8 /* ActionModelProtocol.swift in Sources */,
AFBB96991FBA3A9A0008D868 /* MVMCoreAlertController.m in Sources */,
881D26941FCC9D180079C521 /* MVMCoreOperation.m in Sources */,
0184D3FD24BE54A300A05369 /* UIAlertActionStyle+Codable.swift in Sources */,
AFED77A41FCCA29400BAE689 /* MVMCoreViewControllerMappingObject.m in Sources */,
01C851CF23CF7B260021F976 /* JSONMap.swift in Sources */,
01F2A04C23A82B1B00D954D8 /* ActionCallModel.swift in Sources */,
@ -887,12 +801,10 @@
AFBB96BA1FBA3CEC0008D868 /* MVMCoreActionHandler.m in Sources */,
AFBB96ED1FBA4A260008D868 /* MFHardCodedServerResponse.m in Sources */,
AF43A74D1FC6109F008E9347 /* MVMCoreSessionObject.m in Sources */,
0184D3E324B8D0C600A05369 /* MVMCoreAlertObject+Swift.swift in Sources */,
D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */,
AFBB96901FBA3A9A0008D868 /* MVMCoreNavigationObject.m in Sources */,
946EE1AB237B5C940036751F /* Decoder.swift in Sources */,
946EE1BC237B691A0036751F /* ActionOpenPageModel.swift in Sources */,
AFBB96A61FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m in Sources */,
0A42538F23F3414800554656 /* Codable+Helpers.swift in Sources */,
881D26931FCC9D180079C521 /* MVMCoreErrorObject.m in Sources */,
94C014D124211869005811A9 /* ActionRestartModel.swift in Sources */,
@ -900,29 +812,21 @@
30349BF21FCCA78A00546A1E /* MVMCoreSessionTimeHandler.m in Sources */,
D2DEDCB923C6400600C44CC4 /* UnitInterval.swift in Sources */,
94C014D3242119E6005811A9 /* ActionPreviousSubmitModel.swift in Sources */,
0184D3FF24BE554A00A05369 /* AlertModel.swift in Sources */,
8876D5E91FB50AB000EB2E3D /* NSArray+MFConvenience.m in Sources */,
946EE1B2237B5F260036751F /* JSONValue.swift in Sources */,
AFBB96971FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m in Sources */,
01F2A04E23A82CF500D954D8 /* ActionPopupModel.swift in Sources */,
0A62624824C1DFDC00C316B9 /* UIAlertControllerStyle+Extension.swift in Sources */,
AF43A5781FBA5B7C008E9347 /* MVMCoreJSONConstants.m in Sources */,
AFBB96691FBA3A570008D868 /* MVMCoreRequestParameters.m in Sources */,
AFED77A31FCCA29400BAE689 /* MVMCoreViewControllerNibMappingObject.m in Sources */,
D2CAC7C82510F0C500C75681 /* MVMCoreAlertHandler+Extension.swift in Sources */,
8876D5EB1FB50AB000EB2E3D /* NSDecimalNumber+MFConvenience.m in Sources */,
0184D3DB24B7D5A600A05369 /* ActionAlertModel.swift in Sources */,
AFBB96A41FBA3A9A0008D868 /* MVMCoreTopAlertObject.m in Sources */,
01F2A03923A812DD00D954D8 /* ActionOpenUrlModel.swift in Sources */,
AFBB96351FBA34310008D868 /* MVMCoreErrorConstants.m in Sources */,
AFBB969C1FBA3A9A0008D868 /* MVMCoreAlertHandler.m in Sources */,
AF43A5881FBB67D6008E9347 /* MVMCoreActionUtility.m in Sources */,
AFED77A61FCCA29400BAE689 /* MVMCoreViewControllerStoryBoardMappingObject.m in Sources */,
AF43A57C1FBA5E6A008E9347 /* MVMCoreHardcodedStringsConstants.m in Sources */,
0AFF597A23FC6E60005C24E8 /* ActionShareModel.swift in Sources */,
AFEEE81F1FCDF3CA00B5EDD0 /* MVMCoreLoggingHandler.m in Sources */,
01F2A05223A8325100D954D8 /* ModelMapping.swift in Sources */,
AFBB969E1FBA3A9A0008D868 /* MVMCoreAlertObject.m in Sources */,
8876D5F51FB50AB000EB2E3D /* UILabel+MFCustom.m in Sources */,
AFBB96B31FBA3B590008D868 /* MVMCoreGetterUtility.m in Sources */,
AF43A7071FC4D7A2008E9347 /* MVMCoreObject.m in Sources */,

View File

@ -10,7 +10,6 @@
@class MVMCoreErrorObject;
@class MVMCoreRequestParameters;
@class MVMCoreAlertObject;
@protocol MVMCoreActionDelegateProtocol
@ -31,12 +30,6 @@
// Handles the linkaway action. Call the block to continue to linkaway.
- (void)shouldLinkAwayWithURL:(nullable NSURL *)URL appURL:(nullable NSURL *)appURL actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData linkAwayBlock:(nonnull void (^)(NSURL * _Nullable appURL, NSURL * _Nullable URL, NSDictionary * _Nullable actionInformation, NSDictionary * _Nullable additionalData))linkAwayBlock;
// Gives the delegate a chance to alter the alert object
- (void)willShowPopupWithAlertObject:(nonnull MVMCoreAlertObject *)alertObject alertJson:(nonnull NSDictionary *)alertJson;
// Gives the delegate a chance to alter the alert object
- (nullable MVMCoreAlertObject *)willShowTopAlertWithAlertObject:(nonnull MVMCoreAlertObject *)alertObject alertJson:(nonnull NSDictionary *)alertJson;
// Handle cancel
- (void)handleCancel:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData;

View File

@ -50,15 +50,6 @@ extern NSString * _Nonnull const KeyActionTypeOpen;
// Makes the previous request, needs the delegate for this
- (void)previousSubmitAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Shows a popup alert by grabbing the content from the page map.
- (void)popupAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Shows popup alert from the alert object in the action map. The actionType of the action is 'alert'
- (void)showAlert:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Shows a top alert
- (void)topAlertAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Redirects to another experience
- (void)redirectAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
@ -68,9 +59,6 @@ extern NSString * _Nonnull const KeyActionTypeOpen;
// Goes to settings app
- (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Collapses the current top notification
- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Subclass this to handle other custom actions. Return YES if handled, and NO if not.
- (BOOL)handleOtherActions:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
@ -105,8 +93,8 @@ extern NSString * _Nonnull const KeyActionTypeOpen;
// By default, throws an error, calling defaultHandleActionError.
+ (void)defaultHandleUnknownActionType:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Shows a popup error
+ (void)defaultHandleActionError:(nonnull MVMCoreErrorObject *)error additionalData:(nullable NSDictionary *)additionalData;
// Logs the error.
- (void)defaultHandleActionError:(nonnull MVMCoreErrorObject *)error additionalData:(nullable NSDictionary *)additionalData;
#pragma mark - Deprecated
@ -134,12 +122,6 @@ extern NSString * _Nonnull const KeyActionTypeOpen;
// Makes the previous request, needs the delegate for this
- (void)previousSubmitAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;
// Shows a popup
- (void)popupAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;
// Shows a top alert
- (void)topAlertAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;
// Redirects to another experience
- (void)redirectAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;
@ -149,9 +131,6 @@ extern NSString * _Nonnull const KeyActionTypeOpen;
// Goes to settings app
- (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;
// Collapses the current top notification
- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;
// Subclass this to handle other custom actions. Return YES if handled, and NO if not.
- (BOOL)handleOtherActions:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate __deprecated;

View File

@ -8,9 +8,7 @@
#import <MVMCore/MVMCoreActionHandler.h>
#import "MVMCoreLoggingHandler.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreCache.h"
#import "MVMCoreAlertObject.h"
#import "MVMCoreSessionTimeHandler.h"
#import "MVMCoreLoadHandler.h"
#import "MVMCoreNavigationHandler.h"
@ -73,12 +71,6 @@ NSString * const KeyActionTypeOpen = @"openPage";
} else if ([actionType isEqualToString:KeyActionTypePreviousSubmit]) {
[self previousSubmitAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
} else if ([actionType isEqualToString:KeyActionTypePopup]) {
[self popupAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
} else if ([actionType isEqualToString:KeyActionTypeTopAlert]) {
[self topAlertAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
} else if ([actionType isEqualToString:KeyActionTypeRedirect]) {
[self redirectAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
@ -87,12 +79,6 @@ NSString * const KeyActionTypeOpen = @"openPage";
} else if ([actionType isEqualToString:KeyActionTypeSettings]) {
[self settingsAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
} else if ([actionType isEqualToString:KeyActionTypeCollapseNotification]) {
[self collapseNotificationAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
} else if ([actionType isEqualToString:KeyActionTypeAlert]) {
[self showAlert:actionInformation additionalData:additionalData delegateObject:delegateObject];
} else if ([actionType isEqualToString:KeyActionTypeNoop]){
} else if (![self handleOtherActions:actionType actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject]) {
@ -240,41 +226,6 @@ NSString * const KeyActionTypeOpen = @"openPage";
}
}
- (void)popupAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
// Perform a popup.
NSString *pageTypeForPopup = [actionInformation stringForKey:KeyPageType];
[[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForPopup queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) {
MVMCoreErrorObject *error = nil;
MVMCoreAlertObject *alertObject = [MVMCoreAlertObject alertObjectWithPage:jsonDictionary isGreedy:NO additionalData:additionalData delegateObject:delegateObject error:&error];
if ([delegateObject.actionDelegate respondsToSelector:@selector(willShowPopupWithAlertObject:alertJson:)]) {
[delegateObject.actionDelegate willShowPopupWithAlertObject:alertObject alertJson:jsonDictionary];
}
if (alertObject) {
[[MVMCoreAlertHandler sharedAlertHandler] showAlertWithAlertObject:alertObject];
} else {
[self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject ];
}
}];
}
- (void)topAlertAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
// Perform a top alert.
NSString *pageTypeForTopAlert = [actionInformation stringForKey:KeyPageType];
[[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForTopAlert queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) {
NSDictionary *responseInfo = [jsonDictionary dict:KeyResponseInfo];
if (responseInfo) {
MVMCoreAlertObject *alertObject = [MVMCoreAlertObject alertObjectForPageType:pageTypeForTopAlert responseInfo:responseInfo additionalData:additionalData delegateObject:delegateObject];
if ([delegateObject.actionDelegate respondsToSelector:@selector(willShowTopAlertWithAlertObject:alertJson:)]) {
alertObject = [delegateObject.actionDelegate willShowTopAlertWithAlertObject:alertObject alertJson:jsonDictionary];
}
[alertObject showAlert];
}
}];
}
- (void)redirectAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
// Have delegate redirect.
[[MVMCoreSessionObject sharedGlobal] redirectWithInfo:actionInformation];
@ -290,28 +241,6 @@ NSString * const KeyActionTypeOpen = @"openPage";
[MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil];
}
- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
// Collapse the current notification.
if ([[MVMCoreObject sharedInstance].globalTopAlertDelegate respondsToSelector:@selector(getTopAlertView)]) {
[[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] collapseNotification];
}
}
- (void)showAlert:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
MVMCoreErrorObject *error = nil;
MVMCoreAlertObject *alertObject = [MVMCoreAlertObject alertObjectWithAction:actionInformation additionalData:additionalData delegateObject:delegateObject error:&error];
if ([delegateObject.actionDelegate respondsToSelector:@selector(willShowPopupWithAlertObject:alertJson:)]) {
[delegateObject.actionDelegate willShowPopupWithAlertObject:alertObject alertJson:actionInformation];
}
if (alertObject) {
[[MVMCoreAlertHandler sharedAlertHandler] showAlertWithAlertObject:alertObject];
} else {
[self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject];
}
}
- (BOOL)handleOtherActions:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
return NO;
}
@ -329,7 +258,7 @@ NSString * const KeyActionTypeOpen = @"openPage";
if ([delegateObject.actionDelegate respondsToSelector:@selector(handleActionError:additionalData:)]) {
[delegateObject.actionDelegate handleActionError:error additionalData:additionalData];
} else {
[MVMCoreActionHandler defaultHandleActionError:error additionalData:additionalData];
[self defaultHandleActionError:error additionalData:additionalData];
}
}
}
@ -419,25 +348,15 @@ NSString * const KeyActionTypeOpen = @"openPage";
+ (void)defaultHandleUnknownActionType:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeUnknownActionType domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@Requests_%@",NSStringFromClass([delegateObject.actionDelegate class]),actionType]];
[MVMCoreActionHandler defaultHandleActionError:error additionalData:additionalData];
[[self sharedActionHandler] defaultHandleActionError:error additionalData:additionalData];
}
+ (void)defaultHandleActionError:(nonnull MVMCoreErrorObject *)error additionalData:(nullable NSDictionary *)additionalData {
- (void)defaultHandleActionError:(nonnull MVMCoreErrorObject *)error additionalData:(nullable NSDictionary *)additionalData {
// Logs the error.
if (error.logError) {
[MVMCoreLoggingHandler addErrorToLog:error];
}
MVMCoreLog(@"Error: %@ %@ %@ %@",[error stringErrorCode], error.domain, error.location,error.messageToDisplay);
if (!error.silentError) {
// Show alert
[MVMCoreDispatchUtility performBlockOnMainThread:^{
MVMCoreAlertObject *alertObject = [[MVMCoreAlertObject alloc] initPopupAlertWithError:error isGreedy:NO];
[[MVMCoreAlertHandler sharedAlertHandler] showAlertWithAlertObject:alertObject];
}];
}
}
#pragma mark - Deprecated
@ -467,18 +386,12 @@ NSString * const KeyActionTypeOpen = @"openPage";
[self callAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypePreviousSubmit]) {
[self previousSubmitAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypePopup]) {
[self popupAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypeTopAlert]) {
[self topAlertAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypeRedirect]) {
[self redirectAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypeCancel]) {
[self cancelAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypeSettings]) {
[self settingsAction:actionInformation additionalData:additionalData delegate:delegate];
} else if ([actionType isEqualToString:KeyActionTypeCollapseNotification]) {
[self collapseNotificationAction:actionInformation additionalData:additionalData delegate:delegate];
} else if (![self handleOtherActions:actionType actionInformation:actionInformation additionalData:additionalData delegate:delegate]) {
// not a known action type.
[self unknownAction:actionType actionInformation:actionInformation additionalData:additionalData delegate:delegate];
@ -572,41 +485,6 @@ NSString * const KeyActionTypeOpen = @"openPage";
}
}
- (void)popupAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
// Perform a popup.
NSString *pageTypeForPopup = [actionInformation stringForKey:KeyPageType];
[[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForPopup queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) {
MVMCoreErrorObject *error = nil;
MVMCoreAlertObject *alertObject = [MVMCoreAlertObject alertObjectWithPage:jsonDictionary isGreedy:NO additionalData:additionalData delegate:delegate error:&error];
if ([delegate respondsToSelector:@selector(willShowPopupWithAlertObject:alertJson:)]) {
[delegate willShowPopupWithAlertObject:alertObject alertJson:jsonDictionary];
}
if (alertObject) {
[[MVMCoreAlertHandler sharedAlertHandler] showAlertWithAlertObject:alertObject];
} else {
[self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegate:delegate];
}
}];
}
- (void)topAlertAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
// Perform a top alert.
NSString *pageTypeForTopAlert = [actionInformation stringForKey:KeyPageType];
[[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForTopAlert queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) {
NSDictionary *responseInfo = [jsonDictionary dict:KeyResponseInfo];
if (responseInfo) {
MVMCoreAlertObject *alertObject = [MVMCoreAlertObject alertObjectForPageType:pageTypeForTopAlert responseInfo:responseInfo additionalData:additionalData actionDelegate:delegate];
if ([delegate respondsToSelector:@selector(willShowTopAlertWithAlertObject:alertJson:)]) {
alertObject = [delegate willShowTopAlertWithAlertObject:alertObject alertJson:jsonDictionary];
}
[alertObject showAlert];
}
}];
}
- (void)redirectAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
// Have delegate redirect.
[[MVMCoreSessionObject sharedGlobal] redirectWithInfo:actionInformation];
@ -623,13 +501,6 @@ NSString * const KeyActionTypeOpen = @"openPage";
[MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil];
}
- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
// Collapse the current notification.
if ([[MVMCoreObject sharedInstance].globalTopAlertDelegate respondsToSelector:@selector(getTopAlertView)]) {
[[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] collapseNotification];
}
}
- (BOOL)handleOtherActions:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
return NO;
}
@ -647,7 +518,7 @@ NSString * const KeyActionTypeOpen = @"openPage";
if ([delegate respondsToSelector:@selector(handleActionError:additionalData:)]) {
[delegate handleActionError:error additionalData:additionalData];
} else {
[MVMCoreActionHandler defaultHandleActionError:error additionalData:additionalData];
[self defaultHandleActionError:error additionalData:additionalData];
}
}
}
@ -733,7 +604,7 @@ NSString * const KeyActionTypeOpen = @"openPage";
+ (void)defaultHandleUnknownActionType:(nullable NSString *)actionType actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreActionDelegateProtocol>*)delegate {
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeUnknownActionType domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@Requests_%@",NSStringFromClass([delegate class]),actionType]];
[MVMCoreActionHandler defaultHandleActionError:error additionalData:additionalData];
[[self sharedActionHandler] defaultHandleActionError:error additionalData:additionalData];
}
@end

View File

@ -1,28 +0,0 @@
//
// MVMCoreAlertDelegateProtocol.h
// mobilefirst
//
// Created by Pfeil, Scott Robert on 8/8/17.
// Copyright © 2017 Verizon Wireless. All rights reserved.
//
// Called for popup style alerts.
#import <Foundation/Foundation.h>
@class MVMCoreAlertObject;
@protocol MVMCoreAlertDelegateProtocol
@optional
// helps tracking alert state
- (nullable NSDictionary *)additionalAlertDataToTrackForAlertWithObject:(nullable MVMCoreAlertObject *)alertObject;
// All are performed on the main thread.
- (void)alertShown:(nonnull UIAlertController *)alertController;
- (void)alertCancelled:(nonnull UIAlertController *)alertController;
- (void)alertDismissed:(nonnull UIAlertController *)alertController;
- (void)alertPaused:(nonnull UIAlertController *)alertController;
- (void)alertUnpaused:(nonnull UIAlertController *)alertController;
@end

View File

@ -1,95 +0,0 @@
//
// MVMCoreAlertHandler+Extension.swift
// MVMCore
//
// Created by Scott Pfeil on 9/15/20.
// Copyright © 2020 myverizon. All rights reserved.
//
import Foundation
// Temporary, until we can move page checking logic into isReady of topAlertOperation.
@objcMembers public class NotificationPagesOperation: Operation {
public let pages: [String]
public init(with pages: [String]) {
self.pages = pages
}
public override var isReady: Bool {
get {
return super.isReady && isCancelled
}
}
}
// TODO: Move this type of logic into isReady for the top alert operation... then can remove this dependency operation.
public extension MVMCoreAlertHandler {
/// Adds a page type dependency to the operation
@objc func addPagesDependency(to operation: MVMCoreTopAlertOperation) {
// This notification may only show for certain pages.
guard let pages = operation.topAlertObject.json?.optionalArrayForKey("pages") as? [String],
pages.count > 0 else { return }
let pagesOperation = NotificationPagesOperation(with: pages)
pageOperations.addOperation(pagesOperation)
operation.addDependency(pagesOperation)
}
/// Updates the pages requirement for the operation
@objc func updatePages(for operation: MVMCoreTopAlertOperation, with topAlertObject: MVMCoreTopAlertObject) {
// Add new dependencies, remove old.
let previousPages = operation.dependencies.filter { $0 as? NotificationPagesOperation != nil }
addPagesDependency(to: operation)
for pageOperation in previousPages {
pageOperation.cancel()
operation.removeDependency(pageOperation)
}
}
/// Handles page dependencies for all top alerts with the new pageType
@objc func handleAllPagesDependency(for pageType: String?) {
var currentOperation: MVMCoreTopAlertOperation? = nil
for case let operation as MVMCoreTopAlertOperation in topAlertQueue.operations {
// Handle the currently executing opration last to avoid race conditions.
guard !operation.isExecuting else {
currentOperation = operation
continue
}
handlePageDependency(for: operation, with: pageType)
}
if let operation = currentOperation {
handlePageDependency(for: operation, with: pageType)
}
}
/// Updates the operation based on the page type and its dependencies.
@objc func handlePageDependency(for operation: MVMCoreTopAlertOperation, with pageType: String?) {
guard !operation.isCancelled else { return }
if let pages = operation.topAlertObject.json?.optionalArrayForKey("pages") as? [String],
pages.count > 0,
(pageType == nil || !pages.contains(pageType!)) {
if let dependency = operation.dependencies.first(where: { $0.isFinished && ($0 as? NotificationPagesOperation)?.pages == pages }) {
// Re-add the dependency if it was previously cancelled.
let pagesOperation = NotificationPagesOperation(with: pages)
pageOperations.addOperation(pagesOperation)
operation.addDependency(pagesOperation)
operation.removeDependency(dependency)
}
if operation.isExecuting {
// If the current running operation should not show on the current page, cancel it. If it's persistent, re-add it
operation.reAddAfterCancel = operation.topAlertObject.persistent
operation.cancel()
}
}
// Cancel any dependency if it contains the current page.
guard let pageType = pageType else { return }
for case let operation as NotificationPagesOperation in operation.dependencies {
if operation.pages.contains(pageType) {
operation.cancel()
}
}
}
}

View File

@ -1,119 +0,0 @@
//
// MVMCoreAlertHandler.h
// myverizon
//
// Created by Scott Pfeil on 3/10/14.
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
//
// Keeps track of alerts and handles them. Should always use this to present alerts in mf.
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreTopAlertObject.h>
#import <MVMCore/MVMCoreAlertDelegateProtocol.h>
@class MVMCoreAlertObject;
@class MVMCoreTopAlertOperation;
@interface MVMCoreAlertHandler : NSObject
// An operation queue for displaying popup alerts.
@property (nonnull, strong, nonatomic) NSOperationQueue *popupAlertQueue;
// An operation queue for top alerts
@property (nonnull, strong, nonatomic) NSOperationQueue *topAlertQueue;
/// Stores any page dependencies for top alerts
@property (nonnull, strong, nonatomic) NSOperationQueue *pageOperations;
/// Returns the shared instance of this singleton
+ (nullable instancetype)sharedAlertHandler;
#pragma mark - Popup Alert Functions
/// Returns if any alert is currently showing (even if supressed).
- (BOOL)alertCurrentlyShowing;
/// Returns if a greedy alert is currently showing (even if supressed).
- (BOOL)greedyAlertShowing;
/** Shows the popup with the passed in parameter.
* @param title The title of the alert.
* @param message The message of the alert.
* @param actions An array of actions for the alert.
* @param isGreedy Sets up a greedy popup. In other words, any popups currently shown or queued are dismissed.
* @return Returns the UIAlertController.
*/
- (nonnull UIAlertController *)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nullable NSArray<UIAlertAction *>*)actions isGreedy:(BOOL)isGreedy;
/** Shows the alert.
* @param title The title of the alert.
* @param message The message of the alert.
* @param actions An array of actions for the alert.
* @param alertStyle Popup or action sheet
* @param isGreedy Sets up a greedy alert. In other words, any alerts currently shown or queued are dismissed.
* @param alertDelegate The delegate to be notified.
* @return Returns the UIAlertController.
*/
- (nonnull UIAlertController *)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nullable NSArray<UIAlertAction *>*)actions alertStyle:(UIAlertControllerStyle)alertStyle isGreedy:(BOOL)isGreedy alertDelegate:(nullable NSObject <MVMCoreAlertDelegateProtocol>*)alertDelegate;
/** Shows the popup with the passed in alert object. This is a convenience method that automatically handles using the proper alert type based on what's available.
* @param alertObject The alert object to use for the alert.
* @return Returns UIAlertController.
*/
- (nonnull UIAlertController *)showAlertWithAlertObject:(nonnull MVMCoreAlertObject *)alertObject;
/** Cancels and removes an alert operation for the given alertObject.
* @param alertObject The alertObject scheduled to be shown.
*/
- (void)removeAlertViewForObject:(nonnull MVMCoreAlertObject *)alertObject;
/** Iterates through all scheduled alerts and cancels any that match the provided predicate.
* @param predicate The predicate block to decide whether to cancel an alert.
*/
- (void)removeAlertViewUsingPredicate:(BOOL(^_Nonnull)(MVMCoreAlertObject * _Nonnull obj))predicate;
/// Removes all alerts.
- (void)removeAllAlertViews;
#pragma mark - Supression Functions
/// Returns true if alerts are supressed.
- (BOOL)mfAlertsSupressed;
/// Supresses the alerts (Used by other "apps" in our app).
- (void)supressMFAlerts;
/// Unsupresses the alerts (Used by other "apps" in our app).
- (void)unSupressMFAlerts;
#pragma mark - Top Alert Functions
/// Show based on the object. Will be used by the architecture. Creates an operation and calls addTopAlertOperation.
- (void)showTopAlertWithObject:(nullable MVMCoreTopAlertObject *)topAlertObject;
/// Adds the top alert operation to the queue.
- (void)addTopAlertOperation:(nonnull MVMCoreTopAlertOperation *)topAlertOperation;
/// Convenience functions
- (void)showTopAlertErrorWithMessage:(nullable NSString *)message;
- (void)showTopAlertConfirmationWithMessage:(nullable NSString *)message;
- (void)showTopAlertWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData;
- (void)showTopAlertWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id _Nonnull sender))userActionHandler;
/// Hides the current alert view.
- (void)hideTopAlertView;
/// Hides a persistent alert based on the type string.
- (void)hidePersistentTopAlertViewOfType:(nullable NSString *)type;
/// Removes a scheduled top alert given its top alert object.
- (void)removeTopAlertForObject:(nonnull MVMCoreTopAlertObject *)topAlertObject;
/// Removes all top alerts.
- (void)removeAllTopAlerts;
/// Returns YES if the persistent type is already registered in the alert queue.
- (BOOL)hasPersistentTopAlertOfType:(nullable NSString *)type;
@end

View File

@ -1,262 +0,0 @@
//
// MVMCoreAlertHandler.m
// myverizon
//
// Created by Scott Pfeil on 3/10/14.
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
//
#import "MVMCoreAlertHandler.h"
#import "MVMCoreAlertObject.h"
#import "MVMCoreAlertController.h"
#import "MVMCoreAlertOperation.h"
#import "MVMCoreTopAlertOperation.h"
#import "MVMCoreJSONConstants.h"
#import "NSDictionary+MFConvenience.h"
#import "NSArray+MFConvenience.h"
#import <MVMCore/MVMCore-Swift.h>
@interface MVMCoreAlertHandler ()
// Flag that keeps track of if the alerts are supressed or not.
@property (assign, nonatomic) BOOL mfAlertsSupressed;
@end
@implementation MVMCoreAlertHandler
+ (instancetype)sharedAlertHandler {
static dispatch_once_t once;
static id sharedInstance;
dispatch_once(&once, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
- (nullable instancetype)init {
if (self = [super init]) {
self.popupAlertQueue = [[NSOperationQueue alloc] init];
self.popupAlertQueue.maxConcurrentOperationCount = 1;
self.topAlertQueue = [[NSOperationQueue alloc] init];
self.topAlertQueue.maxConcurrentOperationCount = 1;
self.pageOperations = [[NSOperationQueue alloc] init];
}
return self;
}
#pragma mark - Popup Alert Functions
- (BOOL)alertCurrentlyShowing {
return (self.popupAlertQueue.operationCount > 0);
}
- (BOOL)greedyAlertShowing {
if ([self alertCurrentlyShowing]) {
NSInteger index = [self.popupAlertQueue.operations indexOfObjectPassingTest:^BOOL(__kindof MVMCoreAlertOperation * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.isExecuting && obj.isGreedy && stop) {
*stop = YES;
return YES;
} else {
return NO;
}
}];
return (index != NSNotFound);
}
return NO;
}
- (nonnull UIAlertController *)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nullable NSArray<UIAlertAction *>*)actions isGreedy:(BOOL)isGreedy {
return [self showAlertWithTitle:title message:message actions:actions isGreedy:isGreedy alertDelegate:nil];
}
- (nonnull UIAlertController *)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nullable NSArray<UIAlertAction *>*)actions isGreedy:(BOOL)isGreedy alertDelegate:(nullable NSObject <MVMCoreAlertDelegateProtocol>*)alertDelegate {
return [self showAlertWithTitle:title message:message actions:actions alertStyle:UIAlertControllerStyleAlert isGreedy:isGreedy alertDelegate:alertDelegate];
}
- (nonnull UIAlertController *)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nullable NSArray<UIAlertAction *>*)actions alertStyle:(UIAlertControllerStyle)alertStyle isGreedy:(BOOL)isGreedy alertDelegate:(nullable NSObject <MVMCoreAlertDelegateProtocol>*)alertDelegate {
// It's a greedy alert! Clear all alerts that are queued up and the one that is showing
if (isGreedy) {
[self removeAllAlertViews];
}
// Create the alert. Adds the actions one by one.
MVMCoreAlertController *alertController = [MVMCoreAlertController alertControllerWithTitle:(title ?: @"") message:message preferredStyle:alertStyle];
for (NSUInteger i = 0; i < [actions count]; i++) {
UIAlertAction *action = [actions objectAtIndex:i ofType:[UIAlertAction class]];
if (action) {
[alertController addAction:action];
}
}
MVMCoreAlertOperation *alertOperation = [[MVMCoreAlertOperation alloc] initWithAlert:alertController isGreedy:isGreedy alertDelegate:alertDelegate];
[self.popupAlertQueue addOperation:alertOperation];
return alertController;
}
- (nonnull UIAlertController *)showAlertWithAlertObject:(nonnull MVMCoreAlertObject *)alertObject {
MVMCoreAlertController *controller = (MVMCoreAlertController *)[self showAlertWithTitle:alertObject.title message:alertObject.message actions:alertObject.actions alertStyle:alertObject.alertStyle isGreedy:alertObject.isGreedy alertDelegate:alertObject.alertDelegate];
controller.alertObject = alertObject;
return controller;
}
- (void)removeAlertViewForObject:(MVMCoreAlertObject *)alertObject {
for (MVMCoreAlertOperation *operation in self.popupAlertQueue.operations) {
if ([operation.currentAlertView isKindOfClass:[MVMCoreAlertController class]] && [(MVMCoreAlertController *)operation.currentAlertView alertObject] == alertObject) {
[operation cancel];
}
}
}
- (void)removeAlertViewUsingPredicate:(BOOL(^)(MVMCoreAlertObject *obj))predicate {
for (MVMCoreAlertOperation *operation in self.popupAlertQueue.operations) {
if ([operation.currentAlertView isKindOfClass:[MVMCoreAlertController class]]) {
MVMCoreAlertObject *alertObject = [(MVMCoreAlertController *)operation.currentAlertView alertObject];
if (alertObject && predicate(alertObject)) {
[operation cancel];
}
}
}
}
- (void)removeAllAlertViews {
[self.popupAlertQueue cancelAllOperations];
}
#pragma mark - Supression Functions
- (BOOL)mfAlertsSupressed {
return _mfAlertsSupressed;
}
- (void)supressMFAlerts {
if (!self.mfAlertsSupressed) {
self.mfAlertsSupressed = YES;
for (MVMCoreAlertOperation *operation in self.popupAlertQueue.operations) {
[operation pause];
}
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
[operation pause];
}
}
}
- (void)unSupressMFAlerts {
if (self.mfAlertsSupressed) {
self.mfAlertsSupressed = NO;
for (MVMCoreAlertOperation *operation in self.popupAlertQueue.operations) {
[operation unpause];
}
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
[operation unpause];
}
}
}
#pragma mark - Top Alert Functions
- (void)addTopAlertOperation:(nonnull MVMCoreTopAlertOperation *)topAlertOperation {
__block MVMCoreTopAlertOperation *alertOperation = topAlertOperation;
__weak typeof(self) weakSelf = self;
[alertOperation setCompletionBlock:^{
// If the alert was cancelled to show another with higher priority, re-add to the operation when cancelled to the queue.
if (alertOperation.reAddAfterCancel) {
MVMCoreTopAlertOperation *newOperation = [alertOperation copy];
newOperation.reAddAfterCancel = NO;
[weakSelf addTopAlertOperation:newOperation];
}
alertOperation = nil;
}];
[self.topAlertQueue addOperation:alertOperation];
// If the current running operation is persistent and has a lower queue priority then the added operation, cancel it and re-add it.
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
if (operation.isExecuting && !operation.isCancelled && operation.topAlertObject.persistent && operation.queuePriority < alertOperation.queuePriority && alertOperation.isReady) {
operation.reAddAfterCancel = YES;
[operation cancel];
break;
}
}
}
- (void)showTopAlertWithObject:(nullable MVMCoreTopAlertObject *)topAlertObject {
MVMCoreTopAlertOperation *alertOperation = [[MVMCoreTopAlertOperation alloc] initWithTopAlertObject:topAlertObject];
[self addTopAlertOperation:alertOperation];
}
- (void)showTopAlertErrorWithMessage:(nullable NSString *)message {
MVMCoreTopAlertObject *topAlertObject = [[MVMCoreTopAlertObject alloc] initWithType:ValueTypeError message:message];
[self showTopAlertWithObject:topAlertObject];
}
- (void)showTopAlertConfirmationWithMessage:(nullable NSString *)message {
MVMCoreTopAlertObject *topAlertObject = [[MVMCoreTopAlertObject alloc] initWithType:ValueTypeSuccess message:message];
[self showTopAlertWithObject:topAlertObject];
}
- (void)showTopAlertWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData {
MVMCoreTopAlertObject *topAlertObject = [[MVMCoreTopAlertObject alloc] initWithType:type message:message subMessage:subMessage persistent:persistent actionMap:actionMap additionalData:additionalData];
[self showTopAlertWithObject:topAlertObject];
}
- (void)showTopAlertWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id _Nonnull sender))userActionHandler {
MVMCoreTopAlertObject *topAlertObject = [[MVMCoreTopAlertObject alloc] initWithType:type message:message subMessage:subMessage persistent:persistent buttonTitle:buttonTitle userActionHandler:userActionHandler];
[self showTopAlertWithObject:topAlertObject];
}
- (void)hideTopAlertView {
MVMCoreTopAlertOperation *currentOperation = [self.topAlertQueue.operations firstObject];
currentOperation.topAlertObject.persistent = NO;
currentOperation.reAddAfterCancel = NO;
[currentOperation cancel];
}
- (BOOL)hasPersistentTopAlertOfType:(nullable NSString *)type {
BOOL hasAlert = NO;
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
if (operation.topAlertObject.persistent && [operation.topAlertObject.type isEqualToString:type]) {
hasAlert = YES;
}
}
return hasAlert;
}
- (void)hidePersistentTopAlertViewOfType:(nullable NSString *)type {
if (type) {
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
// Cancel all persistent operations of this type.
if (operation.topAlertObject.persistent && [operation.topAlertObject.type isEqualToString:type]) {
operation.reAddAfterCancel = NO;
[operation cancel];
}
}
}
}
- (void)removeTopAlertForObject:(MVMCoreTopAlertObject *)topAlertObject {
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
// Finds an cancels top alerts associated with the object.
if (operation.topAlertObject == topAlertObject) {
operation.reAddAfterCancel = NO;
[operation cancel];
}
}
}
- (void)removeAllTopAlerts {
[self.topAlertQueue cancelAllOperations];
}
@end

View File

@ -1,45 +0,0 @@
//
// MVMCoreAlertObject+Swift.swift
// MVMCore
//
// Created by Suresh, Kamlesh on 7/10/20.
// Copyright © 2020 myverizon. All rights reserved.
//
public extension MVMCoreAlertObject {
@objc static func alertObjectWith(action actionJson: [AnyHashable: Any]?, additionalData: [AnyHashable: Any]?, delegateObject: DelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> MVMCoreAlertObject? {
guard let alertJson = actionJson?.optionalDictionaryForKey("alert"),
(alertJson.optionalStringForKey(KeyTitle) != nil || alertJson.optionalStringForKey(KeyMessage) != nil),
let actionsList = alertJson.optionalArrayForKey("alertActions") as? [[AnyHashable: Any]]
else {
error?.pointee = MVMCoreErrorObject(title: nil, message: MVMCoreGetterUtility.hardcodedString(withKey: HardcodedErrorUnableToProcess), code: ErrorCode.popupFailed.rawValue, domain: ErrorDomainNative, location: String(describing: self))
return nil
}
var actionsForAlert: [UIAlertAction] = []
for actionJson in actionsList {
let style = UIAlertAction.Style(rawValue: actionJson.stringForkey("style"))
let alertAction = UIAlertAction(title: actionJson.optionalStringForKey(KeyTitle), style: style) { action in
MVMCoreActionHandler.shared()?.handleAction(with: actionJson.optionalDictionaryForKey("action"),
additionalData: additionalData,
delegateObject: delegateObject)
}
actionsForAlert.append(alertAction)
}
let alertObject = MVMCoreAlertObject(popupAlertWithTitle: alertJson.optionalStringForKey(KeyTitle),
message: alertJson.optionalStringForKey(KeyMessage),
actions: actionsForAlert,
isGreedy: false)
if let alertStyle = alertJson.optionalStringForKey("style") {
alertObject?.alertStyle = UIAlertController.Style(rawValue: alertStyle)
}
return alertObject
}
}

View File

@ -1,72 +0,0 @@
//
// MVMCoreAlertObject.h
// myverizon
//
// Created by Scott Pfeil on 11/21/14.
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
//
// An object for keeping track of all alert variables. Easier to pass around.
#import <Foundation/Foundation.h>
#import <MVMCore/MVMCoreActionDelegateProtocol.h>
#import <MVMCore/MVMCoreLoadDelegateProtocol.h>
#import <MVMCore/MVMCorePresentationDelegateProtocol.h>
#import <MVMCore/MVMCoreAlertDelegateProtocol.h>
@class MVMCoreErrorObject;
@class MVMCoreLoadObject;
@class DelegateObject;
typedef NS_ENUM(NSInteger, MFAlertType) {
MFAlertTypePopup = 0,
MFAlertTypeField,
MFAlertTypeTop,
MFAlertTypeNone
};
typedef void (^TextFieldErrorHandler)(NSArray * _Nonnull fieldErrors);
@interface MVMCoreAlertObject : NSObject
@property (nullable, strong, nonatomic) NSString *title;
@property (nullable, copy, nonatomic) NSDictionary *pageJson;
@property (nullable, strong, nonatomic) NSString *message;
@property (nonnull, strong, nonatomic) NSArray *actions;
@property (nonatomic) BOOL isGreedy;
@property (nonatomic) UIAlertControllerStyle alertStyle;
@property (nonatomic) MFAlertType type;
@property (nonatomic) BOOL defaultAction;
@property (nonnull, strong, nonatomic) NSArray *fieldErrors;
@property (nullable, nonatomic, copy) TextFieldErrorHandler textFieldErrorHandler;
// Set to be notified of popup style alert events.
@property (nonatomic, weak, nullable) NSObject <MVMCoreAlertDelegateProtocol> *alertDelegate;
// Creates an alert object for an error with the passed in load object response info
+ (nullable instancetype)alertObjectForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error delegateObject:(nullable DelegateObject *)delegateObject;
+ (nullable instancetype)alertObjectForPageType:(nullable NSString *)pageType responseInfo:(nullable NSDictionary *)responseInfo additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
// Initializes a popup style alert object. Look at the alert handler to see what each is used for.
- (nullable instancetype)initPopupAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nonnull NSArray *)actions isGreedy:(BOOL)isGreedy;
// Initializes a popup style alert object using the error passed in. Message is formatted default style. By defualt uses the Okay button to just dismiss the error.
- (nullable instancetype)initPopupAlertWithError:(nullable MVMCoreErrorObject *)error isGreedy:(BOOL)isGreedy;
// Same as above but no default actions. They are passed in.
- (nullable instancetype)initPopupAlertWithError:(nullable MVMCoreErrorObject *)error actions:(nonnull NSArray *)actions isGreedy:(BOOL)isGreedy;
// Returns the alert object made with the page json. If there is not enough data to make, we will set error
+ (nullable instancetype)alertObjectWithPage:(nullable NSDictionary *)page isGreedy:(BOOL)isGreedy additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject error:(MVMCoreErrorObject *_Nullable *_Nullable)error;
// Will show this alert in it's appropriate type style.
- (void)showAlert;
#pragma mark - Deprecated
// Creates an alert object for an error with the passed in load object response info
+ (nullable instancetype)alertObjectForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error actionDelegate:(nullable NSObject <MVMCoreLoadDelegateProtocol,MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)actionDelegate __deprecated;
+ (nullable instancetype)alertObjectForPageType:(nullable NSString *)pageType responseInfo:(nullable NSDictionary *)responseInfo additionalData:(nullable NSDictionary *)additionalData actionDelegate:(nullable NSObject <MVMCoreLoadDelegateProtocol,MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)actionDelegate __deprecated;
+ (nullable instancetype)alertObjectWithPage:(nullable NSDictionary *)page isGreedy:(BOOL)isGreedy additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol,MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate error:(MVMCoreErrorObject *_Nullable *_Nullable)error __deprecated;
@end

View File

@ -1,302 +0,0 @@
//
// MVMCoreAlertObject.m
// myverizon
//
// Created by Scott Pfeil on 11/21/14.
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
//
#import "MVMCoreAlertObject.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreTopAlertObject.h"
#import "MVMCoreCache.h"
#import "MVMCoreErrorConstants.h"
#import "MVMCoreErrorObject.h"
#import "MVMCoreLoadObject.h"
#import "MVMCoreGetterUtility.h"
#import "NSDictionary+MFConvenience.h"
#import "MVMCoreHardcodedStringsConstants.h"
#import "MVMCoreJSONConstants.h"
#import <MVMCore/MVMCoreActionHandler.h>
#import <MVMCore/MVMCore-Swift.h>
@interface MVMCoreAlertObject ()
@property (strong, nonatomic) MVMCoreLoadObject *loadObject;
@property (nullable, strong, nonatomic) NSString *systemDomain;
@property (nullable, strong, nonatomic) MVMCoreTopAlertObject *topAlertObject;
@end
@implementation MVMCoreAlertObject
+ (nullable instancetype)alertObjectForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error delegateObject:(nullable DelegateObject *)delegateObject {
MVMCoreAlertObject *alert = nil;
if (!error || [ErrorDomainServer isEqualToString:error.domain]) {
alert = [MVMCoreAlertObject alertObjectForPageType:loadObject.pageType responseInfo:loadObject.responseInfoMap additionalData:loadObject.dataForPage delegateObject:delegateObject];
} else {
alert = [[MVMCoreAlertObject alloc] initPopupAlertWithError:error isGreedy:NO];
}
// only if actions are empty, then go inside and set OK as default action
if (alert.type == MFAlertTypePopup && alert.actions.count == 0) {
alert.defaultAction = YES;
alert.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
}
return alert;
}
+ (nullable instancetype)alertObjectForPageType:(nullable NSString *)pageType responseInfo:(nullable NSDictionary *)responseInfo additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
__block MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init];
alert.title = [responseInfo stringForKey:KeyErrorHeading];
alert.message = [responseInfo stringForKey:KeyUserMessage];
NSString *messageStyle = [responseInfo stringForKey:KeyMessageStyle];
if ([ValueTypeFieldErrors isEqualToString:[responseInfo string:KeyType]]) {
// field errors.
alert.type = MFAlertTypeField;
alert.fieldErrors = [responseInfo array:ValueTypeFieldErrors];
} else {
// Check for top alert (persistent or regular).
if ([messageStyle isEqualToString:ValueMessageStyleTopPersistent] || [messageStyle isEqualToString:ValueMessageStyleTop]) {
alert.topAlertObject = [[MVMCoreTopAlertObject alloc] initWithResponseInfo:responseInfo];
alert.topAlertObject.delegate = delegateObject.topAlertDelegate;
alert.topAlertObject.pageType = pageType;
alert.type = MFAlertTypeTop;
} else if ([messageStyle isEqualToString:ValueMessageStylePopup]) {
// Perform a popup.
alert.type = MFAlertTypePopup;
alert.alertStyle = UIAlertControllerStyleAlert;
// Check if we have a popup driven by page object (otherwise by default it will just use response info title message with an OK button).
NSString *pageTypeForPopup = [responseInfo stringForKey:@"popupPageType"];
[[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForPopup queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) {
MVMCoreErrorObject *error = nil;
MVMCoreAlertObject *popupAlert = [MVMCoreAlertObject alertObjectWithPage:jsonDictionary isGreedy:NO additionalData:additionalData delegateObject:delegateObject error:&error];
if (error) {
// Error, popup page not found for page type.
popupAlert = [[MVMCoreAlertObject alloc] initPopupAlertWithError:error isGreedy:NO];
}
if (popupAlert) {
alert = popupAlert;
}
}];
} else if (messageStyle.length == 0 && pageType) {
// No message style!
alert.type = MFAlertTypeNone;
} else {
// Default to popup
alert.type = MFAlertTypePopup;
alert.alertStyle = UIAlertControllerStyleAlert;
}
}
alert.alertDelegate = delegateObject.alertDelegate;
return alert;
}
- (nullable instancetype)initPopupAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message actions:(nonnull NSArray *)actions isGreedy:(BOOL)isGreedy {
if (self = [super init]) {
self.title = title;
self.message = message;
self.actions = actions;
self.isGreedy = isGreedy;
self.type = MFAlertTypePopup;
self.alertStyle = UIAlertControllerStyleAlert;
}
return self;
}
- (nullable instancetype)initPopupAlertWithError:(nullable MVMCoreErrorObject *)error isGreedy:(BOOL)isGreedy {
if (self = [super init]) {
self.title = error.title;
self.message = [NSString stringWithFormat:@"%@ (%@)",error.messageToDisplay,[error stringErrorCode]];
self.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
self.defaultAction = YES;
self.isGreedy = isGreedy;
self.type = MFAlertTypePopup;
self.alertStyle = UIAlertControllerStyleAlert;
}
return self;
}
- (nullable instancetype)initPopupAlertWithError:(nullable MVMCoreErrorObject *)error actions:(nonnull NSArray *)actions isGreedy:(BOOL)isGreedy {
if (self = [super init]) {
self.title = error.title;
self.message = [NSString stringWithFormat:@"%@ (%@)",error.messageToDisplay,[error stringErrorCode]];
self.actions = actions;
self.isGreedy = isGreedy;
self.type = MFAlertTypePopup;
self.alertStyle = UIAlertControllerStyleAlert;
}
return self;
}
+ (nullable instancetype)alertObjectWithPage:(nullable NSDictionary *)page isGreedy:(BOOL)isGreedy additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject error:(MVMCoreErrorObject *_Nullable *_Nullable)error {
MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init];
alert.title = [page stringForKey:KeyTitle];
alert.pageJson = page;
alert.message = [page stringForKey:KeyMessage];
alert.isGreedy = isGreedy;
alert.type = MFAlertTypePopup;
alert.alertStyle = UIAlertControllerStyleAlert;
NSArray <NSDictionary *> *actions = [page array:KeyLinks];
NSMutableArray <UIAlertAction *> *actionsForAlert = [NSMutableArray array];
for (NSDictionary *actionMap in actions) {
[actionsForAlert addObject:[UIAlertAction actionWithTitle:[actionMap stringForKey:KeyTitle] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionMap additionalData:additionalData delegateObject:delegateObject];
}]];
}
alert.actions = actionsForAlert;
if ((alert.title.length > 0 || alert.message.length > 0) && alert.actions.count > 0) {
return alert;
} else {
if (error) {
*error = [[MVMCoreErrorObject alloc] initWithTitle:nil messageToLog:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodePopupFailed domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_Popup_pageType:%@",NSStringFromClass([delegateObject.alertDelegate class]),[page stringForKey:KeyPageType]]];
}
return nil;
}
}
- (void)showAlert {
switch (self.type) {
case MFAlertTypeField:
self.textFieldErrorHandler(self.fieldErrors);
break;
case MFAlertTypeTop:
[[MVMCoreAlertHandler sharedAlertHandler] showTopAlertWithObject:self.topAlertObject];
break;
case MFAlertTypePopup:
[[MVMCoreAlertHandler sharedAlertHandler] showAlertWithAlertObject:self];
break;
default:
break;
}
}
#pragma mark - Deprecated
+ (nullable instancetype)alertObjectForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error actionDelegate:(nullable NSObject <MVMCoreLoadDelegateProtocol,MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)actionDelegate {
MVMCoreAlertObject *alert = nil;
if (!error || [ErrorDomainServer isEqualToString:error.domain]) {
alert = [MVMCoreAlertObject alertObjectForPageType:loadObject.pageType responseInfo:loadObject.responseInfoMap additionalData:loadObject.dataForPage actionDelegate:actionDelegate];
} else {
alert = [[MVMCoreAlertObject alloc] initPopupAlertWithError:error isGreedy:NO];
}
// only if actions are empty, then go inside and set OK as default action
if (alert.type == MFAlertTypePopup && alert.actions.count == 0) {
alert.defaultAction = YES;
alert.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
}
return alert;
}
+ (nullable instancetype)alertObjectForPageType:(nullable NSString *)pageType responseInfo:(nullable NSDictionary *)responseInfo additionalData:(nullable NSDictionary *)additionalData actionDelegate:(nullable NSObject <MVMCoreLoadDelegateProtocol,MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)actionDelegate {
__block MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init];
alert.title = [responseInfo stringForKey:KeyErrorHeading];
alert.message = [responseInfo stringForKey:KeyUserMessage];
NSString *messageStyle = [responseInfo stringForKey:KeyMessageStyle];
if ([ValueTypeFieldErrors isEqualToString:[responseInfo string:KeyType]]) {
// field errors.
alert.type = MFAlertTypeField;
alert.fieldErrors = [responseInfo array:ValueTypeFieldErrors];
} else {
// Check for top alert (persistent or regular).
if ([messageStyle isEqualToString:ValueMessageStyleTopPersistent] || [messageStyle isEqualToString:ValueMessageStyleTop]) {
alert.topAlertObject = [[MVMCoreTopAlertObject alloc] initWithResponseInfo:responseInfo];
if ([actionDelegate conformsToProtocol:@protocol(MVMCoreTopAlertDelegateProtocol)]) {
alert.topAlertObject.delegate = (NSObject <MVMCoreTopAlertDelegateProtocol> *)actionDelegate;
}
alert.topAlertObject.pageType = pageType;
alert.type = MFAlertTypeTop;
} else if ([messageStyle isEqualToString:ValueMessageStylePopup]) {
// Perform a popup.
alert.type = MFAlertTypePopup;
alert.alertStyle = UIAlertControllerStyleAlert;
// Check if we have a popup driven by page object (otherwise by default it will just use response info title message with an OK button).
NSString *pageTypeForPopup = [responseInfo stringForKey:@"popupPageType"];
[[MVMCoreCache sharedCache] fetchJSONForPageType:pageTypeForPopup queue:nil waitUntilFinished:YES completionHandler:^(NSDictionary * _Nullable jsonDictionary) {
MVMCoreErrorObject *error = nil;
MVMCoreAlertObject *popupAlert = [MVMCoreAlertObject alertObjectWithPage:jsonDictionary isGreedy:NO additionalData:additionalData delegate:actionDelegate error:&error];
if (error) {
// Error, popup page not found for page type.
popupAlert = [[MVMCoreAlertObject alloc] initPopupAlertWithError:error isGreedy:NO];
}
if (popupAlert) {
alert = popupAlert;
}
}];
} else if (messageStyle.length == 0 && pageType) {
// No message style!
alert.type = MFAlertTypeNone;
} else {
// Default to popup
alert.type = MFAlertTypePopup;
alert.alertStyle = UIAlertControllerStyleAlert;
}
}
if ([actionDelegate conformsToProtocol:@protocol(MVMCoreAlertDelegateProtocol)]) {
alert.alertDelegate = (NSObject <MVMCoreAlertDelegateProtocol> *)actionDelegate;
}
return alert;
}
+ (nullable instancetype)alertObjectWithPage:(nullable NSDictionary *)page isGreedy:(BOOL)isGreedy additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol,MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate error:(MVMCoreErrorObject *_Nullable *_Nullable)error {
MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init];
alert.title = [page stringForKey:KeyTitle];
alert.pageJson = page;
alert.message = [page stringForKey:KeyMessage];
alert.isGreedy = isGreedy;
alert.type = MFAlertTypePopup;
alert.alertStyle = UIAlertControllerStyleAlert;
NSArray <NSDictionary *> *actions = [page array:KeyLinks];
NSMutableArray <UIAlertAction *> *actionsForAlert = [NSMutableArray array];
for (NSDictionary *actionMap in actions) {
[actionsForAlert addObject:[UIAlertAction actionWithTitle:[actionMap stringForKey:KeyTitle] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:actionMap additionalData:additionalData delegate:delegate];
}]];
}
alert.actions = actionsForAlert;
if ((alert.title.length > 0 || alert.message.length > 0) && alert.actions.count > 0) {
return alert;
} else {
if (error) {
*error = [[MVMCoreErrorObject alloc] initWithTitle:nil messageToLog:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodePopupFailed domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_Popup_pageType:%@",NSStringFromClass([delegate class]),[page stringForKey:KeyPageType]]];
}
return nil;
}
}
@end

View File

@ -1,39 +0,0 @@
//
// MVMCoreAlertOperation.h
// myverizon
//
// Created by Scott Pfeil on 9/28/15.
// Copyright © 2015 Verizon Wireless. All rights reserved.
//
// Operation for handling an alert. Should NOT be on the main queue.
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "MVMCoreOperation.h"
#import "MVMCoreAlertDelegateProtocol.h"
@interface MVMCoreAlertOperation : MVMCoreOperation
/// Alert controller to be displayed.
@property (nonnull, readonly) UIAlertController *currentAlertView;
/// If this operation is temporarily paused.
@property (readonly, getter=isPaused) BOOL paused;
/// If this alert is a greedy alert (See MVMCoreAlertHandler).
@property (readonly, getter=isGreedy) BOOL greedy;
/// The alert delegate if needed.
@property (readonly, nullable, nonatomic, weak) NSObject <MVMCoreAlertDelegateProtocol> *alertDelegate;
/// Initializes the operation with the alert to display and if it is greedy or not.
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy;
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy alertDelegate:(nullable id <MVMCoreAlertDelegateProtocol>)alertDelegate;
/// Pauses the operation. Temporarily removes any alert.
- (void)pause;
/// Unpauses the operation, resuming any alert.
- (void)unpause;
@end

View File

@ -1,242 +0,0 @@
//
// MVMCoreAlertOperation.m
// myverizon
//
// Created by Scott Pfeil on 9/28/15.
// Copyright © 2015 Verizon Wireless. All rights reserved.
//
#import "MVMCoreAlertOperation.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreAlertController.h"
#import "MVMCoreNavigationHandler.h"
@interface MVMCoreAlertOperation () {
__block BOOL _paused;
__block BOOL _displayed;
}
@property (readwrite, getter=isPaused) BOOL paused;
@property (readwrite, getter=isGreedy) BOOL greedy;
@property (readwrite, getter=isDisplayed) BOOL displayed;
@property (readwrite, nullable, nonatomic, weak) NSObject <MVMCoreAlertDelegateProtocol> *alertDelegate;
// The currently displayed alert view.
@property (nullable, strong, nonatomic) UIAlertController *currentAlertView;
// A boolean to keep track of if we alreadys signed up to observe.
@property (assign, nonatomic) BOOL alertBeingObserved;
// For thread safety
@property (strong, nonatomic) dispatch_queue_t pausedQueue;
@property (strong, nonatomic) dispatch_queue_t displayedQueue;
// Dismisses the alert.
- (void)dismissAlertView;
// Begins observing for when the alert is dismissed.
- (void)observeForCurrentAlertViewDismissal;
// Stops observing for when the alert is dismissed.
- (void)stopObservingAlertView;
@end
@implementation MVMCoreAlertOperation
// The context for kvo
static void * XXContext = &XXContext;
- (instancetype)init {
self = [super init];
if (self) {
self.pausedQueue = dispatch_queue_create("paused", DISPATCH_QUEUE_CONCURRENT);
self.displayedQueue = dispatch_queue_create("displayed", DISPATCH_QUEUE_CONCURRENT);
}
return self;
}
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy {
if (self = [self init]) {
self.currentAlertView = alert;
self.greedy = isGreedy;
}
return self;
}
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy alertDelegate:(nullable NSObject <MVMCoreAlertDelegateProtocol>*)alertDelegate {
if (self = [self initWithAlert:alert isGreedy:isGreedy]) {
self.alertDelegate = alertDelegate;
}
return self;
}
- (void)dealloc {
[self stopObservingAlertView];
}
- (BOOL)isPaused {
__block BOOL isPaused;
dispatch_sync(self.pausedQueue, ^{
isPaused = self->_paused;
});
return isPaused;
}
- (void)setPaused:(BOOL)paused {
dispatch_barrier_async(self.pausedQueue, ^{
self->_paused = paused;
});
}
- (BOOL)isDisplayed {
__block BOOL isDisplayed;
dispatch_sync(self.displayedQueue, ^{
isDisplayed = self->_displayed;
});
return isDisplayed;
}
- (void)setDisplayed:(BOOL)displayed {
dispatch_barrier_async(self.displayedQueue, ^{
self->_displayed = displayed;
});
}
- (void)main {
// Always check for cancellation before launching the task.
if ([self checkAndHandleForCancellation]) {
return;
}
// Display alert only if alerts aren't supressed.
if (![[MVMCoreAlertHandler sharedAlertHandler] mfAlertsSupressed] && self.currentAlertView) {
// Observe for when it is removed.
[self observeForCurrentAlertViewDismissal];
// Adds the presentation to the animation queue.
[[MVMCoreNavigationHandler sharedNavigationHandler] presentViewController:self.currentAlertView animated:YES delegate:nil completionHandler:^{
// We finished but it was not displayed yet. It's possible that it was cancelled. Finish this task
if (!self.isDisplayed) {
[self markAsFinished];
} else if (self.isCancelled) {
[self dismissAlertView];
}
}];
}
}
- (void)cancel {
[super cancel];
// Notify delegate that the alert is cancelled.
if ([self.alertDelegate respondsToSelector:@selector(alertCancelled:)]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.alertDelegate alertCancelled:self.currentAlertView];
});
}
[self dismissAlertView];
}
- (void)dismissAlertView {
if (self.isDisplayed) {
// Dismisses.
[[MVMCoreNavigationHandler sharedNavigationHandler] dismissViewController:self.currentAlertView animated:YES];
}
}
- (void)pause {
[self willChangeValueForKey:@"isPaused"];
self.paused = YES;
[self didChangeValueForKey:@"isPaused"];
// Notify delegate of pause.
if ([self.alertDelegate respondsToSelector:@selector(alertPaused:)]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.alertDelegate alertPaused:self.currentAlertView];
});
}
// Dismiss until unpaused.
[self dismissAlertView];
}
- (void)unpause {
[self willChangeValueForKey:@"isPaused"];
self.paused = NO;
[self didChangeValueForKey:@"isPaused"];
// Notify delegate of unpause.
if ([self.alertDelegate respondsToSelector:@selector(alertUnpaused:)]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.alertDelegate alertUnpaused:self.currentAlertView];
});
}
// Show alert...
if (self.currentAlertView) {
[self start];
}
}
#pragma mark - Observer Functions
- (void)observeForCurrentAlertViewDismissal {
if (!self.alertBeingObserved && ![[MVMCoreAlertHandler sharedAlertHandler] mfAlertsSupressed] && self.currentAlertView && [self.currentAlertView isKindOfClass:[UIAlertController class]]) {
self.alertBeingObserved = YES;
[self.currentAlertView addObserver:self forKeyPath:@"visible" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:XXContext];
}
}
- (void)stopObservingAlertView {
if (self.alertBeingObserved) {
[self.currentAlertView removeObserver:self forKeyPath:@"visible" context:XXContext];
self.alertBeingObserved = NO;
}
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (context == XXContext && [keyPath isEqualToString:@"visible"]) {
if (![object isVisible]) {
self.displayed = NO;
// Notify delegate that the alert is dismissed.
if ([self.alertDelegate respondsToSelector:@selector(alertDismissed:)]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.alertDelegate alertDismissed:self.currentAlertView];
});
}
// Is visible was set to NO, meaning that the alertview is no longer visible.
if (!self.isPaused) {
[self stopObservingAlertView];
self.currentAlertView = nil;
[self markAsFinished];
}
} else {
self.displayed = YES;
// Notify delegate that the alert is shown.
if ([self.alertDelegate respondsToSelector:@selector(alertShown:)]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.alertDelegate alertShown:self.currentAlertView];
});
}
}
}
}
@end

View File

@ -1,22 +0,0 @@
//
// MVMCoreTopAlertAnimationDelegateProtocol.h
// mobilefirst
//
// Created by Scott Pfeil on 6/4/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol MVMCoreTopAlertAnimationDelegateProtocol
// Called when the top alert is starting an animation
- (void)topAlertViewBeginAnimation;
// Called when the top alert is ending an animation
- (void)topAlertViewFinishAnimation;
// Called when the top alert close button was pressed by the user
- (void)topAlertCloseButtonPressed;
@end

View File

@ -1,23 +0,0 @@
//
// MVMCoreTopAlertDelegateProtocol.h
// mobilefirst
//
// Created by Scott Pfeil on 6/4/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MVMCoreTopAlertObject;
@protocol MVMCoreTopAlertDelegateProtocol
@optional
- (void)topAlertViewShown:(nonnull id)topAlert topAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject;
- (void)topAlertViewDismissed:(nonnull id)topAlert;
// Called when the top alert is pressed. Determines if we should load the option the default way or not.
- (BOOL)shouldLoadTopAlertAction:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData;
@end

View File

@ -1,64 +0,0 @@
//
// MVMCoreTopAlertObject.h
// mobilefirst
//
// Created by Scott Pfeil on 5/24/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreTopAlertDelegateProtocol.h>
extern NSUInteger const TopAlertDismissTime;
@interface MVMCoreTopAlertObject : NSObject
@property (nonatomic) BOOL persistent;
@property (nullable, nonatomic) NSString *type;
@property (nonatomic) NSOperationQueuePriority queuePriority;
// The text
@property (nullable, strong, nonatomic) NSString *title;
@property (nullable, strong, nonatomic) NSString *message;
@property (nullable, strong, nonatomic) NSString *topMessage;
// For the button.
@property (nullable, strong, nonatomic) NSDictionary *buttonMap;
@property (nullable, strong, nonatomic) NSDictionary *additionalData;
@property (nonatomic) BOOL useCloseButton;
// For non action map driven button.
@property (nullable, strong, nonatomic) NSString *buttonTitle;
@property (nullable, copy, nonatomic) void (^userActionHandler)(id _Nonnull sender);
@property (nullable, weak, nonatomic) NSObject <MVMCoreTopAlertDelegateProtocol> *delegate;
// This is used to ensure legacy style stays intact with new changes
@property (nonatomic) BOOL useNewStyle;
// The page type used for the top alert
@property (nullable, strong, nonatomic) NSString *pageType;
// image name or url used imageviews
@property (nullable, strong, nonatomic) NSString *imageNameOrURL;
@property (nullable, strong, nonatomic) NSString *aboveTextImageString;
// If 0, uses default 5 seconds.
@property (nonatomic) NSInteger topAlertDismissTime;
// Server can set color.
@property (nullable, strong, nonatomic) UIColor *backgroundColor;
@property (nullable, strong, nonatomic) UIColor *textColor;
// The full top alert json. Currently only used for molecular.
@property (nullable, strong, nonatomic) NSDictionary *json;
- (nullable instancetype)initWithResponseInfo:(nullable NSDictionary *)responseInfo;
- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message;
- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData;
- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id _Nonnull sender))userActionHandler;
@end

View File

@ -1,95 +0,0 @@
//
// MVMCoreTopAlertObject.m
// mobilefirst
//
// Created by Scott Pfeil on 5/24/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import "MVMCoreTopAlertObject.h"
#import <MVMCore/NSDictionary+MFConvenience.h>
#import "MVMCoreGetterUtility.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreJSONConstants.h"
NSUInteger const TopAlertDismissTime = 5;
@implementation MVMCoreTopAlertObject
- (nullable instancetype)initWithResponseInfo:(nullable NSDictionary *)responseInfo {
if (self = [super init]) {
self.type = [responseInfo string:KeyType];
self.persistent = [[responseInfo stringForKey:KeyMessageStyle] isEqualToString:ValueMessageStyleTopPersistent];
self.title = [responseInfo string:KeyMessage];
self.message = [responseInfo string:KeyUserMessage];
self.buttonMap = [responseInfo dict:KeyButtonMap];
self.topMessage = [responseInfo string:KeyTopMessage];
self.imageNameOrURL = [responseInfo string:@"topAlertImageUrl"];
self.aboveTextImageString = [responseInfo string:@"topAlertImageURLAboveText"];
NSString *color = [responseInfo string:@"topAlertColor"];
if (color) {
self.backgroundColor = [MVMCoreGetterUtility getColorForHexString:color];
}
color = [responseInfo string:@"messageColor"];
if (color) {
self.textColor = [MVMCoreGetterUtility getColorForHexString:color];
}
// The default is yes if not sent by server (for legacy to work as is)
NSNumber *closeButton = [responseInfo optionalNumberForKey:KeyCloseButton];
if (closeButton != nil) {
self.useCloseButton = [closeButton boolValue];
} else {
self.useCloseButton = YES;
}
self.useNewStyle = [responseInfo boolForKey:@"newTopAlertStyle"];
// Server driven dismiss time.
NSNumber *topAlertTime = [responseInfo optionalNumberForKey:@"topAlertTime"];
if (topAlertTime != nil) {
self.topAlertDismissTime = [topAlertTime integerValue];
}
}
return self;
}
- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message {
return [self initWithType:type message:nil subMessage:message persistent:NO actionMap:nil additionalData:nil];
}
- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent actionMap:(nullable NSDictionary *)actionMap additionalData:(nullable NSDictionary *)additionalData {
if (self = [super init]) {
self.type = type;
self.persistent = persistent;
self.title = message;
self.message = subMessage;
self.buttonMap = actionMap;
self.additionalData = additionalData;
}
return self;
}
- (nullable instancetype)initWithType:(nullable NSString *)type message:(nullable NSString *)message subMessage:(nullable NSString *)subMessage persistent:(BOOL)persistent buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id _Nonnull sender))userActionHandler {
if (self = [super init]) {
self.type = type;
self.persistent = persistent;
self.title = message;
self.message = subMessage;
self.buttonTitle = buttonTitle;
self.userActionHandler = userActionHandler;
}
return self;
}
@end

View File

@ -1,33 +0,0 @@
//
// MVMCoreTopAlertOperation.h
// mobilefirst
//
// Created by Scott Pfeil on 6/4/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import "MVMCoreOperation.h"
#import "MVMCoreTopAlertAnimationDelegateProtocol.h"
@class MVMCoreTopAlertObject;
@interface MVMCoreTopAlertOperation : MVMCoreOperation <MVMCoreTopAlertAnimationDelegateProtocol>
@property (readonly, getter=isPaused) BOOL paused;
@property (nonatomic) BOOL reAddAfterCancel;
@property (nonnull, nonatomic, strong) MVMCoreTopAlertObject *topAlertObject;
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject;
/// Updates the operation with a new object
- (void)updateWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject;
// Pauses the operation. Temporarily removes any alert.
- (void)pause;
// Unpauses the operation, resuming any alert.
- (void)unpause;
@end

View File

@ -1,264 +0,0 @@
//
// MVMCoreTopAlertOperation.m
// mobilefirst
//
// Created by Scott Pfeil on 6/4/16.
// Copyright © 2016 Verizon Wireless. All rights reserved.
//
#import "MVMCoreTopAlertOperation.h"
#import "MVMCoreTopAlertObject.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreObject.h"
#import "MVMCoreSessionObject.h"
@interface MVMCoreTopAlertOperation () {
__block BOOL _paused;
__block BOOL _displayed;
__block BOOL _animating;
}
@property (readwrite, getter=isPaused) BOOL paused;
@property (readwrite, getter=isDisplayed) BOOL displayed;
@property (readwrite, getter=isAnimating) BOOL animating;
// For thread safety
@property (strong, nonatomic) dispatch_queue_t pausedQueue;
@property (strong, nonatomic) dispatch_queue_t displayedQueue;
@property (strong, nonatomic) dispatch_queue_t animatingQueue;
@property (nonatomic, strong) dispatch_source_t timerSource;
@end
@implementation MVMCoreTopAlertOperation
- (instancetype)init {
self = [super init];
if (self) {
self.pausedQueue = dispatch_queue_create("paused", DISPATCH_QUEUE_CONCURRENT);
self.displayedQueue = dispatch_queue_create("displayed", DISPATCH_QUEUE_CONCURRENT);
self.animatingQueue = dispatch_queue_create("animating", DISPATCH_QUEUE_CONCURRENT);
}
return self;
}
- (nullable instancetype)initWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject {
if (self = [self init]) {
self.topAlertObject = topAlertObject;
// Sets the queue priority for various types of alerts.
self.queuePriority = [[MVMCoreObject sharedInstance].globalTopAlertDelegate priorityForTopAlertByObject:topAlertObject];
}
return self;
}
- (void)updateWithTopAlertObject:(nonnull MVMCoreTopAlertObject *)topAlertObject {
self.topAlertObject = topAlertObject;
self.queuePriority = [[MVMCoreObject sharedInstance].globalTopAlertDelegate priorityForTopAlertByObject:topAlertObject];
if (self.isExecuting && !self.isCancelled && !self.isPaused) {
[self updateDismissTimer];
UIView <MVMCoreTopAlertViewProtocol>*topAlertView = [[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView];
if ([topAlertView respondsToSelector:@selector(updateTopAlertWith:)]) {
[topAlertView updateTopAlertWith:topAlertObject];
}
}
}
- (BOOL)isPaused {
__block BOOL isPaused;
dispatch_sync(self.pausedQueue, ^{
isPaused = self->_paused;
});
return isPaused;
}
- (void)setPaused:(BOOL)paused {
dispatch_barrier_async(self.pausedQueue, ^{
self->_paused = paused;
});
}
- (BOOL)isDisplayed {
__block BOOL isDisplayed;
dispatch_sync(self.displayedQueue, ^{
isDisplayed = self->_displayed;
});
return isDisplayed;
}
- (void)setDisplayed:(BOOL)displayed {
dispatch_barrier_async(self.displayedQueue, ^{
self->_displayed = displayed;
});
}
- (BOOL)isAnimating {
__block BOOL isAnimating;
dispatch_sync(self.animatingQueue, ^{
isAnimating = self->_animating;
});
return isAnimating;
}
- (void)setAnimating:(BOOL)animating {
dispatch_barrier_async(self.animatingQueue, ^{
self->_animating = animating;
});
}
- (void)main {
// Always check for cancellation before launching the task.
if ([self checkAndHandleForCancellation]) {
return;
}
// Do nothing if paused
if (!self.isPaused) {
// Display alert only if alerts aren't supressed.
if (![[MVMCoreAlertHandler sharedAlertHandler] mfAlertsSupressed]) {
// Show
if (![[MVMCoreObject sharedInstance].globalTopAlertDelegate respondsToSelector:@selector(getTopAlertView)]) {
// Needs to be a top alert view....
[self markAsFinished];
} else {
UIView <MVMCoreTopAlertViewProtocol>*topAlertView = [[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView];
[topAlertView showWithTopAlertObject:self.topAlertObject animationDelegate:self completionHandler:^(BOOL finished) {
self.displayed = YES;
if (self.isCancelled) {
// Cancelled, dismiss immediately.
[self dismissAlertView:YES forceful:YES];
} else if (self.isPaused) {
// Paused, dismiss for the time being if persistent.
[self dismissAlertView:!self.topAlertObject.persistent forceful:YES];
} else {
[self updateDismissTimer];
}
}];
}
} else {
[self pause];
}
}
}
/// Updates the timer to dismiss the top alert.
- (void)updateDismissTimer {
if (self.timerSource) {
dispatch_source_cancel(self.timerSource);
}
if (self.topAlertObject.persistent) {
return;
}
NSInteger dismissTime;
if (self.topAlertObject.topAlertDismissTime > 0) {
dismissTime = self.topAlertObject.topAlertDismissTime;
} else {
dismissTime = TopAlertDismissTime;
}
self.timerSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
dispatch_source_set_timer(self.timerSource, dispatch_time(DISPATCH_TIME_NOW, dismissTime * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, (1ull * NSEC_PER_SEC) / 10);
__weak typeof(self) weakSelf = self;
dispatch_source_set_event_handler(self.timerSource, ^{
if (weakSelf.isFinished || [weakSelf checkAndHandleForCancellation]) {
return;
}
[weakSelf dismissAlertView:YES forceful:NO];
});
dispatch_resume(self.timerSource);
}
- (void)cancel {
[super cancel];
// Do nothing if animating.
if (!self.isAnimating) {
if (self.isDisplayed) {
[self dismissAlertView:YES forceful:YES];
} else if (self.isExecuting) {
[self markAsFinished];
}
}
}
- (void)dismissAlertView:(BOOL)andFinish forceful:(BOOL)forceful {
if (self.timerSource) {
dispatch_source_cancel(self.timerSource);
}
if (self.isDisplayed && !self.isAnimating) {
// Dismisses.
[[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] hideAlertView:forceful completionHandler:^(BOOL finished) {
self.displayed = NO;
if (andFinish) {
[self markAsFinished];
}
}];
}
}
- (void)pause {
if (!self.paused) {
[self willChangeValueForKey:@"isPaused"];
self.paused = YES;
[self didChangeValueForKey:@"isPaused"];
}
[self dismissAlertView:!self.topAlertObject.persistent forceful:YES];
}
- (void)unpause {
if (self.paused) {
[self willChangeValueForKey:@"isPaused"];
self.paused = NO;
[self didChangeValueForKey:@"isPaused"];
}
if (self.executing) {
[self start];
}
}
#pragma mark - Delegate functions
- (void)topAlertViewBeginAnimation {
self.animating = YES;
}
- (void)topAlertViewFinishAnimation {
self.animating = NO;
}
- (void)topAlertCloseButtonPressed {
[self dismissAlertView:YES forceful:YES];
}
- (id)copyWithZone:(nullable NSZone *)zone {
MVMCoreTopAlertOperation *copyObject = [[MVMCoreTopAlertOperation alloc] init];
copyObject.topAlertObject = self.topAlertObject;
copyObject.paused = self.paused;
copyObject.reAddAfterCancel = self.reAddAfterCancel;
copyObject.queuePriority = self.queuePriority;
for (NSOperation *dependency in self.dependencies) {
[copyObject addDependency:dependency];
}
copyObject.name = self.name;
copyObject.qualityOfService = self.qualityOfService;
return copyObject;
}
@end

View File

@ -1,28 +0,0 @@
//
// MVMCoreTopAlertViewProtocol.h
// MVMCore
//
// Created by Pfeil, Scott Robert on 1/2/18.
// Copyright © 2018 myverizon. All rights reserved.
//
#import <MVMCore/MVMCoreTopAlertAnimationDelegateProtocol.h>
@class MVMCoreTopAlertObject;
@protocol MVMCoreTopAlertViewProtocol
@optional
// Show based on the object
- (void)showWithTopAlertObject:(nullable MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nonnull id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
// Hides
- (void)hideAlertView:(BOOL)forceful completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
// Collapses the notification if it has a short top message. Otherwise removes notification.
- (void)collapseNotification;
/// Updates the existing top alert with the new object
- (void)updateTopAlertWith:(nullable MVMCoreTopAlertObject *)topAlertObject;
@end

View File

@ -35,13 +35,9 @@ extern NSString * const KeyShareType;
extern NSString * const KeyShareText;
extern NSString * const KeyActionTypeCall;
extern NSString * const KeyActionTypePreviousSubmit;
extern NSString * const KeyActionTypePopup;
extern NSString * const KeyActionTypeCancel;
extern NSString * const KeyActionTypeRedirect;
extern NSString * const KeyActionTypeTopAlert;
extern NSString * const KeyActionTypeSettings;
extern NSString * const KeyActionTypeCollapseNotification;
extern NSString * const KeyActionTypeAlert;
extern NSString * const KeyActionTypeNoop;
extern NSString * const KeyActionInformation;
extern NSString * const KeyLinkAwayAppURL;

View File

@ -35,13 +35,9 @@ NSString * const KeyActionTypeBack = @"back";
NSString * const KeyActionTypeShare = @"share";
NSString * const KeyActionTypeCall = @"call";
NSString * const KeyActionTypePreviousSubmit = @"previousSubmit";
NSString * const KeyActionTypePopup = @"popup";
NSString * const KeyActionTypeCancel = @"cancel";
NSString * const KeyActionTypeRedirect = @"switchApp";
NSString * const KeyActionTypeTopAlert = @"topAlert";
NSString * const KeyActionTypeSettings = @"openSettings";
NSString * const KeyActionTypeCollapseNotification = @"collapseNotification";
NSString * const KeyActionTypeAlert = @"alert";
NSString * const KeyActionTypeNoop = @"noop";
NSString * const KeyActionInformation = @"actionInformation";
NSString * const KeyLinkAwayAppURL = @"appURL";

View File

@ -38,13 +38,6 @@
* @return True if the calling process should continue. */
- (BOOL)handleModuleError:(nonnull NSString *)module loadObject:(nonnull MVMCoreLoadObject *)loadObject error:(nonnull MVMCoreErrorObject *)error;
/** Get the alert object whose data will be presented. Overwrite this to alter how you want the alert to show.
* @param loadObject The load object.
* @param errorObject An error object if there was an error.
* @return Returns the alert object.
* Details: Gets the alert that will display to the screen. Easier to subclass here to avoid subclassing the displaying logic. */
- (nullable MVMCoreAlertObject *)alertObjectToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)errorObject;
/** Allows the delegate to handle any field errors.
* @param fieldErrors The field errors.
* @param loadObject The load object.*/

View File

@ -21,6 +21,7 @@
#import "MVMCoreHardcodedStringsConstants.h"
#import "MVMCoreObject.h"
#import "MVMCoreConstants.h"
#import "MVMCoreActionUtility.h"
#import <MVMCore/MVMCore-Swift.h>
@interface MVMCoreLoadHandler ()

View File

@ -91,9 +91,6 @@
// 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;
// Shows the appropriate alert tyle for the given response info and/or error.
+ (void)createAndShowAlertForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error delegateObject:(nullable DelegateObject *)delegateObject;
/** Called when the load was finished due to an error. Handles the error and ends the load.
* @param error The error that occured. May be logged depending.
* @param loadObject The load data for the error. **/

View File

@ -13,10 +13,8 @@
#import "MVMCoreSessionTimeHandler.h"
#import "MVMCoreLoggingHandler.h"
#import "MVMCoreSessionObject.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreViewControllerMappingObject.h"
#import "MVMCoreNavigationHandler.h"
#import "MVMCoreAlertObject.h"
#import <MVMCore/MVMCoreDispatchUtility.h>
#import "MVMCoreLoadObject.h"
#import "MVMCoreRequestParameters.h"
@ -327,7 +325,7 @@
+ (void)notifyListenersOfNewResponse:(NSDictionary *)pages modules:(NSDictionary *)modules systemParameters:(NSDictionary *)systemParameters loadObject:(nonnull MVMCoreLoadObject *)loadObject {
NSMutableDictionary *userInfo = nil;
if (pages.count > 0 || modules.count > 0 || systemParameters.count > 0) {
if (pages.count > 0 || modules.count > 0 || systemParameters.count > 0 || loadObject.responseJSON.count > 0) {
userInfo = [NSMutableDictionary dictionary];
if (pages.count > 0) {
[userInfo setObject:pages forKey:KeyPageMap];
@ -376,9 +374,6 @@
if (loadObject.extendsAppSession) {
[[MVMCoreSessionTimeHandler sharedSessionHandler] startSessionTimer];
}
// Dismiss any top alerts that server wants us to dismiss
[[MVMCoreAlertHandler sharedAlertHandler] hidePersistentTopAlertViewOfType:[loadObject.responseInfoMap string:@"disableType"]];
// Adds the modules received from server to any modules we grabbed from the cache.
NSDictionary *modules = [jsonDictionary dict:KeyModuleMap];
@ -758,23 +753,9 @@
}
+ (void)createAndShowAlertForLoadObject:(nullable MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error delegateObject:(nullable DelegateObject *)delegateObject {
// Check delegate for alert object to show.
MVMCoreAlertObject *alertObject;
if ([delegateObject.loadDelegate respondsToSelector:@selector(alertObjectToShow:error:)]) {
alertObject = [delegateObject.loadDelegate alertObjectToShow:loadObject error:error];
} else {
alertObject = [MVMCoreAlertObject alertObjectForLoadObject:loadObject error:error delegateObject:delegateObject];
if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(createAndShowAlertForLoadObject:error:delegateObject:)]) {
[[MVMCoreObject sharedInstance].globalLoadDelegate createAndShowAlertForLoadObject:loadObject error:error delegateObject:delegateObject];
}
// Set how we handle text field errors.
[alertObject setTextFieldErrorHandler:^(NSArray * _Nonnull fieldErrors) {
if ([loadObject.operation.delegateObject.loadDelegate respondsToSelector:@selector(handleFieldErrors:loadObject:)]) {
[loadObject.operation.delegateObject.loadDelegate handleFieldErrors:fieldErrors loadObject:loadObject];
}
}];
[alertObject showAlert];
}
+ (void)loadAbortedWithError:(nonnull MVMCoreErrorObject *)error loadObject:(nonnull MVMCoreLoadObject *)loadObject {

View File

@ -52,18 +52,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[];
#import <MVMCore/MVMCoreLoadHandler.h>
#import <MVMCore/MVMCoreLoadRequestOperation.h>
#import <MVMCore/MVMCoreGlobalLoadProtocol.h>
// Alert Handling
#import <MVMCore/MVMCoreAlertController.h>
#import <MVMCore/MVMCoreAlertObject.h>
#import <MVMCore/MVMCoreTopAlertObject.h>
#import <MVMCore/MVMCoreAlertoperation.h>
#import <MVMCore/MVMCoreAlertHandler.h>
#import <MVMCore/MVMCoreTopAlertAnimationDelegateProtocol.h>
#import <MVMCore/MVMCoreTopAlertDelegateProtocol.h>
#import <MVMCore/MVMCoreGlobalTopAlertDelegateProtocol.h>
#import <MVMCore/MVMCoreTopAlertViewProtocol.h>
#import <MVMCore/MVMCoreAlertDelegateProtocol.h>
// Presentation Handling
#import <MVMCore/MVMCorePresentationDelegateProtocol.h>
@ -79,7 +67,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[];
#import <MVMCore/MVMCoreActionHandler.h>
#import <MVMCore/MVMCoreActionDelegateProtocol.h>
#import <MVMCore/MVMCoreActionUtility.h>
#import <MVMCore/MVMCoreTopAlertOperation.h>
// Protocols
#import <MVMCore/MVMCoreViewControllerProtocol.h>

View File

@ -12,8 +12,6 @@ import UIKit
@objcMembers open class DelegateObject: NSObject {
public weak var actionDelegate: (MVMCoreActionDelegateProtocol & NSObjectProtocol)?
public weak var loadDelegate: (MVMCoreLoadDelegateProtocol & NSObjectProtocol)?
public weak var alertDelegate: (MVMCoreAlertDelegateProtocol & NSObjectProtocol)?
public weak var topAlertDelegate: (MVMCoreTopAlertDelegateProtocol & NSObjectProtocol)?
public weak var presentationDelegate: (MVMCorePresentationDelegateProtocol & NSObjectProtocol)?
required override public init() {
@ -23,8 +21,6 @@ import UIKit
open func setAll(withDelegate delegate: Any) {
actionDelegate = delegate as? (MVMCoreActionDelegateProtocol & NSObjectProtocol)
loadDelegate = delegate as? (MVMCoreLoadDelegateProtocol & NSObjectProtocol)
alertDelegate = delegate as? (MVMCoreAlertDelegateProtocol & NSObjectProtocol)
topAlertDelegate = delegate as? (MVMCoreTopAlertDelegateProtocol & NSObjectProtocol)
presentationDelegate = delegate as? (MVMCorePresentationDelegateProtocol & NSObjectProtocol)
}

View File

@ -35,4 +35,7 @@
// Can return an error object.
- (nonnull MVMCoreErrorObject *)createErrorObjectForRequestNSError:(nonnull NSError *)error forRequest:(nonnull NSURLRequest *)request location:(nullable NSString *)locationForError;
// 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;
@end

View File

@ -1,21 +0,0 @@
//
// MVMCoreGlobalTopAlertDelegateProtocol.h
// MVMCore
//
// Created by Pfeil, Scott Robert on 1/2/18.
// Copyright © 2018 myverizon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MVMCore/MVMCoreTopAlertViewProtocol.h>
@class MVMCoreTopAlertObject;
@protocol MVMCoreGlobalTopAlertDelegateProtocol <NSObject>
- (NSOperationQueuePriority)priorityForTopAlertByObject:(nonnull MVMCoreTopAlertObject *)object;
@optional
- (nonnull UIView <MVMCoreTopAlertViewProtocol>*)getTopAlertView;
@end

View File

@ -1,30 +0,0 @@
//
// ActionPopupModel.swift
// MVMCore
//
// Created by Suresh, Kamlesh on 12/16/19.
// Copyright © 2019 myverizon. All rights reserved.
//
@objcMembers public class ActionPopupModel: ActionModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "popup"
public var actionType: String = ActionPopupModel.identifier
public var pageType: String
public var extraParameters: JSONValueDictionary?
public var analyticsData: JSONValueDictionary?
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(pageType: String, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
self.pageType = pageType
self.extraParameters = extraParameters
self.analyticsData = analyticsData
}
}

View File

@ -1,43 +0,0 @@
//
// UIAlertActionStyle+Codable.swift
// MVMCore
//
// Created by Suresh, Kamlesh on 7/14/20.
// Copyright © 2020 myverizon. All rights reserved.
//
extension UIAlertAction.Style: Codable {
init(rawValue: String) {
switch rawValue {
case "default":
self = .default
case "cancel":
self = .cancel
case "destructive":
self = .destructive
default:
self = .default
}
}
var rawValueString: String {
switch self {
case .default:
return "default"
case .cancel:
return "cancel"
case .destructive:
return "destructive"
@unknown default:
return "default"
}
}
}

View File

@ -1,37 +0,0 @@
//
// UIAlertControllerStyle+Extension.swift
// MVMCore
//
// Created by Kevin Christiano on 7/17/20.
// Copyright © 2020 myverizon. All rights reserved.
//
extension UIAlertController.Style: Codable {
init(rawValue: String) {
switch rawValue {
case "alert":
self = .alert
case "actionSheet":
self = .actionSheet
default:
self = .alert
}
}
var rawValueString: String {
switch self {
case .alert:
return "alert"
case .actionSheet:
return "actionSheet"
@unknown default:
return "alert"
}
}
}

View File

@ -1,116 +0,0 @@
//
// AlertModel.swift
// MVMCore
//
// Created by Suresh, Kamlesh on 7/14/20.
// Copyright © 2020 myverizon. All rights reserved.
//
import UIKit
public class AlertButtonModel: Codable {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public var title: String
public var action: ActionModelProtocol
public var style: UIAlertAction.Style = .default
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(_ title: String,_ action: ActionModelProtocol,_ style: UIAlertAction.Style = .default) {
self.title = title
self.action = action
self.style = style
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case title
case action
case style
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
title = try typeContainer.decode(String.self, forKey: .title)
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
self.style = UIAlertAction.Style(rawValue: style)
}
action = try typeContainer.decodeModel(codingKey: .action)
}
open func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(title, forKey: .title)
try container.encode(style.rawValueString, forKey: .style)
try container.encodeModel(action, forKey: .action)
}
}
public class AlertModel: Codable {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public var title: String
public var message: String
public var style: UIAlertController.Style = .alert
public var alertActions: [AlertButtonModel]
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public init(_ title: String,_ message: String,_ alertActions: [AlertButtonModel]) {
self.title = title
self.message = message
self.alertActions = alertActions
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case title
case message
case alertActions
case style
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
title = try typeContainer.decode(String.self, forKey: .title)
message = try typeContainer.decode(String.self, forKey: .message)
alertActions = try typeContainer.decode([AlertButtonModel].self, forKey: .alertActions)
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
self.style = UIAlertController.Style(rawValue: style)
}
}
open func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(title, forKey: .title)
try container.encode(message, forKey: .message)
try container.encode(alertActions, forKey: .alertActions)
try container.encode(style.rawValueString, forKey: .style)
}
}

View File

@ -14,14 +14,12 @@ import Foundation
try? ModelRegistry.register(ActionOpenPageModel.self)
try? ModelRegistry.register(ActionOpenUrlModel.self)
try? ModelRegistry.register(ActionCallModel.self)
try? ModelRegistry.register(ActionPopupModel.self)
try? ModelRegistry.register(ActionBackModel.self)
try? ModelRegistry.register(ActionShareModel.self)
try? ModelRegistry.register(ActionRestartModel.self)
try? ModelRegistry.register(ActionPreviousSubmitModel.self)
try? ModelRegistry.register(ActionCancelModel.self)
try? ModelRegistry.register(ActionSettingModel.self)
try? ModelRegistry.register(ActionAlertModel.self)
try? ModelRegistry.register(ActionNoopModel.self)
}
}

View File

@ -7,7 +7,6 @@
//
#import "MVMCoreSessionTimeHandler.h"
#import "MVMCoreAlertHandler.h"
#import "MVMCoreLoggingHandler.h"
#import "MVMCoreSessionObject.h"
#import "MVMCoreLoadHandler.h"
@ -147,7 +146,6 @@
if ((!fequal(0, self.secondsUntilWarning) && now > self.timeTimerStarted + self.secondsUntilWarning) || (fequal(0, self.secondsUntilWarning) && !fequal(0, self.secondsUntilTimeout) && now > self.timeTimerStarted + self.secondsUntilTimeout)) {
// Timeout if we are passed the warning.
[[MVMCoreAlertHandler sharedAlertHandler] removeAllAlertViews];
[self sessionTimeout:YES];
} else if (!fequal(0, self.secondsUntilWarning)) {

View File

@ -15,7 +15,6 @@
#import <MVMCore/MVMCoreGlobalLoadProtocol.h>
#import <MVMCore/MVMCoreLoadingOverlayDelegateProtocol.h>
#import <MVMCore/MVMCoreLoggingDelegateProtocol.h>
#import <MVMCore/MVMCoreGlobalTopAlertDelegateProtocol.h>
#import <MVMCore/MVMCoreLoggingHandler.h>
#import <MVMCore/MVMCoreLoadHandler.h>
@ -32,7 +31,6 @@
@property (nullable, strong, nonatomic) id <MVMCoreGlobalLoadProtocol> globalLoadDelegate;
@property (nullable, strong, nonatomic) id <MVMCoreLoadingOverlayDelegateProtocol> loadingProtocol;
@property (nullable, strong, nonatomic) NSObject <MVMCoreLoggingDelegateProtocol> *loggingDelegate;
@property (nullable, strong, nonatomic) id <MVMCoreGlobalTopAlertDelegateProtocol> globalTopAlertDelegate;
// A reference to the calling application delegate that should be set. For a normal app, could be the UIApplicationDelegate. For watch, could be WKExtensionDelegate. For iMessage, could be MSMessagesAppViewController. etc, etc. Useful for the framework to call delegate specific functions.
@property (nullable, weak, nonatomic) id applicationDelegate;