Skip to content

Commit 99562cf

Browse files
committed
fix issue
1 parent 032555b commit 99562cf

14 files changed

Lines changed: 259 additions & 179 deletions

.swiftpm/xcode/xcshareddata/xcschemes/OnboardingUI.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1600"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

.swiftpm/xcode/xcshareddata/xcschemes/OnboardingUITests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1600"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sample/Sample.xcodeproj/project.pbxproj

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
attributes = {
136136
BuildIndependentTargetsInParallel = 1;
137137
LastSwiftUpdateCheck = 1500;
138-
LastUpgradeCheck = 1510;
138+
LastUpgradeCheck = 2600;
139139
TargetAttributes = {
140140
F71046232B2353F00044BCE6 = {
141141
CreatedOnToolsVersion = 15.0.1;
@@ -228,6 +228,7 @@
228228
COPY_PHASE_STRIP = NO;
229229
DEAD_CODE_STRIPPING = YES;
230230
DEBUG_INFORMATION_FORMAT = dwarf;
231+
DEVELOPMENT_TEAM = 7AA87AZ875;
231232
ENABLE_STRICT_OBJC_MSGSEND = YES;
232233
ENABLE_TESTABILITY = YES;
233234
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -249,6 +250,7 @@
249250
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
250251
MTL_FAST_MATH = YES;
251252
ONLY_ACTIVE_ARCH = YES;
253+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
252254
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
253255
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
254256
};
@@ -291,6 +293,7 @@
291293
COPY_PHASE_STRIP = NO;
292294
DEAD_CODE_STRIPPING = YES;
293295
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
296+
DEVELOPMENT_TEAM = 7AA87AZ875;
294297
ENABLE_NS_ASSERTIONS = NO;
295298
ENABLE_STRICT_OBJC_MSGSEND = YES;
296299
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -305,6 +308,7 @@
305308
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
306309
MTL_ENABLE_DEBUG_INFO = NO;
307310
MTL_FAST_MATH = YES;
311+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
308312
SWIFT_COMPILATION_MODE = wholemodule;
309313
};
310314
name = Release;
@@ -320,9 +324,10 @@
320324
CURRENT_PROJECT_VERSION = 1;
321325
DEAD_CODE_STRIPPING = YES;
322326
DEVELOPMENT_ASSET_PATHS = "\"Sample/Preview Content\"";
323-
DEVELOPMENT_TEAM = 7AA87AZ875;
327+
ENABLE_APP_SANDBOX = YES;
324328
ENABLE_HARDENED_RUNTIME = YES;
325329
ENABLE_PREVIEWS = YES;
330+
ENABLE_USER_SELECTED_FILES = readonly;
326331
GENERATE_INFOPLIST_FILE = YES;
327332
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2023 Keisuke Chinone";
328333
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
@@ -348,7 +353,7 @@
348353
SWIFT_EMIT_LOC_STRINGS = YES;
349354
SWIFT_VERSION = 6.0;
350355
TARGETED_DEVICE_FAMILY = "1,2,3,7";
351-
TVOS_DEPLOYMENT_TARGET = 15.0;
356+
TVOS_DEPLOYMENT_TARGET = 17.0;
352357
XROS_DEPLOYMENT_TARGET = 1.0;
353358
};
354359
name = Debug;
@@ -364,9 +369,10 @@
364369
CURRENT_PROJECT_VERSION = 1;
365370
DEAD_CODE_STRIPPING = YES;
366371
DEVELOPMENT_ASSET_PATHS = "\"Sample/Preview Content\"";
367-
DEVELOPMENT_TEAM = 7AA87AZ875;
372+
ENABLE_APP_SANDBOX = YES;
368373
ENABLE_HARDENED_RUNTIME = YES;
369374
ENABLE_PREVIEWS = YES;
375+
ENABLE_USER_SELECTED_FILES = readonly;
370376
GENERATE_INFOPLIST_FILE = YES;
371377
INFOPLIST_KEY_NSHumanReadableCopyright = "© 2023 Keisuke Chinone";
372378
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
@@ -392,7 +398,7 @@
392398
SWIFT_EMIT_LOC_STRINGS = YES;
393399
SWIFT_VERSION = 6.0;
394400
TARGETED_DEVICE_FAMILY = "1,2,3,7";
395-
TVOS_DEPLOYMENT_TARGET = 15.0;
401+
TVOS_DEPLOYMENT_TARGET = 17.0;
396402
XROS_DEPLOYMENT_TARGET = 1.0;
397403
};
398404
name = Release;

