Skip to content

Conversation

heoblitz
Copy link
Collaborator

@heoblitz heoblitz commented Jul 20, 2025

What is this PR?

Many major libraries support building in the Swift 6 environment. FlexLayout has also been updated to build with Swift 6.

Related to #276

name: "FlexLayout",
platforms: [
.iOS(.v12),
.iOS(.v13),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The minimum supported version has been raised to enable the use of MainActor.

For CocoaPods, the current minimum supported version is iOS 13.4.

https://developer.apple.com/documentation/swift/mainactor


import UIKit

@MainActor
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the flex property of UIView is isolated to the MainActor, the corresponding global variable is also annotated with MainActor instead of nonisolated.


final class InsetTests: XCTestCase {
@MainActor
final class InsetTests: XCTestCase, Sendable {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Modify to allow testing of MainActor-isolated objects.

label.flex.margin(10)
```
*/
@MainActor
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Flex creates and manages UIViews, so it should also use MainActor.

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.

Excellent. Great improvements

@heoblitz
Copy link
Collaborator Author

It seems I don’t have permission to merge into master, so please merge when you have time. Thank you.

@lucdion lucdion merged commit f462850 into layoutBox:master Jul 23, 2025
1 check passed
@lucdion
Copy link
Member

lucdion commented Jul 23, 2025

Thanks, its merged and a new release 2.2.2 is published

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