remove duplicate function
Move back to delegate. Throw error when using exact class, don't throw error when using protocol. remove unused search path
This commit is contained in:
parent
feceef26df
commit
1429fd1fae
@ -946,11 +946,7 @@
|
|||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
LIBRARY_SEARCH_PATHS = (
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/MVMCore/EmbeddedLibaries/AdobeMobileLibrary",
|
|
||||||
"$(PROJECT_DIR)/MVMCore/EmbeddedLibraries/VZAnalytics",
|
|
||||||
);
|
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCore;
|
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCore;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
@ -975,11 +971,7 @@
|
|||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
LIBRARY_SEARCH_PATHS = (
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||||
"$(inherited)",
|
|
||||||
"$(PROJECT_DIR)/MVMCore/EmbeddedLibaries/AdobeMobileLibrary",
|
|
||||||
"$(PROJECT_DIR)/MVMCore/EmbeddedLibraries/VZAnalytics",
|
|
||||||
);
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCore;
|
PRODUCT_BUNDLE_IDENTIFIER = com.vzw.MVMCore;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
|
|||||||
@ -36,7 +36,7 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
|||||||
@implementation MVMCoreActionHandler
|
@implementation MVMCoreActionHandler
|
||||||
|
|
||||||
+ (nullable instancetype)sharedActionHandler {
|
+ (nullable instancetype)sharedActionHandler {
|
||||||
[MVMCoreActionUtility verifyClassIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].actionHandler.class otherClass:self];
|
[MVMCoreActionUtility classIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].actionHandler.class otherClass:self throwException:YES];
|
||||||
return [MVMCoreObject sharedInstance].actionHandler;
|
return [MVMCoreObject sharedInstance].actionHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
static NSString * const STATIC_CACHE_COMPONENT = @"StaticCache.txt";
|
||||||
|
|
||||||
+ (nullable instancetype)sharedCache {
|
+ (nullable instancetype)sharedCache {
|
||||||
[MVMCoreActionUtility verifyClassIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].cache.class otherClass:self];
|
[MVMCoreActionUtility classIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].cache.class otherClass:self throwException:YES];
|
||||||
return [MVMCoreObject sharedInstance].cache;
|
return [MVMCoreObject sharedInstance].cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,8 +13,11 @@
|
|||||||
@implementation MVMCoreLoggingHandler
|
@implementation MVMCoreLoggingHandler
|
||||||
|
|
||||||
+ (nullable instancetype)sharedLoggingHandler {
|
+ (nullable instancetype)sharedLoggingHandler {
|
||||||
[MVMCoreActionUtility verifyClassIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].loggingDelegate.class otherClass:self];
|
if ([MVMCoreActionUtility classIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].loggingDelegate.class otherClass:self throwException:NO]) {
|
||||||
return [MVMCoreObject sharedInstance].loggingDelegate;
|
return (MVMCoreLoggingHandler *)[MVMCoreObject sharedInstance].loggingDelegate;
|
||||||
|
} else {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)addErrorToLog:(nonnull MVMCoreErrorObject *)errorObject {
|
+ (void)addErrorToLog:(nonnull MVMCoreErrorObject *)errorObject {
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
@implementation MVMCoreSessionObject
|
@implementation MVMCoreSessionObject
|
||||||
|
|
||||||
+ (nullable instancetype)sharedGlobal {
|
+ (nullable instancetype)sharedGlobal {
|
||||||
[MVMCoreActionUtility verifyClassIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].session.class otherClass:self];
|
[MVMCoreActionUtility classIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].session.class otherClass:self throwException:YES];
|
||||||
return [MVMCoreObject sharedInstance].session;
|
return [MVMCoreObject sharedInstance].session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
@implementation MVMCoreSessionTimeHandler
|
@implementation MVMCoreSessionTimeHandler
|
||||||
|
|
||||||
+ (nullable instancetype)sharedSessionHandler {
|
+ (nullable instancetype)sharedSessionHandler {
|
||||||
[MVMCoreActionUtility verifyClassIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].sessionHandler.class otherClass:self];
|
[MVMCoreActionUtility classIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].sessionHandler.class otherClass:self throwException:YES];
|
||||||
return [MVMCoreObject sharedInstance].sessionHandler;
|
return [MVMCoreObject sharedInstance].sessionHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
// The delegates
|
// The delegates
|
||||||
@property (nullable, weak, nonatomic) id <MVMCoreGlobalLoadProtocol> globalLoadDelegate;
|
@property (nullable, weak, nonatomic) id <MVMCoreGlobalLoadProtocol> globalLoadDelegate;
|
||||||
@property (nullable, weak, nonatomic) id <MVMCoreLoadingOverlayDelegateProtocol> loadingProtocol;
|
@property (nullable, weak, nonatomic) id <MVMCoreLoadingOverlayDelegateProtocol> loadingProtocol;
|
||||||
@property (nullable, weak, nonatomic) MVMCoreLoggingHandler <MVMCoreLoggingDelegateProtocol> *loggingDelegate;
|
@property (nullable, weak, nonatomic) NSObject <MVMCoreLoggingDelegateProtocol> *loggingDelegate;
|
||||||
@property (nullable, weak, nonatomic) id <MVMCoreGlobalTopAlertDelegateProtocol> globalTopAlertDelegate;
|
@property (nullable, weak, 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.
|
// 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.
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
// Can call to display a view controller based on the load object in the same way the architecture does it. Will check the presentation style of the page, action, and request. Will check if needs a view manager.
|
// Can call to display a view controller based on the load object in the same way the architecture does it. Will check the presentation style of the page, action, and request. Will check if needs a view manager.
|
||||||
+ (void)displayViewController:(nonnull UIViewController <MVMCoreViewControllerProtocol> *)viewController forLoadObject:(nullable MVMCoreLoadObject *)loadObject presentationDelegate:(nullable NSObject<MVMCorePresentationDelegateProtocol>*)delegate completionHandler:(nullable void (^)(void))completionBlock;
|
+ (void)displayViewController:(nonnull UIViewController <MVMCoreViewControllerProtocol> *)viewController forLoadObject:(nullable MVMCoreLoadObject *)loadObject presentationDelegate:(nullable NSObject<MVMCorePresentationDelegateProtocol>*)delegate completionHandler:(nullable void (^)(void))completionBlock;
|
||||||
|
|
||||||
// Throws an error if the class is not the same or a subclass of the other class.
|
// returns if the class is not the same or a subclass of the other class. Can pass throw an exception as well
|
||||||
+ (void)verifyClassIsInstanceTypeOfClass:(Class)theClass otherClass:(Class)otherClass;
|
+ (BOOL)classIsInstanceTypeOfClass:(Class)theClass otherClass:(Class)otherClass throwException:(BOOL)throwException;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -137,10 +137,14 @@
|
|||||||
[[MVMCoreNavigationHandler sharedNavigationHandler] navigateWithLoadObject:loadObject viewController:(viewControllerToLoad ?: viewController) delegate:delegate completionHandler:completionBlock];
|
[[MVMCoreNavigationHandler sharedNavigationHandler] navigateWithLoadObject:loadObject viewController:(viewControllerToLoad ?: viewController) delegate:delegate completionHandler:completionBlock];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)verifyClassIsInstanceTypeOfClass:(Class)theClass otherClass:(Class)otherClass {
|
+ (BOOL)classIsInstanceTypeOfClass:(Class)theClass otherClass:(Class)otherClass throwException:(BOOL)throwException {
|
||||||
if (theClass != otherClass && ![theClass isSubclassOfClass:otherClass]) {
|
if (theClass != otherClass && ![theClass isSubclassOfClass:otherClass]) {
|
||||||
@throw([NSException exceptionWithName:@"NotInstanceType" reason:[NSString stringWithFormat:@"%@ is not an instance of %@",theClass,otherClass] userInfo:nil]);
|
if (throwException) {
|
||||||
|
@throw([NSException exceptionWithName:@"NotInstanceType" reason:[NSString stringWithFormat:@"%@ is not an instance of %@",theClass,otherClass] userInfo:nil]);
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
}
|
}
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
@implementation MVMCoreViewControllerMappingObject
|
@implementation MVMCoreViewControllerMappingObject
|
||||||
|
|
||||||
+ (nullable instancetype)sharedViewControllerMappingObject {
|
+ (nullable instancetype)sharedViewControllerMappingObject {
|
||||||
[MVMCoreActionUtility verifyClassIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].viewControllerMapping.class otherClass:self];
|
[MVMCoreActionUtility classIsInstanceTypeOfClass:[MVMCoreObject sharedInstance].viewControllerMapping.class otherClass:self throwException:YES];
|
||||||
return [MVMCoreObject sharedInstance].viewControllerMapping;
|
return [MVMCoreObject sharedInstance].viewControllerMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user