From c0958b58e4399468080a4abe4b2a2cde1afa10b7 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 27 Oct 2021 14:53:55 -0500 Subject: [PATCH] added getHandlerType for a Type refactored existing getHandler to call this new method Signed-off-by: Matt Bruce --- MVMCore/MVMCore/Models/Model/ModelRegistry.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift index 78d8657..f148119 100644 --- a/MVMCore/MVMCore/Models/Model/ModelRegistry.swift +++ b/MVMCore/MVMCore/Models/Model/ModelRegistry.swift @@ -165,8 +165,11 @@ public struct ModelRegistry { //-------------------------------------------------- public static func getHandler(_ model: ModelProtocol) throws -> ModelHandlerProtocol.Type { - // Get the modelType - let modelType = type(of: model) + return try getHandlerType(for: type(of: model)) + } + + //get handler for the specific Model + public static func getHandlerType(for modelType: ModelProtocol.Type) throws -> ModelHandlerProtocol.Type{ // Get the category for the ModelProtocol guard let category = categories[modelType.categoryName] else {