removed new adobe method calling
This commit is contained in:
parent
0e0de7a0fa
commit
c5b4b5dfbf
@ -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)
|
||||
|
||||
@ -20,9 +20,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)defaultLogActionForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData;
|
||||
- (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData;
|
||||
|
||||
- (void)trackAdobeAnalytics:(nullable NSDictionary *)analyticsData;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -19,9 +19,5 @@
|
||||
- (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData {
|
||||
return nil;
|
||||
}
|
||||
- (void)trackAnalyticsAction:(nullable NSDictionary *)analyticsData{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user