Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
romansorochak committed Jul 7, 2017
1 parent 947f347 commit 5b20776
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PinterestLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PinterestLayout"
s.version = "1.0.1"
s.version = "1.0.2"
s.summary = "Pinterest like layout."
s.homepage = "https://github.com/romansorochak"
s.license = "MIT"
Expand Down
4 changes: 3 additions & 1 deletion PinterestLayout/PinterestLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public class PinterestLayout: UICollectionViewLayout {
return collectionView.numberOfItems(inSection: section)
}


/**
Invalidates layout.
*/
override public func invalidateLayout() {
cache.removeAll()
contentHeight = 0
Expand Down
1 change: 1 addition & 0 deletions PinterestLayoutExample/CollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CollectionViewCell: UICollectionViewCell {
override func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) {
super.apply(layoutAttributes)
if let attributes = layoutAttributes as? PinterestLayoutAttributes {
//change image view height by changing its constraint
imageViewHeightLayoutConstraint.constant = attributes.imageHeight
}
}
Expand Down
10 changes: 5 additions & 5 deletions PinterestLayoutExample/MyPinterestVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@

import UIKit
import PinterestLayout
import AVFoundation


class MyPinterestVC: PinterestVC {

override var prefersStatusBarHidden: Bool {
return true
}

override public func viewDidLoad() {
super.viewDidLoad()

Expand Down Expand Up @@ -62,4 +57,9 @@ class MyPinterestVC: PinterestVC {
right: 5
)
}


override var prefersStatusBarHidden: Bool {
return true
}
}

0 comments on commit 5b20776

Please sign in to comment.