Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MosaicCollectionViewLayout: UICollectionViewFlowLayout {
let columnIndex: Int = self._shortestColumnIndexInSection(section: section)
let indexPath = IndexPath(item: idx, section: section)

let itemSize = self._itemSizeAtIndexPath(indexPath: indexPath);
let itemSize = self._itemSizeAtIndexPath(indexPath: indexPath)
let xOffset = _sectionInset.left + (columnWidth + columnSpacing) * CGFloat(columnIndex)
let yOffset = _columnHeights![section][columnIndex]

Expand Down Expand Up @@ -136,14 +136,14 @@ class MosaicCollectionViewLayout: UICollectionViewFlowLayout {

override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
if (!(self.collectionView?.bounds.size.equalTo(newBounds.size))!) {
return true;
return true
}
return false;
return false
}

func _widthForSection (section: Int) -> CGFloat
{
return self.collectionView!.bounds.size.width - _sectionInset.left - _sectionInset.right;
return self.collectionView!.bounds.size.width - _sectionInset.left - _sectionInset.right
}

func _columnWidthForSection(section: Int) -> CGFloat
Expand Down Expand Up @@ -179,11 +179,11 @@ class MosaicCollectionViewLayout: UICollectionViewFlowLayout {

func _tallestColumnIndexInSection(section: Int) -> Int
{
var index: Int = 0;
var tallestHeight: CGFloat = 0;
_ = _columnHeights?[section].enumerated().map { (idx,height) in
var index: Int = 0
var tallestHeight: CGFloat = 0
_columnHeights?[section].enumerated().forEach { (idx,height) in
if (height > tallestHeight) {
index = idx;
index = idx
tallestHeight = height
}
}
Expand All @@ -192,11 +192,11 @@ class MosaicCollectionViewLayout: UICollectionViewFlowLayout {

func _shortestColumnIndexInSection(section: Int) -> Int
{
var index: Int = 0;
var index: Int = 0
var shortestHeight: CGFloat = CGFloat.greatestFiniteMagnitude
_ = _columnHeights?[section].enumerated().map { (idx,height) in
_columnHeights?[section].enumerated().forEach { (idx,height) in
if (height < shortestHeight) {
index = idx;
index = idx
shortestHeight = height
}
}
Expand Down Expand Up @@ -241,6 +241,6 @@ class MosaicCollectionViewLayoutInspector: NSObject, ASCollectionViewLayoutInspe
}

func scrollableDirections() -> ASScrollDirection {
return ASScrollDirectionVerticalDirections;
return ASScrollDirectionVerticalDirections
}
}