Skip to content

Commit 8736b30

Browse files
committed
Make util methods public
1 parent e52ec25 commit 8736b30

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Sources/UICollectionViewFlexLayout.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,50 +188,50 @@ extension UICollectionViewFlexLayout {
188188
return self.collectionView?.delegate as? UICollectionViewDelegateFlexLayout
189189
}
190190

191-
func size(forItemAt indexPath: IndexPath) -> CGSize {
191+
public func size(forItemAt indexPath: IndexPath) -> CGSize {
192192
guard let collectionView = self.collectionView, let delegate = self.delegate else { return .zero }
193193
return delegate.collectionView?(collectionView, layout: self, sizeForItemAt: indexPath) ?? .zero
194194
}
195195

196-
func verticalSpacing(betweenSectionAt section: Int, and nextSection: Int) -> CGFloat {
196+
public func verticalSpacing(betweenSectionAt section: Int, and nextSection: Int) -> CGFloat {
197197
guard section != nextSection else { return 0 }
198198
guard let collectionView = self.collectionView, let delegate = self.delegate else { return 0 }
199199
return delegate.collectionView?(collectionView, layout: self, verticalSpacingBetweenSectionAt: section, and: nextSection) ?? 0
200200
}
201201

202-
func margin(forSectionAt section: Int) -> UIEdgeInsets {
202+
public func margin(forSectionAt section: Int) -> UIEdgeInsets {
203203
guard let collectionView = self.collectionView, let delegate = self.delegate else { return .zero }
204204
return delegate.collectionView?(collectionView, layout: self, marginForSectionAt: section) ?? .zero
205205
}
206206

207-
func padding(forSectionAt section: Int) -> UIEdgeInsets {
207+
public func padding(forSectionAt section: Int) -> UIEdgeInsets {
208208
guard let collectionView = self.collectionView, let delegate = self.delegate else { return .zero }
209209
return delegate.collectionView?(collectionView, layout: self, paddingForSectionAt: section) ?? .zero
210210
}
211211

212-
func horizontalSpacing(betweenItemAt indexPath: IndexPath, and nextIndexPath: IndexPath) -> CGFloat {
212+
public func horizontalSpacing(betweenItemAt indexPath: IndexPath, and nextIndexPath: IndexPath) -> CGFloat {
213213
guard indexPath != nextIndexPath else { return 0 }
214214
guard let collectionView = self.collectionView, let delegate = self.delegate else { return 0 }
215215
return delegate.collectionView?(collectionView, layout: self, horizontalSpacingBetweenItemAt: indexPath, and: nextIndexPath) ?? 0
216216
}
217217

218-
func verticalSpacing(betweenItemAt indexPath: IndexPath, and nextIndexPath: IndexPath) -> CGFloat {
218+
public func verticalSpacing(betweenItemAt indexPath: IndexPath, and nextIndexPath: IndexPath) -> CGFloat {
219219
guard indexPath != nextIndexPath else { return 0 }
220220
guard let collectionView = self.collectionView, let delegate = self.delegate else { return 0 }
221221
return delegate.collectionView?(collectionView, layout: self, verticalSpacingBetweenItemAt: indexPath, and: nextIndexPath) ?? 0
222222
}
223223

224-
func margin(forItemAt indexPath: IndexPath) -> UIEdgeInsets {
224+
public func margin(forItemAt indexPath: IndexPath) -> UIEdgeInsets {
225225
guard let collectionView = self.collectionView, let delegate = self.delegate else { return .zero }
226226
return delegate.collectionView?(collectionView, layout: self, marginForItemAt: indexPath) ?? .zero
227227
}
228228

229-
func padding(forItemAt indexPath: IndexPath) -> UIEdgeInsets {
229+
public func padding(forItemAt indexPath: IndexPath) -> UIEdgeInsets {
230230
guard let collectionView = self.collectionView, let delegate = self.delegate else { return .zero }
231231
return delegate.collectionView?(collectionView, layout: self, paddingForItemAt: indexPath) ?? .zero
232232
}
233233

234-
func zIndex(forItemAt indexPath: IndexPath) -> Int {
234+
public func zIndex(forItemAt indexPath: IndexPath) -> Int {
235235
guard let collectionView = self.collectionView, let delegate = self.delegate else { return 0 }
236236
return delegate.collectionView?(collectionView, layout: self, zIndexForItemAt: indexPath) ?? 0
237237
}

0 commit comments

Comments
 (0)