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

[CM-1333] Update system image #22

Merged
merged 1 commit into from
Apr 13, 2023
Merged
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
6 changes: 3 additions & 3 deletions Sources/YStepper/UIKit/StepperControl+Appearance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ extension StepperControl.Appearance {
/// Default stepper appearance
public static let `default` = StepperControl.Appearance()
/// Default image for delete button. Is a `trash` from SF Symbols in template rendering mode.
public static let defaultDeleteImage = StepperControl.Images.delete.image.withRenderingMode(.alwaysTemplate)
public static let defaultDeleteImage = StepperControl.Images.delete.image
/// Default image for increment button. Is a `plus` from SF Symbols in template rendering mode.
public static let defaultIncrementImage = StepperControl.Images.increment.image.withRenderingMode(.alwaysTemplate)
public static let defaultIncrementImage = StepperControl.Images.increment.image
/// Default image for decrement button. Is a `minus` from SF Symbols in template rendering mode.
public static let defaultDecrementImage = StepperControl.Images.decrement.image.withRenderingMode(.alwaysTemplate)
public static let defaultDecrementImage = StepperControl.Images.decrement.image
}
2 changes: 2 additions & 0 deletions Sources/YStepper/UIKit/StepperControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ extension StepperControl {
case increment = "plus"
case decrement = "minus"
case delete = "trash"

public static var renderingMode: UIImage.RenderingMode { .alwaysTemplate }
}
}

Expand Down
6 changes: 6 additions & 0 deletions Tests/YStepperTests/Classes/StepperControlTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ final class StepperControlTests: XCTestCase {
XCTAssertEqual(sut.appearance.incrementImage, defaultAppearance.incrementImage)
}

func test_renderMode_deliversCorrectMode() {
StepperControl.Images.allCases.forEach {
XCTAssertEqual($0.image.renderingMode, .alwaysTemplate)
}
}

func testCustomeAppearance() {
let customeAppearance = StepperControl.Appearance(textStyle: (textColor: .red, typography: .systemButton))
let sut = makeSUT(appearance: customeAppearance)
Expand Down