-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e8cdc3
commit 2371ceb
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Demo/Demo.xcodeproj/xcuserdata/danielsaidi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "E81C6B04-28C5-4BF6-8010-89D8EF8CC498" | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Image+Demo.swift | ||
// Demo | ||
// | ||
// Created by Daniel Saidi on 2021-09-23. | ||
// Copyright © 2021-2024 Daniel Saidi. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension Image { | ||
|
||
static let popover = Image.symbol("bubble") | ||
|
||
static var correctBehavior = Image(systemName: "hand.thumbsup.circle") | ||
static var delayed = Image(systemName: "hand.raised.circle") | ||
static var hint = Image(systemName: "heart.text.square") | ||
static var incorrectBehavior = Image(systemName: "hand.thumbsdown.circle") | ||
static var reset = Image(systemName: "multiply.circle") | ||
static var tutorial = Image(systemName: "square.stack") | ||
} | ||
|
||
extension Image { | ||
|
||
static func symbol(_ name: String) -> Image { | ||
.init(systemName: name) | ||
} | ||
|
||
func label(_ text: String) -> some View { | ||
Label( | ||
title: { Text(text) }, | ||
icon: { self } | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Onboarding+Demo.swift | ||
// Demo | ||
// | ||
// Created by Daniel Saidi on 2021-09-23. | ||
// Copyright © 2021-2024 Daniel Saidi. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import OnboardingKit | ||
|
||
extension Onboarding { | ||
|
||
static var demoOnboardings: [Onboarding] = [ | ||
demoListConditional(), | ||
demoListCorrectBehavior, | ||
demoListDelayed, | ||
demoListPopover, | ||
demoListSheet, | ||
demoToolbarPopover | ||
] | ||
|
||
static func demoListConditional( | ||
_ condition: @escaping () -> Bool = { true } | ||
) -> ConditionalOnboarding { | ||
.init(id: "demo.list.conditional", condition: condition) | ||
} | ||
|
||
static let demoListCorrectBehavior = CorrectBehaviorOnboarding( | ||
id: "demo.list.correctbehavior", | ||
requiredIncorrectAttempts: 3 | ||
) | ||
|
||
static let demoListDelayed = DelayedOnboarding( | ||
id: "demo.list.delayed", | ||
requiredPresentationAttempts: 3 | ||
) | ||
|
||
static let demoListPopover = Onboarding(id: "demo.list.popover") | ||
|
||
static let demoListSheet = Onboarding(id: "demo.list.sheet") | ||
|
||
static let demoToolbarPopover = Onboarding(id: "demo.toolbar.popover") | ||
|
||
static let demoLocalizedFlow = LocalizedOnboardingFlow(id: "demo-flow") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
Localizable.strings | ||
OnboardingKit | ||
|
||
Created by Daniel Saidi on 2021-09-23. | ||
Copyright © 2024 Daniel Saidi. All rights reserved. | ||
*/ | ||
|
||
"onboarding.demo-flow.0.title" = "Localized onboarding flows"; | ||
"onboarding.demo-flow.0.text" = "Localized flows resolve pages by parsing available localized strings."; | ||
"onboarding.demo-flow.1.title" = "Automatic page count"; | ||
"onboarding.demo-flow.1.text" = "Just add or remove pages in Localizable.strings to update the flow."; | ||
"onboarding.demo-flow.2.title" = "That's it"; | ||
"onboarding.demo-flow.2.text" = "These flows can be presented with the built-in OnboardingPageView and OnboardingSlideshow."; |