File tree Expand file tree Collapse file tree
Sources/FlexUI/Classes/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44## [ Unreleased]
55
66#### Added
7+ - Implement a new ` setImage ` method for the ` UIButton ` class.
8+ - Added in Pull Request [ #9 ] ( https://github.com/space-code/flex-ui/pull/9 ) .
79- Implement setting an optional value as the UILabel's text.
810 - Added in Pull Request [ #8 ] ( https://github.com/space-code/flex-ui/pull/8 ) .
911
Original file line number Diff line number Diff line change @@ -205,4 +205,17 @@ public extension FlexUI where Component: UIButton {
205205 component. isEnabled = isEnable
206206 return self
207207 }
208+
209+ /// Sets the image for a specific button state.
210+ ///
211+ /// - Parameters:
212+ /// - image: The image to set.
213+ /// - controlState: The state for which to set the background image (default is `.normal`).
214+ /// - Returns: The current instance of `FlexUI` for further configuration.
215+ @discardableResult
216+ @MainActor
217+ func setImage( _ image: UIImage , for controlState: UIControl . State = . normal) -> Self {
218+ component. setImage ( image, for: controlState)
219+ return self
220+ }
208221}
You can’t perform that action at this time.
0 commit comments