From c5b4b5dfbf559e0d166842944b1b84b954cb6247 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 16 Jun 2020 20:53:21 +0530 Subject: [PATCH] removed new adobe method calling --- MVMCoreUI/Atomic/Organisms/Carousel.swift | 21 +++++++++---------- .../OtherHandlers/MVMCoreUILoggingHandler.h | 3 --- .../OtherHandlers/MVMCoreUILoggingHandler.m | 4 ---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 71f8c198..6dde83ce 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -18,7 +18,7 @@ public protocol CarouselPageControlProtocol { open class Carousel: View { - + public let collectionView: CollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal @@ -26,7 +26,7 @@ open class Carousel: View { layout.minimumLineSpacing = 0 return CollectionView(frame: .zero, collectionViewLayout: layout) }() - + /// The current index of the collection view. Includes dummy cells when looping. public var currentIndex = 0 @@ -85,7 +85,7 @@ open class Carousel: View { open func layoutCollection() { collectionView.collectionViewLayout.invalidateLayout() showPeaking(false) - + // Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled. guard let model = model as? CarouselModel, (model.paging == true || model.loop == true) else { return } @@ -145,19 +145,19 @@ open class Carousel: View { collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0 backgroundColor = .white (collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.minimumLineSpacing = carouselModel.spacing ?? 0 - + itemWidthPercent = carouselModel.itemWidthPercent / 100.0 if let alignment = carouselModel.itemAlignment { itemAlignment = alignment } - + if let height = carouselModel.height { collectionViewHeight?.constant = height } registerCells(with: carouselModel, delegateObject: delegateObject) prepareMolecules(with: carouselModel) - + setupPagingMolecule(carouselModel.pagingMolecule, delegateObject: delegateObject) pageIndex = carouselModel.index @@ -185,7 +185,7 @@ open class Carousel: View { if carouselModel?.loop ?? false && newMolecules.count > 1 { // Sets up the row data with buffer cells on each side (for illusion of endless scroll... also has one more buffer cell on each side in case we can peek that cell). loop = true - + molecules?.insert(contentsOf: newMolecules.suffix(2), at: 0) molecules?.append(contentsOf: newMolecules.prefix(2)) } @@ -306,8 +306,7 @@ open class Carousel: View { let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } analyticsData[KeyAdobeTrackerPageType] = viewcontrollerObject.loadObject??.pageType analyticsData["ClassName"] = String(describing: type(of: viewcontrollerObject)) - MVMCoreUILoggingHandler.shared()?.trackAdobeAnalytics(analyticsData) - + MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: viewcontrollerObject, actionInformation: itemModel.toJSON(), additionalData: nil) } } @@ -386,7 +385,7 @@ extension Carousel: UIScrollViewDelegate { } open func scrollViewDidScroll(_ scrollView: UIScrollView) { - + // Adjust for looping if let model = model as? CarouselModel, model.loop == true { @@ -455,7 +454,7 @@ extension Carousel: UIScrollViewDelegate { } else { targetContentOffset.pointee = scrollView.contentOffset } - + // Cap the index. let lastCellIndex = collectionView(collectionView, numberOfItemsInSection: 0) - 1 goTo(min(max(cellToSwipeTo, 0), lastCellIndex), animated: true) diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h index 869bb098..9fec90f5 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h @@ -20,9 +20,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)defaultLogActionForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; -- (void)trackAdobeAnalytics:(nullable NSDictionary *)analyticsData; - - @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m index 4c99b1af..0c694cce 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m @@ -19,9 +19,5 @@ - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData { return nil; } -- (void)trackAnalyticsAction:(nullable NSDictionary *)analyticsData{ - -} - @end