Skip to content

Commit

Permalink
bug fix: if Carousel frame is zero, firstVisibleCell may not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
travel committed Oct 19, 2016
1 parent b8b5fe9 commit b5f2690
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CarouselSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Pod::Spec.new do |s|

s.name = "CarouselSwift"
s.version = "0.7"
s.version = "0.8"
s.summary = "An reusable carousel support both Horizontal and Vertical direction, and multi page as well"

s.description = <<-DESC
Expand Down
5 changes: 5 additions & 0 deletions Sources/Carousel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,11 @@ public class CarouselScrollView: UIScrollView {
update visible cell (add or remove cell if needed)
*/
private func updateVisibleCell() {
// make sure view size not zero
guard !CGSizeEqualToSize(CGSize.zero, frame.size) else {
return
}

// update current cells layout
updateCurrentCellsLayout()

Expand Down

0 comments on commit b5f2690

Please sign in to comment.