Skip to content
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
13 changes: 13 additions & 0 deletions Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// flex-ui
// Copyright © 2024 Space Code. All rights reserved.
// Copyright © 2025 Space Code. All rights reserved.
//

import UIKit
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down