From d0add59483be3d877ba569eeae1930c51429ec75 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 23 May 2025 15:42:49 +0600 Subject: [PATCH 1/3] Update the `setImage(_:)` method signature (#12) * Update the `setImage(_:)` method signature * Update `CHANGELOG.md` --- CHANGELOG.md | 6 ++++++ Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5bb065..0a0e8b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +## [Unreleased] + +#### Added +- Update the `setImage(_:)` method signature. + - Added in Pull Request [#12](https://github.com/space-code/flex-ui/pull/12). + #### 1.x Releases - `1.3.x` Releases - [1.3.0](#130) - `1.2.x` Releases - [1.2.0](#120) diff --git a/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift b/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift index b7ad54a..1a4dfb2 100644 --- a/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift +++ b/Sources/FlexUI/Classes/Extensions/FlexUI+UIButton.swift @@ -214,7 +214,7 @@ public extension FlexUI where Component: UIButton { /// - Returns: The current instance of `FlexUI` for further configuration. @discardableResult @MainActor - func setImage(_ image: UIImage, for controlState: UIControl.State = .normal) -> Self { + func setImage(_ image: UIImage?, for controlState: UIControl.State = .normal) -> Self { component.setImage(image, for: controlState) return self } From d1b217449c22646a1a2008f4d66621d260efd59d Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 23 May 2025 15:48:09 +0600 Subject: [PATCH 2/3] Implement the `setContentHuggingPriority` & `setContentCompressionResistancePriority` methods (#13) * Implement the `setContentHuggingPriority` & `setContentCompressionResistancePriority` methods * Update `CHANGELOG.md` --- CHANGELOG.md | 2 + .../Classes/Extensions/FlexUI+UIView.swift | 38 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a0e8b8..273a2df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. #### Added - Update the `setImage(_:)` method signature. - Added in Pull Request [#12](https://github.com/space-code/flex-ui/pull/12). +- Implement the `setContentHuggingPriority` & `setContentCompressionResistancePriority` methods. + - Added in Pull Request [#13](https://github.com/space-code/flex-ui/pull/13). #### 1.x Releases - `1.3.x` Releases - [1.3.0](#130) diff --git a/Sources/FlexUI/Classes/Extensions/FlexUI+UIView.swift b/Sources/FlexUI/Classes/Extensions/FlexUI+UIView.swift index b5b4032..9780170 100644 --- a/Sources/FlexUI/Classes/Extensions/FlexUI+UIView.swift +++ b/Sources/FlexUI/Classes/Extensions/FlexUI+UIView.swift @@ -1,6 +1,6 @@ // // flex-ui -// Copyright © 2024 Space Code. All rights reserved. +// Copyright © 2025 Space Code. All rights reserved. // import UIKit @@ -140,4 +140,40 @@ public extension FlexUI where Component: UIView { component.alpha = alpha return self } + + /// Sets the content hugging priority for the specified axis. + /// Content hugging determines how likely the view is to shrink below its intrinsic content size. + /// A higher priority means the view resists growing beyond its content size. + /// + /// - Parameters: + /// - priority: The priority value to set. + /// - axis: The axis (`.horizontal` or `.vertical`) on which to apply the priority. + /// - Returns: The current instance, allowing method chaining. + @discardableResult + @MainActor + func setContentHuggingPriority( + _ priority: UILayoutPriority, + for axis: NSLayoutConstraint.Axis + ) -> Self { + component.setContentHuggingPriority(priority, for: axis) + return self + } + + /// Sets the content compression resistance priority for the specified axis. + /// Compression resistance determines how likely the view is to shrink below its intrinsic content size under compression. + /// A higher priority means the view resists being made smaller than its content size. + /// + /// - Parameters: + /// - priority: The priority value to set. + /// - axis: The axis (`.horizontal` or `.vertical`) on which to apply the priority. + /// - Returns: The current instance, allowing method chaining. + @discardableResult + @MainActor + func setContentCompressionResistancePriority( + _ priority: UILayoutPriority, + for axis: NSLayoutConstraint.Axis + ) -> Self { + component.setContentCompressionResistancePriority(priority, for: axis) + return self + } } From 2f299e218d4f077e9da911b6820d65f4878dce19 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 23 May 2025 16:08:37 +0600 Subject: [PATCH 3/3] Update `CHANGELOG.md` (#14) --- CHANGELOG.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 273a2df..32a4870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,15 @@ # Change Log All notable changes to this project will be documented in this file. -## [Unreleased] +#### 1.x Releases +- `1.4.x` Releases - [1.4.0](#140) +- `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.4.0](https://github.com/space-code/flex-ui/releases/tag/1.4.0) +Released on 2025-05-23. #### Added - Update the `setImage(_:)` method signature. @@ -9,12 +17,6 @@ All notable changes to this project will be documented in this file. - Implement the `setContentHuggingPriority` & `setContentCompressionResistancePriority` methods. - Added in Pull Request [#13](https://github.com/space-code/flex-ui/pull/13). -#### 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.