Merge branch 'develop' of gitlab.verizon.com:BPHV_MIPS/mvm_core into develop
This commit is contained in:
commit
2fb61bbcff
@ -29,7 +29,6 @@
|
||||
01F2A03B23A8159900D954D8 /* ActionOpenAppModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03A23A8159900D954D8 /* ActionOpenAppModel.swift */; };
|
||||
01F2A04C23A82B1B00D954D8 /* ActionCallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A04B23A82B1B00D954D8 /* ActionCallModel.swift */; };
|
||||
01F2A04E23A82CF500D954D8 /* ActionPopupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A04D23A82CF500D954D8 /* ActionPopupModel.swift */; };
|
||||
01F2A05023A82D0800D954D8 /* ActionTopAlertModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A04F23A82D0800D954D8 /* ActionTopAlertModel.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 */; };
|
||||
0AFF597A23FC6E60005C24E8 /* ActionShareModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AFF597923FC6E60005C24E8 /* ActionShareModel.swift */; };
|
||||
@ -57,6 +56,10 @@
|
||||
946EE1B2237B5F260036751F /* JSONValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946EE1B1237B5F260036751F /* JSONValue.swift */; };
|
||||
946EE1B4237B619D0036751F /* Encoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946EE1B3237B619D0036751F /* Encoder.swift */; };
|
||||
946EE1BC237B691A0036751F /* ActionOpenPageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 946EE1BB237B691A0036751F /* ActionOpenPageModel.swift */; };
|
||||
94C014D124211869005811A9 /* ActionRestartModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C014D024211869005811A9 /* ActionRestartModel.swift */; };
|
||||
94C014D3242119E6005811A9 /* ActionPreviousSubmitModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C014D2242119E6005811A9 /* ActionPreviousSubmitModel.swift */; };
|
||||
94C014D524211AF0005811A9 /* ActionCancelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C014D424211AF0005811A9 /* ActionCancelModel.swift */; };
|
||||
94C014D924212360005811A9 /* ActionSettingModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94C014D824212360005811A9 /* ActionSettingModel.swift */; };
|
||||
A332F33F20C7231700DCD9D9 /* MVMCoreViewControllerAnimatedTransitioning.h in Headers */ = {isa = PBXBuildFile; fileRef = A332F33E20C7231600DCD9D9 /* MVMCoreViewControllerAnimatedTransitioning.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AF1201832108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AF1201812108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AF26DDAE1FCE6A37004E8F65 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AF26DDB01FCE6A37004E8F65 /* Localizable.strings */; };
|
||||
@ -164,7 +167,6 @@
|
||||
D2DEDCB923C6400600C44CC4 /* UnitInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCB823C6400600C44CC4 /* UnitInterval.swift */; };
|
||||
D2DEDCBB23C65BC300C44CC4 /* Percent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2DEDCBA23C65BC300C44CC4 /* Percent.swift */; };
|
||||
D2E1FAD92260C3E400AEFD8C /* DelegateObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2E1FAD82260C3E400AEFD8C /* DelegateObject.swift */; };
|
||||
EAE09C5E23F4389600765089 /* ActionOpenPanelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE09C5D23F4389600765089 /* ActionOpenPanelModel.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -176,7 +178,6 @@
|
||||
01F2A03A23A8159900D954D8 /* ActionOpenAppModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenAppModel.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>"; };
|
||||
01F2A04F23A82D0800D954D8 /* ActionTopAlertModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionTopAlertModel.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>"; };
|
||||
@ -208,6 +209,10 @@
|
||||
946EE1B1237B5F260036751F /* JSONValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONValue.swift; sourceTree = "<group>"; };
|
||||
946EE1B3237B619D0036751F /* Encoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encoder.swift; sourceTree = "<group>"; };
|
||||
946EE1BB237B691A0036751F /* ActionOpenPageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenPageModel.swift; sourceTree = "<group>"; };
|
||||
94C014D024211869005811A9 /* ActionRestartModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionRestartModel.swift; sourceTree = "<group>"; };
|
||||
94C014D2242119E6005811A9 /* ActionPreviousSubmitModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionPreviousSubmitModel.swift; sourceTree = "<group>"; };
|
||||
94C014D424211AF0005811A9 /* ActionCancelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCancelModel.swift; sourceTree = "<group>"; };
|
||||
94C014D824212360005811A9 /* ActionSettingModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionSettingModel.swift; sourceTree = "<group>"; };
|
||||
A332F33E20C7231600DCD9D9 /* MVMCoreViewControllerAnimatedTransitioning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreViewControllerAnimatedTransitioning.h; sourceTree = "<group>"; };
|
||||
AF1201812108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreViewManagerViewControllerProtocol.h; sourceTree = "<group>"; };
|
||||
AF26DDAF1FCE6A37004E8F65 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
@ -319,7 +324,6 @@
|
||||
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>"; };
|
||||
D2E1FAD82260C3E400AEFD8C /* DelegateObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelegateObject.swift; sourceTree = "<group>"; };
|
||||
EAE09C5D23F4389600765089 /* ActionOpenPanelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenPanelModel.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -459,10 +463,12 @@
|
||||
01F2A03A23A8159900D954D8 /* ActionOpenAppModel.swift */,
|
||||
01F2A04B23A82B1B00D954D8 /* ActionCallModel.swift */,
|
||||
01F2A04D23A82CF500D954D8 /* ActionPopupModel.swift */,
|
||||
01F2A04F23A82D0800D954D8 /* ActionTopAlertModel.swift */,
|
||||
01C851D023CF97FE0021F976 /* ActionBackModel.swift */,
|
||||
EAE09C5D23F4389600765089 /* ActionOpenPanelModel.swift */,
|
||||
0AFF597923FC6E60005C24E8 /* ActionShareModel.swift */,
|
||||
94C014D024211869005811A9 /* ActionRestartModel.swift */,
|
||||
94C014D2242119E6005811A9 /* ActionPreviousSubmitModel.swift */,
|
||||
94C014D424211AF0005811A9 /* ActionCancelModel.swift */,
|
||||
94C014D824212360005811A9 /* ActionSettingModel.swift */,
|
||||
);
|
||||
path = ActionType;
|
||||
sourceTree = "<group>";
|
||||
@ -905,12 +911,13 @@
|
||||
AFBB96A61FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m in Sources */,
|
||||
0A42538F23F3414800554656 /* Codable+Helpers.swift in Sources */,
|
||||
881D26931FCC9D180079C521 /* MVMCoreErrorObject.m in Sources */,
|
||||
94C014D124211869005811A9 /* ActionRestartModel.swift in Sources */,
|
||||
946EE1B0237B5EF70036751F /* JSONHelper.swift in Sources */,
|
||||
30349BF21FCCA78A00546A1E /* MVMCoreSessionTimeHandler.m in Sources */,
|
||||
D2DEDCB923C6400600C44CC4 /* UnitInterval.swift in Sources */,
|
||||
94C014D3242119E6005811A9 /* ActionPreviousSubmitModel.swift in Sources */,
|
||||
8876D5E91FB50AB000EB2E3D /* NSArray+MFConvenience.m in Sources */,
|
||||
946EE1B2237B5F260036751F /* JSONValue.swift in Sources */,
|
||||
EAE09C5E23F4389600765089 /* ActionOpenPanelModel.swift in Sources */,
|
||||
AFBB96971FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m in Sources */,
|
||||
AFBB96581FBA3A570008D868 /* FreeBeeAuthObject.m in Sources */,
|
||||
01F2A04E23A82CF500D954D8 /* ActionPopupModel.swift in Sources */,
|
||||
@ -933,11 +940,11 @@
|
||||
8876D5F51FB50AB000EB2E3D /* UILabel+MFCustom.m in Sources */,
|
||||
AFBB96B31FBA3B590008D868 /* MVMCoreGetterUtility.m in Sources */,
|
||||
AF43A7071FC4D7A2008E9347 /* MVMCoreObject.m in Sources */,
|
||||
94C014D924212360005811A9 /* ActionSettingModel.swift in Sources */,
|
||||
D2DEDCB723C63F3B00C44CC4 /* Clamping.swift in Sources */,
|
||||
01DF561421F90ADC00CC099B /* Dictionary+MFConvenience.swift in Sources */,
|
||||
AFBB96B11FBA3B590008D868 /* MVMCoreDispatchUtility.m in Sources */,
|
||||
946EE1A3237B59C30036751F /* ModelProtocol.swift in Sources */,
|
||||
01F2A05023A82D0800D954D8 /* ActionTopAlertModel.swift in Sources */,
|
||||
AFBB965B1FBA3A570008D868 /* FreeBeeUrlObject.m in Sources */,
|
||||
AFEA17A9209B6A1C00BC6740 /* MVMCoreBlockOperation.m in Sources */,
|
||||
AF43A70A1FC4F415008E9347 /* MVMCoreCache.m in Sources */,
|
||||
@ -948,6 +955,7 @@
|
||||
AFBB96611FBA3A570008D868 /* MVMCoreLoadObject.m in Sources */,
|
||||
946EE1B4237B619D0036751F /* Encoder.swift in Sources */,
|
||||
AFBB96941FBA3A9A0008D868 /* MVMCorePresentAnimationOperation.m in Sources */,
|
||||
94C014D524211AF0005811A9 /* ActionCancelModel.swift in Sources */,
|
||||
AF43A5841FBB66DE008E9347 /* MVMCoreConstants.m in Sources */,
|
||||
D2DEDCBB23C65BC300C44CC4 /* Percent.swift in Sources */,
|
||||
AFBB966A1FBA3A570008D868 /* MVMCoreLoadRequestOperation.m in Sources */,
|
||||
|
||||
@ -300,15 +300,7 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
||||
}
|
||||
|
||||
- (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
|
||||
// Opens the settings.
|
||||
NSString *type = [actionInformation string:KeyPageType];
|
||||
if ([@"location" isEqualToString:type] || [@"push" isEqualToString:type]) {
|
||||
[MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil];
|
||||
} else {
|
||||
// No known settings type
|
||||
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeInvalidSettingType domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegateObject.actionDelegate class]),KeyActionTypeSettings]];
|
||||
[self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
||||
}
|
||||
[MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil];
|
||||
}
|
||||
|
||||
- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
|
||||
@ -640,14 +632,7 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
||||
|
||||
- (void)settingsAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
|
||||
// Opens the settings.
|
||||
NSString *type = [actionInformation string:KeyPageType];
|
||||
if ([@"location" isEqualToString:type] || [@"push" isEqualToString:type]) {
|
||||
[MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil];
|
||||
} else {
|
||||
// No known settings type
|
||||
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess] code:ErrorCodeInvalidSettingType domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegate class]),KeyActionTypeSettings]];
|
||||
[self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegate:delegate];
|
||||
}
|
||||
[MVMCoreActionUtility linkAway:UIApplicationOpenSettingsURLString appURLString:nil];
|
||||
}
|
||||
|
||||
- (void)collapseNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject <MVMCoreLoadDelegateProtocol, MVMCorePresentationDelegateProtocol,MVMCoreActionDelegateProtocol>*)delegate {
|
||||
|
||||
@ -70,7 +70,7 @@ static void * XXContext = &XXContext;
|
||||
}
|
||||
|
||||
- (nullable instancetype)initWithAlert:(nonnull UIAlertController *)alert isGreedy:(BOOL)isGreedy alertDelegate:(nullable NSObject <MVMCoreAlertDelegateProtocol>*)alertDelegate {
|
||||
if ([self initWithAlert:alert isGreedy:isGreedy]) {
|
||||
if (self = [self initWithAlert:alert isGreedy:isGreedy]) {
|
||||
self.alertDelegate = alertDelegate;
|
||||
}
|
||||
return self;
|
||||
|
||||
@ -41,7 +41,7 @@ NSUInteger const TopAlertDismissTime = 5;
|
||||
|
||||
// The default is yes if not sent by server (for legacy to work as is)
|
||||
NSNumber *closeButton = [responseInfo optionalNumberForKey:KeyCloseButton];
|
||||
if (closeButton) {
|
||||
if (closeButton != nil) {
|
||||
self.useCloseButton = [closeButton boolValue];
|
||||
} else {
|
||||
self.useCloseButton = YES;
|
||||
@ -52,7 +52,7 @@ NSUInteger const TopAlertDismissTime = 5;
|
||||
// Server driven dismiss time.
|
||||
if (self.useNewStyle) {
|
||||
NSNumber *topAlertTime = [responseInfo optionalNumberForKey:@"topAlertTime"];
|
||||
if (topAlertTime) {
|
||||
if (topAlertTime != nil) {
|
||||
self.topAlertDismissTime = [topAlertTime integerValue];
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
}
|
||||
|
||||
NSTimeInterval timeOutInterval = 60;
|
||||
if (requestParameters.customTimeoutTime) {
|
||||
if (requestParameters.customTimeoutTime != nil) {
|
||||
timeOutInterval = requestParameters.customTimeoutTime.floatValue;
|
||||
} else if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(timeOutIntervalForRequest:)]) {
|
||||
timeOutInterval = [[MVMCoreObject sharedInstance].globalLoadDelegate timeOutIntervalForRequest:requestParameters];
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
- (BOOL)extendsAppSession {
|
||||
NSNumber *extendSessionFlag = [self.responseInfoMap optionalNumberForKey:@"appSessionExtended"];
|
||||
return !extendSessionFlag || [extendSessionFlag boolValue]; // Default to YES if the key does not exist.
|
||||
return extendSessionFlag == nil || [extendSessionFlag boolValue]; // Default to YES if the key does not exist.
|
||||
}
|
||||
|
||||
#pragma mark - Deprecated
|
||||
|
||||
@ -824,7 +824,7 @@
|
||||
if (postCallsDict) {
|
||||
NSArray *actionList = [postCallsDict array:@"actionList"];
|
||||
//TODO needs to create operation queue based on concurrent flag
|
||||
BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"];
|
||||
//BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"];
|
||||
//Needs further enhancements based on the flags.
|
||||
BOOL shouldTriggerFromCache = [postCallsDict boolForKey:@"shouldTriggerFromCache"];
|
||||
//Check if page is not from cache
|
||||
|
||||
@ -17,10 +17,10 @@
|
||||
@property (nullable, weak, nonatomic) UIViewController <MVMCoreViewManagerProtocol>*manager;
|
||||
|
||||
// Notifies the view controller that it can be ready (usually means that it's committed to the screen).
|
||||
- (void)viewControllerReadyInManager:(nonnull NSObject <MVMCoreViewManagerProtocol>*)manager;
|
||||
- (void)viewControllerReadyInManager:(nonnull UIViewController <MVMCoreViewManagerProtocol>*)manager;
|
||||
|
||||
// Notifies the current showing view controller that the manager is disappearing.
|
||||
- (void)managerWillDisappear:(nonnull NSObject <MVMCoreViewManagerProtocol>*)manager;
|
||||
- (void)managerWillDisappear:(nonnull UIViewController <MVMCoreViewManagerProtocol>*)manager;
|
||||
|
||||
// Manager can check if the view controller does not want to be cached. You should be following proper caching techniques (caching, updating when needed, deleting when needed), so this should be a last resort.
|
||||
- (BOOL)shouldCacheInManager;
|
||||
|
||||
@ -10,7 +10,7 @@ import Foundation
|
||||
|
||||
@objcMembers public class ActionBackModel: ActionModelProtocol {
|
||||
public static var identifier: String = "back"
|
||||
public var actionType: String? = ActionBackModel.identifier
|
||||
public var actionType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
// Temporary fix till server changes
|
||||
|
||||
@ -10,7 +10,8 @@ import Foundation
|
||||
|
||||
@objcMembers public class ActionCallModel: ActionModelProtocol {
|
||||
public static var identifier: String = "call"
|
||||
public var actionType: String? = ActionCallModel.identifier
|
||||
public var actionType: String = ActionCallModel.identifier
|
||||
// TODO: decode into phone number once action handler is re-written
|
||||
public var callNumber: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
|
||||
17
MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift
Normal file
17
MVMCore/MVMCore/Models/ActionType/ActionCancelModel.swift
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// ActionCancelModel.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Ryan on 3/17/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class ActionCancelModel: ActionModelProtocol {
|
||||
public static var identifier: String = "cancel"
|
||||
public var actionType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
public var title: String?
|
||||
}
|
||||
@ -10,7 +10,7 @@ import Foundation
|
||||
|
||||
public protocol ActionModelProtocol: ModelProtocol {
|
||||
|
||||
var actionType: String? { get set }
|
||||
var actionType: String { get }
|
||||
var extraParameters: JSONValueDictionary? { get set }
|
||||
var analyticsData: JSONValueDictionary? { get set }
|
||||
|
||||
@ -20,7 +20,7 @@ public protocol ActionModelProtocol: ModelProtocol {
|
||||
|
||||
public extension ActionModelProtocol {
|
||||
|
||||
var actionType: String? {
|
||||
var actionType: String {
|
||||
get { return Self.identifier }
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,8 @@ import Foundation
|
||||
|
||||
@objcMembers public class ActionOpenAppModel: ActionModelProtocol {
|
||||
public static var identifier: String = "openApp"
|
||||
public var actionType: String? = ActionOpenAppModel.identifier
|
||||
public var actionType: String = ActionOpenAppModel.identifier
|
||||
// TODO: decode into url once action handler is re-written
|
||||
public var appURL: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
|
||||
@ -10,7 +10,7 @@ import Foundation
|
||||
|
||||
@objcMembers public class ActionOpenPageModel: ActionModelProtocol {
|
||||
public static var identifier: String = "openPage"
|
||||
public var actionType: String? = ActionOpenPageModel.identifier
|
||||
public var actionType: String = ActionOpenPageModel.identifier
|
||||
public var pageType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
//
|
||||
// ActionOpenPanelModel.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Khan, Arshad on 12/02/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class ActionOpenPanelModel: ActionModelProtocol {
|
||||
public static var identifier: String = "openPanel"
|
||||
public var actionType: String? = ActionOpenPanelModel.identifier
|
||||
public var panel: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
// Temporary fix till server changes
|
||||
public var title: String?
|
||||
|
||||
public init(panel: String) {
|
||||
self.panel = panel
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,8 @@ import Foundation
|
||||
|
||||
@objcMembers public class ActionOpenUrlModel: ActionModelProtocol {
|
||||
public static var identifier: String = "openURL"
|
||||
public var actionType: String? = ActionOpenUrlModel.identifier
|
||||
public var actionType: String = ActionOpenUrlModel.identifier
|
||||
// TODO: decode into url once action handler is re-written
|
||||
public var browserUrl: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
|
||||
@ -9,9 +9,8 @@
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class ActionPopupModel: ActionModelProtocol {
|
||||
|
||||
public static var identifier: String = "popup"
|
||||
public var actionType: String? = ActionPopupModel.identifier
|
||||
public var actionType: String = ActionPopupModel.identifier
|
||||
public var title: String?
|
||||
public var pageType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
//
|
||||
// ActionPreviousSubmitModel.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Ryan on 3/17/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class ActionPreviousSubmitModel: ActionModelProtocol {
|
||||
public static var identifier: String = "previousSubmit"
|
||||
public var actionType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
public var title: String?
|
||||
}
|
||||
20
MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift
Normal file
20
MVMCore/MVMCore/Models/ActionType/ActionRestartModel.swift
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// ActionRestartModel.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Ryan on 3/17/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class ActionRestartModel: ActionModelProtocol {
|
||||
public static var identifier: String = "restart"
|
||||
public var actionType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
public var title: String?
|
||||
|
||||
///Optional pageType, if pageType is nil, will start with pageType launchApp
|
||||
public var pageType: String?
|
||||
}
|
||||
17
MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift
Normal file
17
MVMCore/MVMCore/Models/ActionType/ActionSettingModel.swift
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// ActionSettingModel.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Ryan on 3/17/20.
|
||||
// Copyright © 2020 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@objcMembers public class ActionSettingModel: ActionModelProtocol {
|
||||
public static var identifier: String = "openSettings"
|
||||
public var actionType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
public var title: String?
|
||||
}
|
||||
@ -15,7 +15,7 @@ import UIKit
|
||||
|
||||
public static var identifier: String = "share"
|
||||
|
||||
public var actionType: String?
|
||||
public var actionType: String = ActionShareModel.identifier
|
||||
public var title: String?
|
||||
public var sharedType: String
|
||||
public var sharedText: String
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
//
|
||||
// ActionTopAlertModel.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Suresh, Kamlesh on 12/16/19.
|
||||
// Copyright © 2019 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class ActionTopAlertModel: ActionModelProtocol {
|
||||
|
||||
public static var identifier: String = "topAlert"
|
||||
public var actionType: String? = ActionTopAlertModel.identifier
|
||||
public var pageType: String
|
||||
public var extraParameters: JSONValueDictionary?
|
||||
public var analyticsData: JSONValueDictionary?
|
||||
// Temporary fix till server changes
|
||||
public var title: String?
|
||||
|
||||
public init(pageType: String) {
|
||||
self.pageType = pageType
|
||||
}
|
||||
}
|
||||
@ -70,11 +70,11 @@ public enum JSONValue: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
//public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool {
|
||||
// let ld = try! lhs.encode()
|
||||
// let rd = try! lhs.encode()
|
||||
// return ld == rd
|
||||
//}
|
||||
public func ==(lhs: JSONValue, rhs: JSONValue) -> Bool {
|
||||
let ld = try? lhs.encode()
|
||||
let rd = try? rhs.encode()
|
||||
return ld == rd
|
||||
}
|
||||
|
||||
extension JSONValue: ExpressibleByStringLiteral {
|
||||
public init(stringLiteral value: String) {
|
||||
|
||||
@ -16,9 +16,11 @@ import Foundation
|
||||
try? ModelRegistry.register(ActionOpenAppModel.self)
|
||||
try? ModelRegistry.register(ActionCallModel.self)
|
||||
try? ModelRegistry.register(ActionPopupModel.self)
|
||||
try? ModelRegistry.register(ActionTopAlertModel.self)
|
||||
try? ModelRegistry.register(ActionBackModel.self)
|
||||
try? ModelRegistry.register(ActionOpenPanelModel.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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
||||
|
||||
// Adds json to cache with page type key.
|
||||
NSNumber *shouldCache = [jsonDictionary optionalNumberForKey:@"cache"];
|
||||
if (!shouldCache || shouldCache.boolValue) {
|
||||
if (shouldCache == nil || shouldCache.boolValue) {
|
||||
[weakSelf.pageTypeCache setObject:jsonDictionary forKey:pageType];
|
||||
}
|
||||
}
|
||||
@ -257,7 +257,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
||||
|
||||
// Adds json to cache with page type key.
|
||||
NSNumber *shouldCache = [jsonDictionary optionalNumberForKey:@"cache"];
|
||||
if (!shouldCache || shouldCache.boolValue) {
|
||||
if (shouldCache == nil || shouldCache.boolValue) {
|
||||
[weakSelf.moduleCache setObject:obj forKey:key];
|
||||
}
|
||||
}
|
||||
@ -567,7 +567,7 @@ static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
||||
if (isGif) {
|
||||
[self checkImage:nil imageData:data fallbackImage:fallbackImageName completionHandler:completionHandler];
|
||||
} else {
|
||||
UIImage *image = [UIImage imageWithData:data scale:[UIScreen mainScreen].scale];
|
||||
UIImage *image = data != nil ? [UIImage imageWithData:data scale:[UIScreen mainScreen].scale] : nil;
|
||||
[self checkImage:image imageData:nil fallbackImage:fallbackImageName completionHandler:completionHandler];
|
||||
}
|
||||
}];
|
||||
|
||||
@ -27,6 +27,6 @@
|
||||
+ (BOOL)classIsInstanceTypeOfClass:(nonnull Class)theClass otherClass:(nonnull Class)otherClass throwException:(BOOL)throwException;
|
||||
|
||||
// Calls the above function with throw exception yes if the object is not nil. Returns the object. Convenience function for one liner in initializer.
|
||||
+ (nonnull id)initializerClassCheck:(nullable NSObject *)object classToVerify:(nonnull Class)classToVerify;
|
||||
+ (nullable id)initializerClassCheck:(nullable NSObject *)object classToVerify:(nonnull Class)classToVerify;
|
||||
|
||||
@end
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
NSInteger count = [dictionary count];
|
||||
id __unsafe_unretained objects[count];
|
||||
id __unsafe_unretained keys[count];
|
||||
[dictionary getObjects:objects andKeys:keys];
|
||||
[dictionary getObjects:objects andKeys:keys count:count];
|
||||
for (NSUInteger i = 0; i < count; i++) {
|
||||
id object = objects[i];
|
||||
NSString *key = keys[i];
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
+ (void)performSyncBlockInBackground:(nonnull void (^)(void))block;
|
||||
|
||||
/// Ensures the block is peformed on the same *labeled* dispatch queue. The queue *must* be previously initialized with a unique label.
|
||||
+ (void)performBlock:(nonnull void (^)(void))block onQueue:(dispatch_queue_t)queue;
|
||||
+ (void)performBlock:(nonnull void (^)(void))block onQueue:(nonnull dispatch_queue_t)queue;
|
||||
+ (void)performSyncBlock:(nonnull void (^)(void))block onQueue:(nonnull dispatch_queue_t)queue;
|
||||
|
||||
@end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user