diff --git a/CHANGELOG.md b/CHANGELOG.md index 5471181..f5bb065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,20 @@ All notable changes to this project will be documented in this file. #### 1.x Releases +- `1.3.x` Releases - [1.3.0](#130) - `1.2.x` Releases - [1.2.0](#120) - `1.1.x` Releases - [1.1.0](#110) - `1.0.x` Releases - [1.0.0](#100) +## [1.3.0](https://github.com/space-code/flex-ui/releases/tag/1.3.0) +Released on 2025-05-08. + +#### Added +- Implement a new `setImage` method for the `UIButton` class. + - Added in Pull Request [#9](https://github.com/space-code/flex-ui/pull/9). +- Implement setting an optional value as the UILabel's text. + - Added in Pull Request [#8](https://github.com/space-code/flex-ui/pull/8). + ## [1.2.0](https://github.com/space-code/flex-ui/releases/tag/1.2.0) Released on 2025-02-15. diff --git a/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift b/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift index 103443b..b7ad54a 100644 --- a/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift +++ b/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift @@ -205,4 +205,17 @@ public extension FlexUI where Component: UIButton { component.isEnabled = isEnable return self } + + /// Sets the image for a specific button state. + /// + /// - Parameters: + /// - image: The image to set. + /// - controlState: The state for which to set the background image (default is `.normal`). + /// - Returns: The current instance of `FlexUI` for further configuration. + @discardableResult + @MainActor + func setImage(_ image: UIImage, for controlState: UIControl.State = .normal) -> Self { + component.setImage(image, for: controlState) + return self + } } diff --git a/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift b/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift index cb26eb4..e95abf8 100644 --- a/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift +++ b/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift @@ -1,6 +1,6 @@ // // flex-ui -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2025 Space Code. All rights reserved. // import UIKit @@ -12,7 +12,7 @@ public extension FlexUI where Component: UILabel { /// - Returns: The current instance of `FlexUI` for further configuration. @discardableResult @MainActor - func text(_ text: String) -> Self { + func text(_ text: String?) -> Self { component.text = text return self } diff --git a/Sources/FlexUI/Classes/Extensions/FlexUI+UITextField.swift b/Sources/FlexUI/Classes/Extensions/FlexUI+UITextField.swift index 8e31f27..d5c35b1 100644 --- a/Sources/FlexUI/Classes/Extensions/FlexUI+UITextField.swift +++ b/Sources/FlexUI/Classes/Extensions/FlexUI+UITextField.swift @@ -23,7 +23,7 @@ public extension FlexUI where Component: UITextField { /// - Returns: The current instance of `FlexUI` for further configuration. @discardableResult @MainActor - func placeholder(_ placeholder: String) -> Self { + func placeholder(_ placeholder: String?) -> Self { component.placeholder = placeholder return self }