Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix setting new factor for a cell objects #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Glideshow/GlideCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ class GlideCell: UICollectionViewCell {
/// glide factor for the description lable. Default: 3
public var descriptionGlideFactor : CGFloat = 3 {
didSet{
slideDescription.glideFactor = titleGlideFactor
slideDescription.glideFactor = descriptionGlideFactor
}
}

/// glide factor for the title lable. Default: 1
public var captionGlideFactor : CGFloat = 1 {
didSet{
slideCaption.glideFactor = titleGlideFactor
slideCaption.glideFactor = captionGlideFactor
}
}

Expand Down
18 changes: 18 additions & 0 deletions GlideshowTests/GlideshowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,22 @@ class GlideshowTests: XCTestCase {

XCTAssertEqual(glideshow.pageIndicator!.numberOfPages, 2)
}

func test_setDescriptionGlideFactor() throws {
let descriptionGlideFactor: CGFloat = 2.0
glideshow.descriptionGlideFactor = descriptionGlideFactor
XCTAssertEqual(glideshow.descriptionGlideFactor, descriptionGlideFactor)
}

func test_setTitleGlideFactor() throws {
let titleGlideFactor: CGFloat = 1.0
glideshow.titleGlideFactor = titleGlideFactor
XCTAssertEqual(glideshow.titleGlideFactor, titleGlideFactor)
}

func test_setCaptionGlideFactor() throws {
let captionGlideFactor: CGFloat = 3.0
glideshow.captionGlideFactor = captionGlideFactor
XCTAssertEqual(glideshow.captionGlideFactor, captionGlideFactor)
}
}