Skip to content

Commit

Permalink
– polishing and tiny tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hujaber committed Oct 15, 2019
1 parent c5a040c commit 77772fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SwiftyStars.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions SwiftyStars/StarsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down Expand Up @@ -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()
}
Expand Down
14 changes: 9 additions & 5 deletions SwiftyStarsTests/SwiftyStarsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
}
}



}

0 comments on commit 77772fd

Please sign in to comment.