Skip to content

Commit

Permalink
Merge pull request #86 from BarredEwe/xcode-16.2-mainactor
Browse files Browse the repository at this point in the history
MainActor checking support in Xcode 16.2
  • Loading branch information
BarredEwe authored Dec 16, 2024
2 parents b6de02e + aca50b0 commit d43e385
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 6 additions & 4 deletions Example/PreFireExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
ONLY_ACTIVE_ARCH = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -395,6 +396,7 @@
MTL_FAST_MATH = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 6.0;
};
name = Release;
};
Expand Down Expand Up @@ -423,7 +425,7 @@
PRODUCT_NAME = PrefireExample;
SDKROOT = iphoneos;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
Expand Down Expand Up @@ -453,7 +455,7 @@
PRODUCT_NAME = PrefireExample;
SDKROOT = iphoneos;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = 1;
VALIDATE_PRODUCT = YES;
};
Expand All @@ -480,7 +482,7 @@
SDKROOT = iphoneos;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PrefireExample.app/PrefireExample";
};
Expand All @@ -506,7 +508,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PrefireExample.app/PrefireExample";
VALIDATE_PRODUCT = YES;
Expand Down
16 changes: 10 additions & 6 deletions Sources/Prefire/Playbook/PlaybookView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,20 @@ public struct PlaybookView: View {
viewModel.renderTime = loadingTime
})
.onPreferenceChange(UserStoryPreferenceKey.self) { userStory in
guard viewModel.story != userStory else { return }
viewModel.story = userStory
Task { @MainActor in
guard viewModel.story != userStory else { return }
viewModel.story = userStory

if !isComponent {
sectionNames = viewModels.compactMap { $0.story }.uniqued()
if !isComponent {
sectionNames = viewModels.compactMap { $0.story }.uniqued()
}
}
}
.onPreferenceChange(StatePreferenceKey.self) { state in
guard viewModel.state != state else { return }
viewModel.state = state
Task { @MainActor in
guard viewModel.state != state else { return }
viewModel.state = state
}
}

Divider()
Expand Down

0 comments on commit d43e385

Please sign in to comment.