From 9c29916606bf468d49d7655645fda2958be903d6 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 14 Apr 2020 14:20:29 +0530 Subject: [PATCH] number of columns variable added --- MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift | 3 ++- MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift index d3997323..b766e461 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift @@ -15,6 +15,7 @@ open class RadioBoxes: View { private let boxWidth: CGFloat = 151.0 private let boxHeight: CGFloat = 64.0 private let itemSpacing: CGFloat = 8.0 + private var numberOfColumns: CGFloat = 2.0 private var delegateObject: MVMCoreUIDelegateObject? @@ -94,7 +95,7 @@ open class RadioBoxes: View { } // Calculate the height - let rows = ceil(CGFloat(boxes.count) / 2.0) + let rows = ceil(CGFloat(boxes.count) / numberOfColumns) let height = (rows * boxHeight) + ((rows - 1) * itemSpacing) collectionViewHeight?.constant = height } diff --git a/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift b/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift index b8b5321d..826759a7 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift @@ -276,7 +276,7 @@ import UIKit let fallbackImageName = customFallbackImage ?? MVMCoreUIUtility.localizedImageName("fallback") if let format = format, format.lowercased().contains("gif") { // Gifs aren't supported by default and need special handling - MVMCoreCache.shared()?.getGif(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, allowServerQueryParameters: allowServerParameters, completionHandler: finishedLoadingBlock) + MVMCoreCache.shared()?.getGif(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, allowServerQueryParameters: allowServerParameters, localBundle: localBundle, completionHandler: finishedLoadingBlock) } else { MVMCoreCache.shared()?.getImage(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, allowServerQueryParameters: allowServerParameters, localBundle: localBundle, completionHandler: finishedLoadingBlock) }