From 57135f8ac7e4ecf0778d4dd0907a6c2f474c6975 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 26 May 2023 15:48:53 -0500 Subject: [PATCH] updating bundle manager Signed-off-by: Matt Bruce --- VDS/Classes/BundleManager.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/VDS/Classes/BundleManager.swift b/VDS/Classes/BundleManager.swift index e7365b08..50537c0d 100644 --- a/VDS/Classes/BundleManager.swift +++ b/VDS/Classes/BundleManager.swift @@ -8,6 +8,8 @@ import Foundation import UIKit + +/// Bundle Manager keeps all bundles together for ease of use for searching within any of them for a specific asset public class BundleManager { public static var shared = BundleManager() @@ -28,6 +30,8 @@ public class BundleManager { }) } + /// With take a location and if found append to the local array for use later for asset searching. + /// - Parameter path: Location of the bundle public static func register(_ path: String) { if !shared.paths.contains(where: {$0 == path}) { if let bundle = Bundle(path: path) { @@ -40,6 +44,9 @@ public class BundleManager { extension BundleManager { + /// Searches through all registered bundles for an image + /// - Parameter name: Name of the image + /// - Returns: Will find an image or not. public func image(for name: String) -> UIImage? { var foundImage: UIImage?