Sample/Sample/Sample.entitlements

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>com.apple.security.app-sandbox</key>
6-
<true/>
7-
<key>com.apple.security.files.user-selected.read-only</key>
8-
<true/>
9-
</dict>
4+
<dict/>
105
</plist>

Sample/Sample/UI/WelcomeOnboardingSheetView.swift

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,48 @@ struct WelcomeOnboardingSheetView: View {
1919
}
2020

2121
var body: some View {
22-
OnboardingSheetView {
23-
Text("Welcome to\nOnboardingUI")
24-
.onboardingTextFormatting(style: .title)
25-
} content: {
26-
OnboardingItem(systemName: "applescript",shape: .red) {
27-
Text("Easy to Make")
28-
.onboardingTextFormatting(style: .subtitle)
29-
Text("Onboarding screens like Apple's stock apps can be easily created with SwiftUI.")
30-
.onboardingTextFormatting(style: .content)
31-
}
32-
33-
OnboardingItem(systemName: "apple.logo") {
34-
Text("Not only for iPhone, but also for Mac, iPad, Vision Pro")
35-
.onboardingTextFormatting(style: .subtitle)
36-
Text("It supports not only iPhone, but also Mac, iPad, and Vision Pro. Therefore, there is no need to rewrite the code for each device.")
37-
.onboardingTextFormatting(style: .content)
38-
}
39-
40-
OnboardingItem(systemName: "circle.badge.checkmark",mode: .palette,primary: .primary,secondary: .blue) {
41-
Text("Customize SF Symbols")
42-
.onboardingTextFormatting(style: .subtitle)
43-
Text("When using a highly customizable implementation method, multi-color and SF symbol hierarchies are supported and can be freely customized.")
44-
.onboardingTextFormatting(style: .content)
45-
}
46-
22+
OnboardingSheetView {
23+
Text("Welcome to\nOnboardingUI")
24+
.onboardingTextFormatting(style: .title)
25+
} content: {
26+
OnboardingItem(systemName: "applescript",shape: .red) {
27+
Text("Easy to Make")
28+
.onboardingTextFormatting(style: .subtitle)
29+
Text("Onboarding screens like Apple's stock apps can be easily created with SwiftUI.")
30+
.onboardingTextFormatting(style: .content)
31+
}
32+
33+
OnboardingItem(systemName: "apple.logo") {
34+
Text("Not only for iPhone, but also for Mac, iPad, Vision Pro")
35+
.onboardingTextFormatting(style: .subtitle)
36+
Text("It supports not only iPhone, but also Mac, iPad, and Vision Pro. Therefore, there is no need to rewrite the code for each device.")
37+
.onboardingTextFormatting(style: .content)
38+
}
39+
40+
OnboardingItem(systemName: "circle.badge.checkmark",mode: .palette,primary: .primary,secondary: .blue) {
41+
Text("Customize SF Symbols")
42+
.onboardingTextFormatting(style: .subtitle)
43+
Text("When using a highly customizable implementation method, multi-color and SF symbol hierarchies are supported and can be freely customized.")
44+
.onboardingTextFormatting(style: .content)
45+
}
46+
4747
#if os(tvOS)
48-
OnboardingItem(systemName: "ellipsis",shape: .white) {
49-
OnboardingSubtitle("Many other benefits")
50-
OnboardingContent("Now, tvOS is also supported, making it easy to create onboarding. Now you can create onboarding for all platforms except watchOS.")
51-
}
48+
OnboardingItem(systemName: "ellipsis",shape: .white) {
49+
Text("Many other benefits")
50+
.onboardingTextFormatting(style: .subtitle)
51+
52+
Text("Now, tvOS is also supported, making it easy to create onboarding. Now you can create onboarding for all platforms except watchOS.")
53+
.onboardingTextFormatting(style: .content)
54+
}
5255
#endif
53-
} link: {
54-
Link("Check our Privacy Policy…", destination: URL(string: "https://kc-2001ms.github.io/en/privacy.html")!)
55-
} button: {
56-
ContinueButton(color: .accentColor, action: {
57-
dismiss()
58-
})
59-
}
56+
} link: {
57+
Link("Check our Privacy Policy…", destination: URL(string: "https://kc-2001ms.github.io/en/privacy.html")!)
58+
} button: {
59+
ContinueButton(color: .accentColor, action: {
60+
dismiss()
61+
})
62+
}
63+
6064
}
6165
}
6266

