Skip to content

Commit f1b0a54

Browse files
authored
Release 1.4.0 (#15)
2 parents a2c34f7 + 2f299e2 commit f1b0a54

3 files changed

Lines changed: 48 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@
22
All notable changes to this project will be documented in this file.
33

44
#### 1.x Releases
5+
- `1.4.x` Releases - [1.4.0](#140)
56
- `1.3.x` Releases - [1.3.0](#130)
67
- `1.2.x` Releases - [1.2.0](#120)
78
- `1.1.x` Releases - [1.1.0](#110)
89
- `1.0.x` Releases - [1.0.0](#100)
910

11+
## [1.4.0](https://github.com/space-code/flex-ui/releases/tag/1.4.0)
12+
Released on 2025-05-23.
13+
14+
#### Added
15+
- Update the `setImage(_:)` method signature.
16+
- Added in Pull Request [#12](https://github.com/space-code/flex-ui/pull/12).
17+
- Implement the `setContentHuggingPriority` & `setContentCompressionResistancePriority` methods.
18+
- Added in Pull Request [#13](https://github.com/space-code/flex-ui/pull/13).
19+
1020
## [1.3.0](https://github.com/space-code/flex-ui/releases/tag/1.3.0)
1121
Released on 2025-05-08.
1222

Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public extension FlexUI where Component: UIButton {
214214
/// - Returns: The current instance of `FlexUI` for further configuration.
215215
@discardableResult
216216
@MainActor
217-
func setImage(_ image: UIImage, for controlState: UIControl.State = .normal) -> Self {
217+
func setImage(_ image: UIImage?, for controlState: UIControl.State = .normal) -> Self {
218218
component.setImage(image, for: controlState)
219219
return self
220220
}

Sources/FlexUI/Classes/Extensions/FlexUI+UIView.swift

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// flex-ui
3-
// Copyright © 2024 Space Code. All rights reserved.
3+
// Copyright © 2025 Space Code. All rights reserved.
44
//
55

66
import UIKit
@@ -140,4 +140,40 @@ public extension FlexUI where Component: UIView {
140140
component.alpha = alpha
141141
return self
142142
}
143+
144+
/// Sets the content hugging priority for the specified axis.
145+
/// Content hugging determines how likely the view is to shrink below its intrinsic content size.
146+
/// A higher priority means the view resists growing beyond its content size.
147+
///
148+
/// - Parameters:
149+
/// - priority: The priority value to set.
150+
/// - axis: The axis (`.horizontal` or `.vertical`) on which to apply the priority.
151+
/// - Returns: The current instance, allowing method chaining.
152+
@discardableResult
153+
@MainActor
154+
func setContentHuggingPriority(
155+
_ priority: UILayoutPriority,
156+
for axis: NSLayoutConstraint.Axis
157+
) -> Self {
158+
component.setContentHuggingPriority(priority, for: axis)
159+
return self
160+
}
161+
162+
/// Sets the content compression resistance priority for the specified axis.
163+
/// Compression resistance determines how likely the view is to shrink below its intrinsic content size under compression.
164+
/// A higher priority means the view resists being made smaller than its content size.
165+
///
166+
/// - Parameters:
167+
/// - priority: The priority value to set.
168+
/// - axis: The axis (`.horizontal` or `.vertical`) on which to apply the priority.
169+
/// - Returns: The current instance, allowing method chaining.
170+
@discardableResult
171+
@MainActor
172+
func setContentCompressionResistancePriority(
173+
_ priority: UILayoutPriority,
174+
for axis: NSLayoutConstraint.Axis
175+
) -> Self {
176+
component.setContentCompressionResistancePriority(priority, for: axis)
177+
return self
178+
}
143179
}

0 commit comments

Comments
 (0)