Migrate AlertHandler files to swift.
This commit is contained in:
parent
5ee5c39ff8
commit
3c9786b4d6
@ -109,6 +109,7 @@
|
||||
AF7069A02880F0EB00077CF6 /* ActionOpenPageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF70699F2880F0EB00077CF6 /* ActionOpenPageHandler.swift */; };
|
||||
AF787413286DEF8B00670588 /* ActionBackHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF787412286DEF8B00670588 /* ActionBackHandler.swift */; };
|
||||
AF8D13392774EA1D008AF4A9 /* ActionOpenUrlHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF8D13382774EA1D008AF4A9 /* ActionOpenUrlHandler.swift */; };
|
||||
AFA4931E29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4931D29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift */; };
|
||||
AFBB96341FBA34310008D868 /* MVMCoreErrorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96321FBA34310008D868 /* MVMCoreErrorConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFBB96351FBA34310008D868 /* MVMCoreErrorConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96331FBA34310008D868 /* MVMCoreErrorConstants.m */; };
|
||||
AFBB96381FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96371FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -133,8 +134,6 @@
|
||||
AFBB96951FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96771FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFBB96961FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96781FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFBB96971FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB96791FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m */; };
|
||||
AFBB96981FBA3A9A0008D868 /* MVMCoreAlertController.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AFBB96991FBA3A9A0008D868 /* MVMCoreAlertController.m in Sources */ = {isa = PBXBuildFile; fileRef = AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */; };
|
||||
AFBB96B01FBA3B590008D868 /* MVMCoreDispatchUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
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, ); }; };
|
||||
@ -273,6 +272,7 @@
|
||||
AF70699F2880F0EB00077CF6 /* ActionOpenPageHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenPageHandler.swift; sourceTree = "<group>"; };
|
||||
AF787412286DEF8B00670588 /* ActionBackHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionBackHandler.swift; sourceTree = "<group>"; };
|
||||
AF8D13382774EA1D008AF4A9 /* ActionOpenUrlHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionOpenUrlHandler.swift; sourceTree = "<group>"; };
|
||||
AFA4931D29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreActionUtility+Extension.swift"; sourceTree = "<group>"; };
|
||||
AFBB96321FBA34310008D868 /* MVMCoreErrorConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreErrorConstants.h; sourceTree = "<group>"; };
|
||||
AFBB96331FBA34310008D868 /* MVMCoreErrorConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreErrorConstants.m; sourceTree = "<group>"; };
|
||||
AFBB96371FBA39E70008D868 /* MVMCoreLoadDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreLoadDelegateProtocol.h; sourceTree = "<group>"; };
|
||||
@ -297,8 +297,6 @@
|
||||
AFBB96771FBA3A9A0008D868 /* MVMCorePresentationDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCorePresentationDelegateProtocol.h; sourceTree = "<group>"; };
|
||||
AFBB96781FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCorePresentViewControllerOperation.h; sourceTree = "<group>"; };
|
||||
AFBB96791FBA3A9A0008D868 /* MVMCorePresentViewControllerOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCorePresentViewControllerOperation.m; sourceTree = "<group>"; };
|
||||
AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreAlertController.h; sourceTree = "<group>"; };
|
||||
AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MVMCoreAlertController.m; sourceTree = "<group>"; };
|
||||
AFBB96AC1FBA3B590008D868 /* MVMCoreDispatchUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVMCoreDispatchUtility.h; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
@ -391,7 +389,6 @@
|
||||
8876D5D41FB50AAB00EB2E3D /* Utility */,
|
||||
AF43A7191FC5BE9E008E9347 /* MainProtocols */,
|
||||
AFBB96B41FBA3CEC0008D868 /* ActionHandling */,
|
||||
AFBB967A1FBA3A9A0008D868 /* AlertHandling */,
|
||||
AFBB966B1FBA3A9A0008D868 /* PresentationHandling */,
|
||||
AFBB96361FBA39E70008D868 /* LoadHandling */,
|
||||
AFBB96131FBA26650008D868 /* ViewControllerMapping */,
|
||||
@ -611,15 +608,6 @@
|
||||
path = PresentationHandling;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AFBB967A1FBA3A9A0008D868 /* AlertHandling */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AFBB967B1FBA3A9A0008D868 /* MVMCoreAlertController.h */,
|
||||
AFBB967C1FBA3A9A0008D868 /* MVMCoreAlertController.m */,
|
||||
);
|
||||
path = AlertHandling;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AFBB96AB1FBA3B590008D868 /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -630,6 +618,7 @@
|
||||
D282AAB52240085300C46919 /* MVMCoreGetterUtility+Extension.swift */,
|
||||
AF43A5851FBB67D6008E9347 /* MVMCoreActionUtility.h */,
|
||||
AF43A5861FBB67D6008E9347 /* MVMCoreActionUtility.m */,
|
||||
AFA4931D29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift */,
|
||||
);
|
||||
path = Helpers;
|
||||
sourceTree = "<group>";
|
||||
@ -756,7 +745,6 @@
|
||||
8876D5EC1FB50AB000EB2E3D /* NSDictionary+MFConvenience.h in Headers */,
|
||||
AFFCFA651FCCC0D700FD0730 /* MVMCoreLoadingOverlayDelegateProtocol.h in Headers */,
|
||||
AF1201832108C9B400E2F592 /* MVMCoreViewManagerViewControllerProtocol.h in Headers */,
|
||||
AFBB96981FBA3A9A0008D868 /* MVMCoreAlertController.h in Headers */,
|
||||
881D26961FCC9D180079C521 /* MVMCoreOperation.h in Headers */,
|
||||
8876D5EA1FB50AB000EB2E3D /* NSDecimalNumber+MFConvenience.h in Headers */,
|
||||
AF43A7201FC5D2BA008E9347 /* MVMCoreViewManagerProtocol.h in Headers */,
|
||||
@ -905,7 +893,6 @@
|
||||
BB780ADF250F8C890030BD2F /* ActionNoopModel.swift in Sources */,
|
||||
D2E1FAD92260C3E400AEFD8C /* DelegateObject.swift in Sources */,
|
||||
01F2A03623A80A7300D954D8 /* ActionModelProtocol.swift in Sources */,
|
||||
AFBB96991FBA3A9A0008D868 /* MVMCoreAlertController.m in Sources */,
|
||||
881D26941FCC9D180079C521 /* MVMCoreOperation.m in Sources */,
|
||||
AFED77A41FCCA29400BAE689 /* MVMCoreViewControllerMappingObject.m in Sources */,
|
||||
01C851CF23CF7B260021F976 /* JSONMap.swift in Sources */,
|
||||
@ -916,6 +903,7 @@
|
||||
AF43A74D1FC6109F008E9347 /* MVMCoreSessionObject.m in Sources */,
|
||||
D282AAB62240085300C46919 /* MVMCoreGetterUtility+Extension.swift in Sources */,
|
||||
AFBB96901FBA3A9A0008D868 /* MVMCoreNavigationObject.m in Sources */,
|
||||
AFA4931E29E5C988001A9663 /* MVMCoreActionUtility+Extension.swift in Sources */,
|
||||
1DAD0FFE26AAB40000216E83 /* ActionRunJavaScriptModel.swift in Sources */,
|
||||
946EE1AB237B5C940036751F /* Decoder.swift in Sources */,
|
||||
2723337D28BD53C2004EAEE0 /* Date+Extension.swift in Sources */,
|
||||
|
||||
@ -129,7 +129,7 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol {
|
||||
}
|
||||
|
||||
/// Logs the error.
|
||||
@objc open func defaultHandleActionError(_ error: MVMCoreErrorObject, additionalData: [AnyHashable: Any]?) {
|
||||
@objc open func defaultHandleActionError(_ error: MVMCoreErrorObject, additionalData: [AnyHashable: Any]? = nil, delegateObject: DelegateObject? = nil) {
|
||||
guard error.logError else { return }
|
||||
MVMCoreLoggingHandler.addError(toLog: error)
|
||||
error.logError = false // Further attempts to log the same error will be skipped. (Legacy action flow.)
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
//
|
||||
// MVMCoreAlertController.h
|
||||
// alerts
|
||||
//
|
||||
// Created by Scott Pfeil on 10/22/14.
|
||||
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
// Used by our alert handler. Not for subclassing. Simply keeps track of if it's visible. Tries to parallel the UIAlertView to make it easier for the MVMCoreAlertHandler.
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
@class MVMCoreAlertObject;
|
||||
|
||||
@interface MVMCoreAlertController : UIAlertController
|
||||
|
||||
@property (nonatomic, readonly, getter=isVisible) BOOL visible;
|
||||
@property (nullable, nonatomic, strong) MVMCoreAlertObject *alertObject;
|
||||
|
||||
@end
|
||||
@ -1,49 +0,0 @@
|
||||
//
|
||||
// MVMAlertController.m
|
||||
// alerts
|
||||
//
|
||||
// Created by Scott Pfeil on 10/22/14.
|
||||
// Copyright (c) 2014 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MVMCoreAlertController.h"
|
||||
#import "MVMCoreLoggingHandler.h"
|
||||
#import "MVMCoreGetterUtility.h"
|
||||
|
||||
@interface MVMCoreAlertController ()
|
||||
|
||||
@property (nonatomic, readwrite, getter=isVisible) BOOL visible;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MVMCoreAlertController
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
[self willChangeValueForKey:@"isVisible"];
|
||||
self.visible = YES;
|
||||
[self didChangeValueForKey:@"isVisible"];
|
||||
[MVMCoreLoggingHandler logAlertForAlertController:self];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
[self willChangeValueForKey:@"isVisible"];
|
||||
self.visible = NO;
|
||||
[self didChangeValueForKey:@"isVisible"];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"%@|title=%@|message=%@", [super description],self.title,self.message];
|
||||
}
|
||||
|
||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
||||
if ([MVMCoreGetterUtility isOnIPad]) {
|
||||
return UIInterfaceOrientationMaskAll;
|
||||
} else {
|
||||
return UIInterfaceOrientationMaskPortrait;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@ -63,7 +63,6 @@ FOUNDATION_EXPORT const unsigned char MVMCoreVersionString[];
|
||||
#import <MVMCore/MVMCorePresentViewControllerOperation.h>
|
||||
#import <MVMCore/MVMCoreNavigationOperation.h>
|
||||
#import <MVMCore/MVMCoreViewControllerAnimatedTransitioning.h>
|
||||
#import <MVMCore/MVMCoreAlertController.h>
|
||||
|
||||
// Action Handling
|
||||
#import <MVMCore/MVMCoreActionDelegateProtocol.h>
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
@class MVMCoreAlertController;
|
||||
|
||||
@protocol MVMCoreLoggingDelegateProtocol <NSObject>
|
||||
|
||||
@ -25,7 +24,4 @@
|
||||
// Log that the load has finished.
|
||||
- (void)logLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController <MVMCoreViewControllerProtocol> *)loadedViewController error:(nullable MVMCoreErrorObject *)error;
|
||||
|
||||
// Log alert
|
||||
- (void)logAlertForAlertController:(nullable MVMCoreAlertController *)alertController;
|
||||
|
||||
@end
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#import <MVMCore/MVMCoreViewControllerProtocol.h>
|
||||
#import <MVMCore/MVMCoreLoadObject.h>
|
||||
#import <MVMCore/MVMCoreLoggingDelegateProtocol.h>
|
||||
@class MVMCoreAlertController;
|
||||
|
||||
#define MVMCoreLog(fmt, ...) \
|
||||
[MVMCoreLoggingHandler logDebugMessageWithDelegate:[NSString stringWithFormat:(@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__]];
|
||||
@ -24,7 +23,6 @@
|
||||
+ (void)logDebugMessageWithDelegate:(nullable NSString *)message;
|
||||
+ (void)logWithDelegateWithObject:(nullable id)object withName:(nullable NSString *)name withExtraInfo:(nullable NSDictionary *)extra;
|
||||
+ (void)logWithDelegateLoadFinished:(nullable MVMCoreLoadObject *)loadObject loadedViewController:(nullable UIViewController <MVMCoreViewControllerProtocol> *)loadedViewController error:(nullable MVMCoreErrorObject *)error;
|
||||
+ (void)logAlertForAlertController:(nullable MVMCoreAlertController *)alertController;
|
||||
- (void)recordEvent:(nonnull NSString *)name attributes:(nullable NSDictionary<NSString *, id> *)attributes;
|
||||
|
||||
#pragma mark MVMCoreLoggingDelegateProtocol
|
||||
|
||||
@ -45,12 +45,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)logAlertForAlertController:(nullable MVMCoreAlertController *)alertController {
|
||||
if ([[MVMCoreObject sharedInstance].loggingDelegate respondsToSelector:@selector(logAlertForAlertController:)]) {
|
||||
[[MVMCoreObject sharedInstance].loggingDelegate logAlertForAlertController:alertController];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)recordEvent:(nonnull NSString *)name attributes:(nullable NSDictionary<NSString *, id> *)attributes {}
|
||||
|
||||
#pragma mark - logging delegate
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
#import "MVMCorePresentViewControllerOperation.h"
|
||||
#import "MVMCoreAlertController.h"
|
||||
#import "MVMCorePresentAnimationOperation.h"
|
||||
#import "MVMCoreDispatchUtility.h"
|
||||
#import "MVMCoreConstants.h"
|
||||
@ -18,20 +17,10 @@
|
||||
@property (nullable, strong, nonatomic) UIViewController *presentedViewController;
|
||||
@property (nonatomic) BOOL animate;
|
||||
|
||||
@property (nonatomic) BOOL beingObserved;
|
||||
@property (nullable, weak, nonatomic) MVMCoreAlertController *alertController;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MVMCorePresentViewControllerOperation
|
||||
|
||||
// The context for kvo
|
||||
static void * XXContext = &XXContext;
|
||||
|
||||
- (void)dealloc {
|
||||
[self stopObservingAlertView];
|
||||
}
|
||||
|
||||
- (nullable instancetype)initWithPresentingViewController:(nullable UIViewController *)presentingViewController presentedViewController:(nullable UIViewController *)presentedViewController animated:(BOOL)animated {
|
||||
|
||||
if (self = [super init]) {
|
||||
@ -67,57 +56,19 @@ static void * XXContext = &XXContext;
|
||||
controllerToPresentOn = controllerToPresentOn.presentedViewController;
|
||||
}
|
||||
|
||||
// If an alert is showing, don't present until the alerts are dismissed.
|
||||
if ([controllerToPresentOn isKindOfClass:[MVMCoreAlertController class]]) {
|
||||
[self observeForAlertDismissal:(MVMCoreAlertController *)controllerToPresentOn];
|
||||
} else {
|
||||
MVMCorePresentAnimationOperation *animationOperation = [[MVMCorePresentAnimationOperation alloc] initWithPresentingViewController:controllerToPresentOn presentedViewController:self.presentedViewController animated:self.animate];
|
||||
animationOperation.delegate = self.delegate;
|
||||
[animationOperation setCompletionBlock:^{
|
||||
[self markAsFinished];
|
||||
// Notify that page has changed
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil];
|
||||
});
|
||||
}];
|
||||
[[NSOperationQueue mainQueue] addOperation:animationOperation];
|
||||
}
|
||||
MVMCorePresentAnimationOperation *animationOperation = [[MVMCorePresentAnimationOperation alloc] initWithPresentingViewController:controllerToPresentOn presentedViewController:self.presentedViewController animated:self.animate];
|
||||
animationOperation.delegate = self.delegate;
|
||||
[animationOperation setCompletionBlock:^{
|
||||
[self markAsFinished];
|
||||
// Notify that page has changed
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil];
|
||||
});
|
||||
}];
|
||||
[[NSOperationQueue mainQueue] addOperation:animationOperation];
|
||||
} else {
|
||||
[self markAsFinished];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)cancel {
|
||||
[super cancel];
|
||||
[self stopObservingAlertView];
|
||||
}
|
||||
|
||||
#pragma mark - Observer Functions
|
||||
|
||||
- (void)observeForAlertDismissal:(MVMCoreAlertController *)alertController {
|
||||
if (!self.beingObserved) {
|
||||
self.beingObserved = YES;
|
||||
self.alertController = alertController;
|
||||
[alertController addObserver:self forKeyPath:@"visible" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:XXContext];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopObservingAlertView {
|
||||
if (self.beingObserved) {
|
||||
[self.alertController removeObserver:self forKeyPath:@"visible" context:XXContext];
|
||||
self.alertController = nil;
|
||||
self.beingObserved = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
||||
|
||||
if (context == XXContext && [keyPath isEqualToString:@"visible"]) {
|
||||
if (![object isVisible]) {
|
||||
[self stopObservingAlertView];
|
||||
[self present];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
//
|
||||
// MVMCoreActionUtility+Extension.swift
|
||||
// MVMCore
|
||||
//
|
||||
// Created by Scott Pfeil on 4/11/23.
|
||||
// Copyright © 2023 myverizon. All rights reserved.
|
||||
//
|
||||
|
||||
public extension MVMCoreActionUtility {
|
||||
static func fatalClassCheck<T>(object: AnyObject?) -> T {
|
||||
guard let object = object else {
|
||||
fatalError("Object \(T.self) is nil.")
|
||||
}
|
||||
guard let instance = object as? T else {
|
||||
fatalError("\(object) is not an instance of \(T.self)")
|
||||
}
|
||||
return instance
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user