Skip to content

Commit afc154d

Browse files
committed
Update documentation
1 parent e633d31 commit afc154d

13 files changed

+75
-154
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Until then, breaking changes can happen any minor version bump.
1010

1111
This version bumps the package to Swift 6.1 and makes the demo app target iOS 26.
1212

13+
### 💥 Breaking changes
14+
15+
* All deprecated code has been removed.
16+
1317

1418

1519
## 0.8.1

Sources/ScrollKit/Examples/Examples+SpotifyAlbum.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftUI
1010

1111
public extension Examples.Spotify {
1212

13-
/// This model is used by the Spotify previews.
13+
/// This struct represents a Spotify album.
1414
struct Album {
1515

1616
public init(

Sources/ScrollKit/Examples/Examples.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
import Foundation
1010

11-
/// This is a namespace with various examples on how you can
12-
/// use this library to achieve certain effects.
13-
///
14-
/// For now, only `
11+
/// This is a namespace with various examples on how you can use this library to
12+
/// achieve certain effects.
1513
public struct Examples {}

Sources/ScrollKit/Extensions/View+RoundedScollContent.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ import SwiftUI
1010

1111
public extension View {
1212

13-
/// Make a scroll view's content view overlap the scroll
14-
/// header, by applying a negative offset.
13+
/// Make a scroll view's content view overlap the scroll header by applying a
14+
/// negative offset.
1515
///
16-
/// Do not use this together with a sticky header, since
17-
/// a sticky header will overlap the content, which will
18-
/// ruin this overlap effect.
16+
/// Do not use this together with a sticky header, since such a sticky header
17+
/// will overlap the content, which will ruin this overlap effect.
1918
///
2019
/// - Parameters:
2120
/// - points: The number of points to overlap, by default `10`.
@@ -29,12 +28,11 @@ public extension View {
2928
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
3029
public extension View {
3130

32-
/// Make a scroll view's content view overlap the scroll
33-
/// header with rounded corners.
31+
/// Make a scroll view's content view overlap the scroll header by applying a
32+
/// custom rounded corner edge.
3433
///
35-
/// Do not use this together with a sticky header, since
36-
/// a sticky header will overlap the content, which will
37-
/// ruin this overlap effect.
34+
/// Do not use this together with a sticky header, since such a sticky header
35+
/// will overlap the content, which will ruin this overlap effect.
3836
///
3937
/// - Parameters:
4038
/// - points: The number of points to overlap, by default `10`.
@@ -49,8 +47,8 @@ public extension View {
4947
.scrollViewContentWithHeaderOverlap(overlap)
5048
}
5149

52-
/// Make a scroll view header view apply rounded corners
53-
/// that cut out a mask for the scroll view content view.
50+
/// Make a scroll view's header view apply rounded corners to the view that
51+
/// follows it, by cutting out a mask for the scroll view content view.
5452
///
5553
/// - Parameters:
5654
/// - cornerRadius: The number of points to overlap, by default `0`.

Sources/ScrollKit/Helpers/ScrollManager.swift

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,20 @@
88

99
import SwiftUI
1010

11-
/// This class can be used for programmatic scrolling within
12-
/// a scroll view.
11+
/// This class can be used for programmatic scrolling within a scroll view.
1312
///
14-
/// This class can be used to scroll to any specific part of
15-
/// a scroll view (e.g. the header or the main content) with
16-
/// a `ScrollViewProxy`. Simply add a ``ScrollTarget`` ID to
17-
/// your scroll view's header view and content then call any
18-
/// manager instance's ``setProxy(_:)`` with the scroll view
19-
/// proxy from any scroll view reader in your view.
13+
/// This manager can be used to scroll to a specific part of a scroll view's content,
14+
/// like the header view, or the main content view, usinc a `ScrollViewProxy`.
2015
///
21-
/// Once everything's done, you can use ``scroll(to:anchor:)``
22-
/// to scroll to any defined targets within your scroll view.
16+
/// To use this, simply add a ``ScrollTarget`` ID to your scroll view's header
17+
/// view and content then call any manager instance's ``setProxy(_:)`` with
18+
/// the scroll view proxy from any scroll view reader in your view.
2319
///
24-
/// The ``ScrollViewWithStickyHeader`` has support for using
25-
/// this manager, but you can add it to any custom view.
20+
/// You can then use ``scroll(to:anchor:)`` to scroll to any targets within
21+
/// your scroll view's content view.
2622
///
27-
/// - Important: The manager uses a `ScrollViewReader` under
28-
/// the hood, so yoyr scroll view must apply valid `.id(...)`
29-
/// values to the header and content.
23+
/// > Important: The scroll manager uses a `ScrollViewReader`, so the scroll
24+
/// view must apply valid `.id(...)` values to the header and its content.
3025
public class ScrollManager {
3126

3227
/// Creates a new scroll manager instance.

Sources/ScrollKit/Helpers/ScrollViewOffsetTracker.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
import SwiftUI
1010

11-
/// This view can wrap any `ScrollView` or `List` content to
12-
/// get offset tracking working when the view is scrolled.
11+
/// This view can be used as to the content view of a `ScrollView` or a `List`
12+
/// to be able to get the scroll offset as the view is scrolled.
1313
///
14-
/// To use this view, add it within a `ScrollView` or `List`,
15-
/// then apply ``SwiftUI/View/scrollViewOffsetTracking(action:)``
14+
/// To use this view, just add it as the main content view in a `ScrollView` or a
15+
/// `List`, then apply ``SwiftUI/View/scrollViewOffsetTracking(action:)``
1616
/// to the parent view, like this:
1717
///
1818
/// ```swift
@@ -29,8 +29,7 @@ import SwiftUI
2929
/// }
3030
/// ```
3131
///
32-
/// The offset action will trigger when the list scrolls and
33-
/// provide you with the scroll offset.
32+
/// The offset action will be called with the scroll offset whenever the view scrolls.
3433
public struct ScrollViewOffsetTracker<Content: View>: View {
3534

3635
public init(
@@ -59,9 +58,8 @@ public struct ScrollViewOffsetTracker<Content: View>: View {
5958

6059
public extension View {
6160

62-
/// Add this modifier to a `ScrollView`, a `List` or any
63-
/// view that has a ``ScrollViewOffsetTracker`` to track
64-
/// its scroll offset.
61+
/// Add this modifier to a `ScrollView`, a `List` or any view that has a
62+
/// ``ScrollViewOffsetTracker`` to track its scroll offset.
6563
func scrollViewOffsetTracking(
6664
action: @escaping @MainActor @Sendable (_ offset: CGPoint) -> Void
6765
) -> some View {

Sources/ScrollKit/ScrollViewHeader.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
import SwiftUI
1010

11-
/// This view can be used as a scroll view header, that will
12-
/// automatically stretch its content when pulled down.
11+
/// This view can be used as a scroll view header, and will automatically stretch its
12+
/// content when pulled down.
1313
///
14-
/// For instance, this creates a header view with a gradient
15-
/// background, a gradient overlay and a bottom-leading text:
14+
/// For instance, this would create a scroll view header with a gradient background,
15+
/// a gradient overlay and a bottom-leading text:
1616
///
1717
/// ```swift
1818
/// struct MyHeader: View {
@@ -38,8 +38,8 @@ import SwiftUI
3838
/// }
3939
/// ```
4040
///
41-
/// To add the view to a scroll view with more content below
42-
/// the header, just add the header topmost in a `VStack`:
41+
/// To add this view to a scroll view with more content below the header view, just
42+
/// add the header topmost in a `VStack`:
4343
///
4444
/// ```swift
4545
/// ScrollView(.vertical) {
@@ -50,8 +50,7 @@ import SwiftUI
5050
/// }
5151
/// ```
5252
///
53-
/// Your header view will now automatically stretch out when
54-
/// the scroll view is pulled down.
53+
/// Your header view will automatically stretch when the scroll view is pulled down.
5554
public struct ScrollViewHeader<Content: View>: View {
5655

5756
/// Create a stretchable scroll view header.

Sources/ScrollKit/ScrollViewHeaderGradient.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
import SwiftUI
1010

11-
/// This view can be used as a header view overlay, when the
12-
/// background may cause the content to be hard to overview.
11+
/// This view can be used as an additional background to a header view, when the
12+
/// original background may cause the content to be hard to overview.
1313
///
14-
/// This is basically just a convenience, to avoid having to
15-
/// use a `LinearGradient` from scratch.
14+
/// This is a convenience, to avoid creating a `LinearGradient` from scratch.
1615
public struct ScrollViewHeaderGradient: View {
1716

1817
/// Create a scroll view header gradient.

Sources/ScrollKit/ScrollViewHeaderImage.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
import SwiftUI
1010

11-
/// This view takes any image and adjusts it to be presented
12-
/// as a scroll view header.
11+
/// This view takes any image and adjusts it to be used as a scroll view header.
1312
///
14-
/// This view makes sure that your image stretches correctly
15-
/// and that it clips to the available space.
13+
/// The view will automatically stretch correctly and clip to the available space.
1614
public struct ScrollViewHeaderImage: View {
1715

1816
/// Create a scroll view header image.

Sources/ScrollKit/ScrollViewWithOffsetTracking.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
import SwiftUI
1010

11-
/// This view wraps a native scroll view, and will track its
12-
/// scroll offset as it's scrolled.
11+
/// This view wraps a native scroll view and track its scroll offset as it's scrolled.
1312
///
14-
/// You can use the `onScroll` init parameter to pass in any
15-
/// function that should be called whenever the view scrolls.
13+
/// You can use the `onScroll` init parameter to pass in a function that should
14+
/// be called whenever the view scrolls.
1615
public struct ScrollViewWithOffsetTracking<Content: View>: View {
1716

1817
/// Create a scroll view with offset tracking.

0 commit comments

Comments
 (0)