Skip to content

Commit

Permalink
Merge branch 'master' into remove-color-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-schibsted committed Aug 14, 2024
2 parents bbfa489 + bc9a446 commit 8e12615
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Demo/SnapshotTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>143.6.0</string>
<string>143.6.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Demo/Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>143.6.0</string>
<string>143.6.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>ITSAppUsesNonExemptEncryption</key>
Expand Down
2 changes: 1 addition & 1 deletion FinniversKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FinniversKit'
s.version = '143.6.0'
s.version = '143.6.1'
s.summary = "FINN's iOS Components"
s.author = 'FINN.no'
s.homepage = 'https://schibsted.frontify.com/d/oCLrx0cypXJM/design-system'
Expand Down
2 changes: 1 addition & 1 deletion FinniversKit/Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>143.6.0</string>
<string>143.6.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Copyright © FINN.no AS, Inc. All rights reserved.
//

import UIKit

public protocol AdRecommendationsGridViewDelegate: AnyObject {
Expand Down Expand Up @@ -51,15 +47,14 @@ public class AdRecommendationsGridView: UIView {

private let imageCache = ImageMemoryCache()

private lazy var collectionViewLayout: AdRecommendationsGridViewLayout = {
private func collectionViewLayout() -> AdRecommendationsGridViewLayout {
let layout = AdRecommendationsGridViewLayout()
layout.delegate = self
return layout
}()
}

// Have the collection view be private so nobody messes with it.
public private(set) lazy var collectionView: UICollectionView = {
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout())
collectionView.translatesAutoresizingMaskIntoConstraints = false
collectionView.delegate = self
collectionView.dataSource = self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
// Copyright © FINN.no AS, Inc. All rights reserved.
//

import UIKit

protocol AdRecommendationsGridViewLayoutDelegate: AnyObject {
Expand Down Expand Up @@ -75,7 +71,7 @@ class AdRecommendationsGridViewLayout: UICollectionViewLayout {
override func prepare() {
super.prepare()

itemAttributes = [UICollectionViewLayoutAttributes]()
itemAttributes.removeAll()

guard let collectionView = collectionView else {
return
Expand Down Expand Up @@ -122,7 +118,13 @@ class AdRecommendationsGridViewLayout: UICollectionViewLayout {
}

override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
return itemAttributes[indexPath.row]
guard itemAttributes.indices.contains(indexPath.row)
else { return nil }
if itemAttributes[indexPath.row].representedElementCategory == .cell {
return itemAttributes[indexPath.row]
} else {
return nil
}
}

override var collectionViewContentSize: CGSize {
Expand Down
2 changes: 1 addition & 1 deletion FinniversKit/UnitTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>143.6.0</string>
<string>143.6.1</string>
</dict>
</plist>

0 comments on commit 8e12615

Please sign in to comment.