//
//  MVMCoreActionUtility.h
//  MVMCore
//
//  Created by Pfeil, Scott Robert on 11/14/17.
//  Copyright © 2017 myverizon. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <MVMCore/MVMCoreViewControllerProtocol.h>
#import <MVMCore/MVMCoreLoadObject.h>
#import <MVMCore/MVMCorePresentationDelegateProtocol.h>

@interface MVMCoreActionUtility : NSObject

// Takes a dictionary and formats it into a json string.
+ (nonnull NSString *)formatDictionaryAsJSONString:(nonnull NSDictionary *)dictionary;

// Links away to safari or another app. Returns if successful.
+ (BOOL)linkAway:(nullable NSString *)safariURLString appURLString:(nullable NSString *)appURLString;

// 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;

// returns if the class is not the same or a subclass of the other class. Can pass throw an exception as well
+ (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;

@end
