From 35a8a2988aca6ecc407ce2a4eab7426523680028 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 28 Oct 2020 10:18:48 -0400 Subject: [PATCH] checkout delete files --- MVMCore/MVMCore.xcodeproj/project.pbxproj | 28 -- ...MVMCoreTopAlertAnimationDelegateProtocol.h | 22 -- .../MVMCoreTopAlertDelegateProtocol.h | 23 -- .../AlertHandling/MVMCoreTopAlertObject.h | 64 ----- .../AlertHandling/MVMCoreTopAlertObject.m | 95 ------- .../AlertHandling/MVMCoreTopAlertOperation.h | 33 --- .../AlertHandling/MVMCoreTopAlertOperation.m | 264 ------------------ .../MVMCoreTopAlertViewProtocol.h | 28 -- 8 files changed, 557 deletions(-) delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertAnimationDelegateProtocol.h delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertDelegateProtocol.h delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.h delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.m delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.h delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m delete mode 100644 MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h diff --git a/MVMCore/MVMCore.xcodeproj/project.pbxproj b/MVMCore/MVMCore.xcodeproj/project.pbxproj index 12ade7f..ce873db 100644 --- a/MVMCore/MVMCore.xcodeproj/project.pbxproj +++ b/MVMCore/MVMCore.xcodeproj/project.pbxproj @@ -121,12 +121,6 @@ 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, ); }; }; @@ -137,7 +131,6 @@ 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, ); }; }; @@ -273,12 +266,6 @@ AFBB96811FBA3A9A0008D868 /* MVMCoreAlertObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertObject.m; sourceTree = ""; }; AFBB96821FBA3A9A0008D868 /* MVMCoreAlertOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertOperation.h; sourceTree = ""; }; AFBB96831FBA3A9A0008D868 /* MVMCoreAlertOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertOperation.m; sourceTree = ""; }; - AFBB96841FBA3A9A0008D868 /* MVMCoreTopAlertAnimationDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertAnimationDelegateProtocol.h; sourceTree = ""; }; - AFBB96851FBA3A9A0008D868 /* MVMCoreTopAlertDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertDelegateProtocol.h; sourceTree = ""; }; - AFBB96861FBA3A9A0008D868 /* MVMCoreTopAlertObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertObject.h; sourceTree = ""; }; - AFBB96871FBA3A9A0008D868 /* MVMCoreTopAlertObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreTopAlertObject.m; sourceTree = ""; }; - AFBB96881FBA3A9A0008D868 /* MVMCoreTopAlertOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertOperation.h; sourceTree = ""; }; - AFBB96891FBA3A9A0008D868 /* MVMCoreTopAlertOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreTopAlertOperation.m; sourceTree = ""; }; AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreDispatchUtility.h; sourceTree = ""; }; AFBB96AD1FBA3B590008D868 /* MVMCoreDispatchUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreDispatchUtility.m; sourceTree = ""; }; AFBB96AE1FBA3B590008D868 /* MVMCoreGetterUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreGetterUtility.h; sourceTree = ""; }; @@ -290,7 +277,6 @@ AFBB96E91FBA4A260008D868 /* MFHardCodedServerResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFHardCodedServerResponse.h; sourceTree = ""; }; AFBB96EA1FBA4A260008D868 /* MFHardCodedServerResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFHardCodedServerResponse.m; sourceTree = ""; }; AFC5FA141FFC2E2A00C244CF /* MVMCoreGlobalTopAlertDelegateProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreGlobalTopAlertDelegateProtocol.h; sourceTree = ""; }; - AFC5FA1C1FFC39C700C244CF /* MVMCoreTopAlertViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreTopAlertViewProtocol.h; sourceTree = ""; }; AFEA17A6209B6A1C00BC6740 /* MVMCoreBlockOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreBlockOperation.h; sourceTree = ""; }; AFEA17A7209B6A1C00BC6740 /* MVMCoreBlockOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreBlockOperation.m; sourceTree = ""; }; AFED77991FCCA29300BAE689 /* MVMCoreViewControllerNibMappingObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreViewControllerNibMappingObject.h; sourceTree = ""; }; @@ -603,13 +589,6 @@ 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 = ""; @@ -708,7 +687,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 +699,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 +707,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 */, @@ -751,7 +726,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 */, @@ -892,7 +866,6 @@ 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 */, @@ -912,7 +885,6 @@ 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 */, diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertAnimationDelegateProtocol.h b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertAnimationDelegateProtocol.h deleted file mode 100644 index bb9f6df..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertAnimationDelegateProtocol.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// MVMCoreTopAlertAnimationDelegateProtocol.h -// mobilefirst -// -// Created by Scott Pfeil on 6/4/16. -// Copyright © 2016 Verizon Wireless. All rights reserved. -// - -#import - -@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 diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertDelegateProtocol.h b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertDelegateProtocol.h deleted file mode 100644 index af09483..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertDelegateProtocol.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// MVMCoreTopAlertDelegateProtocol.h -// mobilefirst -// -// Created by Scott Pfeil on 6/4/16. -// Copyright © 2016 Verizon Wireless. All rights reserved. -// - -#import - -@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 diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.h b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.h deleted file mode 100644 index 350f6e1..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// MVMCoreTopAlertObject.h -// mobilefirst -// -// Created by Scott Pfeil on 5/24/16. -// Copyright © 2016 Verizon Wireless. All rights reserved. -// - -#import -#import - -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 *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 diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.m b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.m deleted file mode 100644 index 72b6de4..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertObject.m +++ /dev/null @@ -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 -#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 diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.h b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.h deleted file mode 100644 index 6dadc89..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.h +++ /dev/null @@ -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 - -@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 diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m deleted file mode 100644 index 6eb8f04..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m +++ /dev/null @@ -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 *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 *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 diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h deleted file mode 100644 index 2778971..0000000 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// MVMCoreTopAlertViewProtocol.h -// MVMCore -// -// Created by Pfeil, Scott Robert on 1/2/18. -// Copyright © 2018 myverizon. All rights reserved. -// - -#import -@class MVMCoreTopAlertObject; - -@protocol MVMCoreTopAlertViewProtocol - -@optional - -// Show based on the object -- (void)showWithTopAlertObject:(nullable MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nonnull id )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