Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isIncludedInPinLayoutSizeCalculation property to Layoutable #268

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stleamist
Copy link

@stleamist stleamist commented Mar 23, 2023

This PR adds isIncludedInPinLayoutSizeCalculation property to Layoutable.

This can be useful when calculating the size of a view that contains subviews that may disappear based on conditions after the initial load. (similary to UIStackView's arrangedSubviews, or FlexLayout's isIncludedInLayout)

@stleamist stleamist force-pushed the feature/is-included-in-pin-layout branch from 152b8b6 to cbb1684 Compare May 16, 2023 12:12
@stleamist stleamist changed the title Add isIncludedInPinLayout property to Layoutable Add isIncludedInPinLayoutSizeCalculation property to Layoutable May 16, 2023
@stleamist
Copy link
Author

Hi @lucdion,

I've made a proposal to exclude subviews from the size calculation without removing them. I'd appreciate it if you could review it! :)

@stleamist stleamist force-pushed the feature/is-included-in-pin-layout branch from cbb1684 to 38bbd92 Compare May 16, 2023 12:21
Copy link
Member

@lucdion lucdion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition. Few comments

Sources/Layoutable.swift Outdated Show resolved Hide resolved

**Methods:**

* **`wrapContent()`**
**`wrapContent(padding: CGFloat)`**
**`wrapContent(padding: UIEdgeInsets)`**
Adjust the view's width and height to wrap all its subviews. The method also adjusts subviews's position to create a tight wrap. It is also possible to specify an optional padding around all subviews.
Adjust the view's width and height to wrap all its subviews that are included in the layout. The method also adjusts subviews's position to create a tight wrap. It is also possible to specify an optional padding around all subviews.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add an URL link that point to the documentation of the new property for the string are included in the layout

* **`wrapContent(:WrapType)`**
**`wrapContent(:WrapType, padding: CGFloat)`** **`wrapContent(:WrapType, padding: UIEdgeInsets)`**
Adjust the view's width AND/OR height to wrap all its subviews. Accept a WrapType parameter to define the wrapping type. It is also possible to specify an optional padding around all subviews.
Adjust the view's width AND/OR height to wrap all its subviews that are included in the layout. Accept a WrapType parameter to define the wrapping type. It is also possible to specify an optional padding around all subviews.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Sources/Layoutable.swift Outdated Show resolved Hide resolved
@stleamist stleamist force-pushed the feature/is-included-in-pin-layout branch from 7a35f5b to 7afd896 Compare May 16, 2023 13:40
@lucdion
Copy link
Member

lucdion commented May 17, 2023

Just missing changes related to the documentation 🙏

@stleamist
Copy link
Author

I'll let you know when the documentation is complete!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants