-
Notifications
You must be signed in to change notification settings - Fork 236
Support Swift 6 #277
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
Support Swift 6 #277
Changes from all commits
74c81db
021e80a
1500ac6
902b08c
baeb5d1
7b531f4
e1bc1c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ import FlexLayoutYogaKit | |
| label.flex.margin(10) | ||
| ``` | ||
| */ | ||
| @MainActor | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flex creates and manages UIViews, so it should also use MainActor. |
||
| public final class Flex { | ||
|
|
||
| // | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
|
|
||
| import UIKit | ||
|
|
||
| @MainActor | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| private var flexLayoutAssociatedObjectHandle = 72_399_923 | ||
|
|
||
| extension UIView { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,14 +13,15 @@ | |
| import FlexLayout | ||
| import XCTest | ||
|
|
||
| final class InsetTests: XCTestCase { | ||
| @MainActor | ||
| final class InsetTests: XCTestCase, Sendable { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modify to allow testing of MainActor-isolated objects. |
||
|
|
||
| var viewController: UIViewController! | ||
| var rootFlexContainer: UIView! | ||
| var aView: UIView! | ||
|
|
||
| override func setUp() { | ||
| super.setUp() | ||
| override func setUp() async throws { | ||
| try await super.setUp() | ||
|
|
||
| viewController = UIViewController() | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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