diff --git a/SwiftyStars.podspec b/SwiftyStars.podspec index 62b379c..659e0a7 100644 --- a/SwiftyStars.podspec +++ b/SwiftyStars.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |spec| spec.name = "SwiftyStars" - spec.version = "0.0.3" + spec.version = "0.0.4" spec.summary = "A view with stars to use for ratings." spec.description = <<-DESC diff --git a/SwiftyStars/StarsView.swift b/SwiftyStars/StarsView.swift index 2991fdf..245d157 100644 --- a/SwiftyStars/StarsView.swift +++ b/SwiftyStars/StarsView.swift @@ -31,7 +31,8 @@ public class StarsView: UIView { } } - /// Indicates if a haptic feedback should be generated when tapping a star. Default is true + /// Indicates if a haptic feedback should be generated when tapping a star. + /// Default is true @IBInspectable public var generateHapticFeedbackOnSelection: Bool = true /// Private: The selected rating, @@ -57,7 +58,6 @@ public class StarsView: UIView { /// of the selection public var didChangeSelection: ((Int) -> Void)? - /// Used to adjust the spacing distance between stars @IBInspectable public var starsSpacing: NSNumber? { didSet { @@ -104,12 +104,12 @@ public class StarsView: UIView { }() - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) setup() } - required init?(coder: NSCoder) { + required public init?(coder: NSCoder) { super.init(coder: coder) setup() } diff --git a/SwiftyStarsTests/SwiftyStarsTests.swift b/SwiftyStarsTests/SwiftyStarsTests.swift index 7b43e0a..1f80254 100644 --- a/SwiftyStarsTests/SwiftyStarsTests.swift +++ b/SwiftyStarsTests/SwiftyStarsTests.swift @@ -10,9 +10,11 @@ import XCTest @testable import SwiftyStars class SwiftyStarsTests: XCTestCase { + + var starsView: StarsView! override func setUp() { - // Put setup code here. This method is called before the invocation of each test method in the class. + starsView = StarsView() } override func tearDown() { @@ -23,12 +25,14 @@ class SwiftyStarsTests: XCTestCase { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } - - func testPerformanceExample() { - // This is an example of a performance test case. + + func testSettingNumberOfStarsPerformance() { self.measure { - // Put the code you want to measure the time of here. + starsView.numberOfStars = 10 + starsView.currentRating = 5 } } + + }