Skip to content

Commit ecfaf69

Browse files
persidskiygithub-actions[bot]
authored andcommitted
Examples app: add override style uri setting (#7599)
GitOrigin-RevId: ad371105b2400dda2a86ef28e6cf66a7cb0472ce
1 parent c4fa4df commit ecfaf69

File tree

6 files changed

+1012
-313
lines changed

6 files changed

+1012
-313
lines changed

Examples.xcodeproj/project.pbxproj

Lines changed: 260 additions & 272 deletions
Large diffs are not rendered by default.

Examples.xcodeproj/xcshareddata/xcschemes/Examples.xcscheme

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
7-
buildImplicitDependencies = "YES">
7+
buildImplicitDependencies = "YES"
8+
runPostActionsOnFailure = "NO">
89
<BuildActionEntries>
910
<BuildActionEntry
1011
buildForTesting = "YES"
@@ -26,7 +27,17 @@
2627
buildConfiguration = "Debug"
2728
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2829
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
shouldUseLaunchSchemeArgsEnv = "NO">
30+
shouldUseLaunchSchemeArgsEnv = "NO"
31+
onlyGenerateCoverageForSpecifiedTargets = "NO">
32+
<TestPlans>
33+
<TestPlanReference
34+
default = "YES"
35+
reference = "container:Tests/TestPlans/Examples.xctestplan">
36+
</TestPlanReference>
37+
<TestPlanReference
38+
reference = "container:Tests/TestPlans/Examples no unit tests.xctestplan">
39+
</TestPlanReference>
40+
</TestPlans>
3041
<MacroExpansion>
3142
<BuildableReference
3243
BuildableIdentifier = "primary"
@@ -36,6 +47,30 @@
3647
ReferencedContainer = "container:Examples.xcodeproj">
3748
</BuildableReference>
3849
</MacroExpansion>
50+
<Testables>
51+
<TestableReference
52+
skipped = "NO">
53+
<BuildableReference
54+
BuildableIdentifier = "primary"
55+
BlueprintIdentifier = "542BE47134765F0824559C2F"
56+
BuildableName = "ExamplesTests.xctest"
57+
BlueprintName = "ExamplesTests"
58+
ReferencedContainer = "container:Examples.xcodeproj">
59+
</BuildableReference>
60+
</TestableReference>
61+
<TestableReference
62+
skipped = "NO">
63+
<BuildableReference
64+
BuildableIdentifier = "primary"
65+
BlueprintIdentifier = "F3570A57FF15EEC3B4529EF0"
66+
BuildableName = "ExamplesUITests.xctest"
67+
BlueprintName = "ExamplesUITests"
68+
ReferencedContainer = "container:Examples.xcodeproj">
69+
</BuildableReference>
70+
</TestableReference>
71+
</Testables>
72+
<CommandLineArguments>
73+
</CommandLineArguments>
3974
<EnvironmentVariables>
4075
<EnvironmentVariable
4176
key = "MTL_HUD_ENABLED"
@@ -63,37 +98,6 @@
6398
isEnabled = "YES">
6499
</EnvironmentVariable>
65100
</EnvironmentVariables>
66-
<TestPlans>
67-
<TestPlanReference
68-
reference = "container:Tests/TestPlans/Examples.xctestplan"
69-
default = "YES">
70-
</TestPlanReference>
71-
<TestPlanReference
72-
reference = "container:Tests/TestPlans/Examples no unit tests.xctestplan">
73-
</TestPlanReference>
74-
</TestPlans>
75-
<Testables>
76-
<TestableReference
77-
skipped = "NO">
78-
<BuildableReference
79-
BuildableIdentifier = "primary"
80-
BlueprintIdentifier = "542BE47134765F0824559C2F"
81-
BuildableName = "ExamplesTests.xctest"
82-
BlueprintName = "ExamplesTests"
83-
ReferencedContainer = "container:Examples.xcodeproj">
84-
</BuildableReference>
85-
</TestableReference>
86-
<TestableReference
87-
skipped = "NO">
88-
<BuildableReference
89-
BuildableIdentifier = "primary"
90-
BlueprintIdentifier = "F3570A57FF15EEC3B4529EF0"
91-
BuildableName = "ExamplesUITests.xctest"
92-
BlueprintName = "ExamplesUITests"
93-
ReferencedContainer = "container:Examples.xcodeproj">
94-
</BuildableReference>
95-
</TestableReference>
96-
</Testables>
97101
</TestAction>
98102
<LaunchAction
99103
buildConfiguration = "Debug"
@@ -115,6 +119,8 @@
115119
ReferencedContainer = "container:Examples.xcodeproj">
116120
</BuildableReference>
117121
</BuildableProductRunnable>
122+
<CommandLineArguments>
123+
</CommandLineArguments>
118124
<EnvironmentVariables>
119125
<EnvironmentVariable
120126
key = "MTL_HUD_ENABLED"
@@ -159,6 +165,8 @@
159165
ReferencedContainer = "container:Examples.xcodeproj">
160166
</BuildableReference>
161167
</BuildableProductRunnable>
168+
<CommandLineArguments>
169+
</CommandLineArguments>
162170
<EnvironmentVariables>
163171
<EnvironmentVariable
164172
key = "MTL_HUD_ENABLED"

Sources/Examples/ExamplesRootView.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import SwiftUI
22
import UIKit
33

44
struct ExamplesRootView: View {
5+
@StateObject private var overridesModel = StyleOverridesModel()
56
@State private var searchText: String = ""
67

78
// MARK: - Tab Content
@@ -28,13 +29,15 @@ struct ExamplesRootView: View {
2829
}
2930

3031
var body: some View {
31-
if #available(iOS 18.0, *) {
32-
modernTabView
33-
.safeTabBarMinimizeBehaviorOnScrollDown()
34-
} else {
35-
legacyTabView
36-
.safeTabBarMinimizeBehaviorOnScrollDown()
32+
Group {
33+
if #available(iOS 18.0, *) {
34+
modernTabView
35+
} else {
36+
legacyTabView
37+
}
3738
}
39+
.safeTabBarMinimizeBehaviorOnScrollDown()
40+
.environmentObject(overridesModel)
3841
}
3942

4043
// MARK: - Modern Tab View (iOS 18+)
@@ -56,6 +59,7 @@ struct ExamplesRootView: View {
5659
Tab("Settings", systemImage: "gear") {
5760
settingsTab
5861
}
62+
.badge(overridesModel.activeCount > 0 ? overridesModel.activeCount : 0)
5963

6064
Tab(role: .search) {
6165
searchTab
@@ -90,6 +94,7 @@ struct ExamplesRootView: View {
9094
Image(systemName: "gear")
9195
Text("Settings")
9296
}
97+
.badge(overridesModel.activeCount > 0 ? overridesModel.activeCount : 0)
9398
}
9499
}
95100
}

0 commit comments

Comments
 (0)