You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am observing differences in the lifecycle timing of .introspect execution when upgrading from iOS 17 to iOS 18. Specifically, the order in which .introspect is executed relative to other view modifiers or lifecycle events (like .task) appears to have changed.
Here’s an example (though this issue also arises in other contexts):
ScrollView(.horizontal) {
// Scroll view content
}
.introspect(.scrollView, on: .iOS(.v16...)) { scrollView in
// Setup UIScrollView
}
.task {
// Logic dependent on UIScrollView setup
}
• iOS 17 Behavior: .introspect is called earlier in the view’s lifecycle, so the UIScrollView setup is completed before .task is executed.
• iOS 18 Behavior: .task is executed first, and .introspect is called afterward, leading to cases where the UIScrollView is not yet set up when the .task logic runs.
This timing inconsistency creates challenges for logic that depends on .introspect being executed before other lifecycle events.
Checklist
I have read the README before submitting this report.
The .introspect modifier should ideally execute consistently at the same lifecycle stage across iOS versions, ensuring predictable behavior.
Questions
1. Is this a known change in the way .introspect interacts with SwiftUI lifecycle events in iOS 18?
2. Are there any suggested patterns or best practices to ensure that .introspect executes at the desired lifecycle stage, regardless of the iOS version?
3. Has anyone else experienced similar timing inconsistencies with .introspect or other modifiers, and if so, how did you address them?
Thank you for your help!
Actual behavior
No response
Steps to reproduce
No response
Version information
No response
Destination operating system
No response
Xcode version information
No response
Swift Compiler version information
No response
The text was updated successfully, but these errors were encountered:
Description
Hi, I am observing differences in the lifecycle timing of .introspect execution when upgrading from iOS 17 to iOS 18. Specifically, the order in which .introspect is executed relative to other view modifiers or lifecycle events (like .task) appears to have changed.
Here’s an example (though this issue also arises in other contexts):
• iOS 17 Behavior: .introspect is called earlier in the view’s lifecycle, so the UIScrollView setup is completed before .task is executed.
• iOS 18 Behavior: .task is executed first, and .introspect is called afterward, leading to cases where the UIScrollView is not yet set up when the .task logic runs.
This timing inconsistency creates challenges for logic that depends on .introspect being executed before other lifecycle events.
Checklist
Expected behavior
The .introspect modifier should ideally execute consistently at the same lifecycle stage across iOS versions, ensuring predictable behavior.
Questions
1. Is this a known change in the way .introspect interacts with SwiftUI lifecycle events in iOS 18?
2. Are there any suggested patterns or best practices to ensure that .introspect executes at the desired lifecycle stage, regardless of the iOS version?
3. Has anyone else experienced similar timing inconsistencies with .introspect or other modifiers, and if so, how did you address them?
Thank you for your help!
Actual behavior
No response
Steps to reproduce
No response
Version information
No response
Destination operating system
No response
Xcode version information
No response
Swift Compiler version information
No response
The text was updated successfully, but these errors were encountered: