Skip to content

Commit 46d2869

Browse files
committed
Update docs
1 parent 7c9b095 commit 46d2869

17 files changed

+43
-34
lines changed

Demo/Demo/DemoOnboardingPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum DemoOnboardingPage: Int, CaseIterable, Identifiable {
4040

4141
struct DemoOnboardingPageContent: View {
4242

43-
let pageInfo: OnboardingFlowPage<DemoOnboardingPage>
43+
let pageInfo: OnboardingPage<DemoOnboardingPage>
4444

4545
var body: some View {
4646
VStack(alignment: .leading, spacing: 50) {

RELEASE_NOTES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ These release notes only cover the current major version.
1313

1414

1515

16+
## 9.0.1
17+
18+
This patch renames a few things for ease of use.
19+
20+
21+
1622
## 9.0
1723

1824
This version makes the SDK target iOS 17 and aligned versions.
@@ -31,7 +37,7 @@ This version makes the SDK target iOS 17 and aligned versions.
3137

3238
### 💥 Breaking Changes
3339

34-
* `OnboardingPageInfo` is renamed to `OnboardingFlowPage`.
40+
* `OnboardingPageInfo` is renamed to `OnboardingPage`.
3541
* `OnboardingPageState` is renamed to `OnboardingFlowState`.
3642
* `OnboardingScreen` is renamed to `OnboardingFlowContainer`.
3743
* This version makes the SDK target iOS 17 and aligned versions.

Sources/OnboardingKit/Flow/OnboardingFlow+PageInfoProvider.swift renamed to Sources/OnboardingKit/Flows/OnboardingFlow+PageInfoProvider.swift

File renamed without changes.
File renamed without changes.

Sources/OnboardingKit/Flow/OnboardingFlowContainer.swift renamed to Sources/OnboardingKit/Flows/OnboardingFlowContainer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public struct OnboardingFlowContainer<Page, Content: View, Buttons: View>: View
6666
}
6767

6868
/// This view can wrap any content view and applies an alignment and max width.
69-
public struct OnboardingFlowContainerCenteredContent<Content: View>: View {
69+
public struct OnboardingFlowCenteredContent<Content: View>: View {
7070

7171
/// Create a centered onboarding screen content view.
7272
///
@@ -149,7 +149,7 @@ private extension OnboardingFlowContainer {
149149
pages: pages,
150150
pageIndex: $pageIndex
151151
) { info in
152-
OnboardingFlowContainerCenteredContent {
152+
OnboardingFlowCenteredContent {
153153
Text("Page \(info.pageIndex)")
154154
}
155155
}
File renamed without changes.

Sources/OnboardingKit/Onboarding+CorrectBehavior.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ extension Onboarding {
1616
/// An example could be a puzzle game for kids, where an onboarding could
1717
/// trigger the pieces animate to their correct positions.
1818
///
19-
/// Call ``registerIncorrectBehavior()`` when the user does not
20-
/// behave as intended, to present an onboarding after a certain number of
21-
/// attempts, then call ``registerCorrectBehavior()`` when the user
22-
/// behaves as intended, to reset the attempt count.
19+
/// Call ``registerIncorrectBehavior(presentAfterSeconds:action:)``
20+
/// when a user doesn't behave as intended, to automatically present a help
21+
/// after a number of attempts. Call ``registerCorrectBehavior()``
22+
/// when the user then behaves as intended, to reset the attempt count. The
23+
/// onboarding can keep being used in case the user forgets.
2324
///
24-
/// Unlike ``Onboarding``, this onboarding will reset itself each time it's
25-
/// presented.
25+
/// Unlike ``Onboarding``, this will reset itself each time it's presented.
2626
open class CorrectBehavior: Delayed {
2727

2828
/// Create a correct behavior onboarding.

Sources/OnboardingKit/OnboardingKit.docc/OnboardingKit.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,17 @@ OnboardingKit is available under the MIT license.
5555

5656
- ``OnboardingFlow``
5757
- ``OnboardingFlowContainer``
58-
- ``OnboardingFlowContainerCenteredContent``
58+
- ``OnboardingFlowCenteredContent``
5959
- ``OnboardingFlowState``
6060

61-
### Flow Views
61+
### Pages
6262

63+
- ``OnboardingPage``
6364
- ``OnboardingPageView``
6465
- ``OnboardingPageViewStyle``
66+
67+
### Slideshows
68+
6569
- ``OnboardingSlideshow``
6670
- ``OnboardingSlideshowConfiguration``
6771
- ``OnboardingSlideshowProgressView``

Sources/OnboardingKit/Flow/OnboardingFlowPage.swift renamed to Sources/OnboardingKit/Pages/OnboardingPage.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// OnboardingFlow+PageInfo.swift
2+
// OnboardingPage.swift
33
// OnboardingKit
44
//
55
// Created by Daniel Saidi on 2022-09-05.
@@ -10,7 +10,7 @@ import Foundation
1010
import SwiftUI
1111

1212
/// This type defines page info for an onboarding page.
13-
public struct OnboardingFlowPage<PageModel>: OnboardingFlow.PageInfoProvider {
13+
public struct OnboardingPage<PageModel>: OnboardingFlow.PageInfoProvider {
1414

1515
/// Create a page info value.
1616
///
@@ -50,7 +50,7 @@ public struct OnboardingFlowPage<PageModel>: OnboardingFlow.PageInfoProvider {
5050
public let totalPageCount: Int
5151
}
5252

53-
public extension OnboardingFlowPage {
53+
public extension OnboardingPage {
5454

5555
/// Whether this page is the first page.
5656
var isFirstPage: Bool {

Sources/OnboardingKit/PageView/OnboardingPageView.swift renamed to Sources/OnboardingKit/Pages/OnboardingPageView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import PageView
1515
/// This view can be used to show a collection of onboarding pages, with support
1616
/// for navigating with swipes, arrow keys, and edge taps.
1717
///
18-
/// This view can be styled with ``SwiftUI/View/onboardingPageViewStyle(_:)``.
19-
public struct OnboardingPageView<PageModel, Page: View>: View {
18+
/// This view can be styled with ``SwiftUICore/View/onboardingPageViewStyle(_:)``.
19+
public struct OnboardingPageView<Model, Page: View>: View {
2020

2121
/// Create an onboarding page view.
2222
///
@@ -25,7 +25,7 @@ public struct OnboardingPageView<PageModel, Page: View>: View {
2525
/// - pageIndex: The current page index.
2626
/// - content: A page builder function.
2727
public init(
28-
pages: [PageModel],
28+
pages: [Model],
2929
pageIndex: Binding<Int>,
3030
@ViewBuilder content: @escaping PageBuilder
3131
) {
@@ -34,10 +34,10 @@ public struct OnboardingPageView<PageModel, Page: View>: View {
3434
self.content = content
3535
}
3636

37-
public typealias PageInfo = OnboardingFlowPage<PageModel>
37+
public typealias PageInfo = OnboardingPage<Model>
3838
public typealias PageBuilder = (PageInfo) -> Page
3939

40-
private let pages: [PageModel]
40+
private let pages: [Model]
4141
private let content: PageBuilder
4242

4343
@Binding
@@ -79,7 +79,7 @@ private extension OnboardingPageView {
7979
}
8080

8181
func content(
82-
for info: EnumeratedSequence<[PageModel]>.Element
82+
for info: EnumeratedSequence<[Model]>.Element
8383
) -> some View {
8484
content(
8585
.init(

0 commit comments

Comments
 (0)