This has broken the preview process for all Skip customers (see this discussion for a representative complaint). We have been guarding against ENABLE_PREVIEWS when running our tooling from the Xcode build script, and when that broke in Xcode 16 without warning, everyone's SwiftUI previews went bonkers.
Surely there must be some way to prevent running a build script for the preview execution environment? Couldn't there just be a checkbox option to disable running a script when in a preview context? The "Use Legacy Previews Execution" option is not a solution because it will reset on the next Xcode upgrade – again breaking everyone's project without warning.
Post
Replies
Boosts
Views
Activity
Are you invoking safeAddExercice asynchronously? If so, the EnvironmentObjects may not be set at the time the callback is applied because it is not happening during the lifecycle of the view.
You could instead pass the environment object at the point when you schedule the exercise, thereby guaranteeing that the object will be available. E.g.:
var body: some View {
		Button("Add Exercise") {
				let subman = self.subscriptionManager
				DispachQueue.main.async {
						safeAddExercice(subman)
				}
		}
}
func safeAddExercice(_ subman: SubscriptionManager) {
		// operate on subman rather than self.subscriptionManager
}
FWIW, I am also seeing this crash with a multi-color image: "xmark.octagon.fill"
OutlineGroup is currently (as of beta6) rather buggy – many actions on simple lists cause crashes like this.
My current work-around (which isn't really a work-around) is to just render a flattened list and indent child elements manually. You don't get the automatic disclosure indicators, but it works OK until the sidebar outline groups get working.
FWIW, I've also experienced this issue, and filed it as FB8401910. LazyVStack is smooth up to a point, and then after 100 or so items it degrades to being unusable. We had to revert to using a UICollectionView wrapped in a UIViewRepresentable.