Sources/OnboardingUI/Processing/Onboarding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public struct Feature: Identifiable, Sendable {
9191
/// - Parameters:
9292
/// - title: Title outlining the features
9393
/// - imageName: Images showing features
94-
/// - message: Description of features as a localized resource
94+
/// - messageResource: Description of features as a localized resource
9595
public init(_ title: LocalizedStringKey,imageName: String, messageResource: LocalizedStringResource) {
9696
self.id = UUID()
9797
self.title = Text(title)

Sources/OnboardingUI/UI/Modifier/View+onboardingSheet.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ struct OnboardingSheet<O: Onboarding>: ViewModifier {
2121

2222
public func body(content: Content) -> some View {
2323
content
24+
// .fullScreenCover(isPresented: <#T##Binding<Bool>#>) {
25+
//
26+
// }
2427
.sheet(isPresented: $isPresented) {
2528
if #available(iOS 18.0,macOS 15.0,tvOS 18.0,visionOS 2.0,*) {
2629
OnboardingView(onboarding: onboarding)
@@ -82,7 +85,7 @@ public extension View {
8285
.frame(width: 400, height: 300)
8386
#endif
8487
.onboardingSheet(isPresented: $isPresented, PreviewWhatIsNewOnboarding())
85-
.onboardingViewStyle(.glass)
88+
.onboardingViewStyle(.automatic)
8689
}
8790

8891
}

Sources/OnboardingUI/UI/Style/OnboardingViewStyle.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ public struct OnboardingViewStyleConfiguration: Sendable {
158158
}
159159

160160
@preconcurrency public struct DismissLabel: View, Sendable {
161-
@Environment(\.dismiss) var dismiss
162-
163161
var text: Text
164162

165163
public init(text: Text) {

Sources/OnboardingUI/UI/Style/OnboardingViewStyle/AutomaticOnboardingViewStyle.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ import SwiftUI
1111
@available(watchOS, unavailable)
1212
public struct AutomaticOnboardingViewStyle: OnboardingViewStyle {
1313
public func makeBody(configuration: Configuration) -> some View {
14-
if #available(iOS 26, macOS 26, tvOS 26, visionOS 26, *) {
14+
#if os(visionOS)
15+
ClassicOnboardingViewStyle().makeBody(configuration: configuration)
16+
#else
17+
if #available(iOS 26, macOS 26, tvOS 26, *) {
1518
ColoredGlassOnboardingViewStyle().makeBody(configuration: configuration)
1619
} else {
1720
ClassicOnboardingViewStyle().makeBody(configuration: configuration)
1821
}
22+
#endif
1923
}
2024
}
2125

@@ -33,3 +37,4 @@ extension OnboardingViewStyle where Self == AutomaticOnboardingViewStyle {
3337
OnboardingView(onboarding: PreviewWhatIsNewOnboarding())
3438
.onboardingViewStyle(.automatic)
3539
}
40+

Sources/OnboardingUI/UI/Style/OnboardingViewStyle/BasicOnboardingViewStyle.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,18 @@ public struct BasicOnboardingViewStyle: OnboardingViewStyle {
111111
.padding(.vertical, 10)
112112
}
113113
.buttonStyle(.borderedProminent)
114-
.padding(.horizontal, 40)
114+
.buttonBorderShape(.capsule)
115+
#if os(iOS)
116+
.padding([.horizontal],40)
117+
#else
118+
.padding([.horizontal, .bottom],40)
119+
#endif
115120
}
116121
}
117122
}
123+
#if os(tvOS)
124+
.frame(width: 1500, height: 1000)
125+
#endif
118126
}
119127
}
120128

0 commit comments

Comments
 (0)