Skip to content

Commit 4b456bb

Browse files
committed
Deprecate dot loading views
1 parent ca5d34c commit 4b456bb

File tree

4 files changed

+13
-52
lines changed

4 files changed

+13
-52
lines changed

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ SwiftUIKit makes its best effort to honor semver, but breaking changes can occur
44

55

66

7+
## 5.9.4
8+
9+
This version deprecates the `DotLoading` views.
10+
11+
12+
713
## 5.9.3
814

915
This version makes image rotation available to all UIKit platforms.

Sources/SwiftUIKit/SwiftUIKit.docc/SwiftUIKit.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ SwiftUIKit is available under the MIT license.
9090
- ``KeychainService``
9191
- ``KeychainWrapper``
9292

93-
### Loading
94-
95-
- ``DotLoadingAnimation``
96-
- ``DotLoadingAnimationText``
97-
9893
### Lists
9994

10095
- ``ListButtonGroup``
@@ -125,11 +120,6 @@ SwiftUIKit is available under the MIT license.
125120

126121
- ``SwiftUIPreviewInspector``
127122

128-
### Progress
129-
130-
- ``CircularProgressBar``
131-
- ``LinearProgressBar``
132-
133123
### Regex
134124

135125
- ``ValidationRegex``

Sources/SwiftUIKit/Loading/DotLoadingAnimation.swift renamed to Sources/SwiftUIKit/_Deprecated/DotLoadingAnimation.swift

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
import Combine
1010
import SwiftUI
1111

12-
/// This animation can be used to render dots, where a timer
13-
/// increments the number of presented dots.
14-
///
15-
/// The view just renders plain text, so you can style it as
16-
/// you would any other text.
17-
///
18-
/// You can use ``DotLoadingAnimationText`` to present texts
19-
/// with the dot animation playing after the text.
12+
@available(*, deprecated, message: "Use SF Symbols instead. See https://danielsaidi.com/blog/2025/06/19/creating-amazing-loading-animations-with-sf-symbols for more information.")
2013
public struct DotLoadingAnimation: View {
2114

2215
/// Create a dot animation.
@@ -43,32 +36,21 @@ public struct DotLoadingAnimation: View {
4336
Text(dotText)
4437
.onReceive(timer) { _ in increaseDotCount() }
4538
}
46-
}
47-
48-
private extension DotLoadingAnimation {
4939

50-
var dotText: String {
40+
private var dotText: String {
5141
if currentDotCount == 0 {
5242
return ""
5343
}
5444
return (0..<currentDotCount)
5545
.map { _ in "." }
5646
.joined(separator: "")
5747
}
58-
}
59-
60-
private extension DotLoadingAnimation {
6148

62-
func increaseDotCount() {
49+
private func increaseDotCount() {
6350
var newCount = currentDotCount + 1
6451
if newCount > dotCount {
6552
newCount = 0
6653
}
6754
currentDotCount = newCount
6855
}
6956
}
70-
71-
#Preview {
72-
73-
DotLoadingAnimation()
74-
}

Sources/SwiftUIKit/Loading/DotLoadingAnimationText.swift renamed to Sources/SwiftUIKit/_Deprecated/DotLoadingAnimationText.swift

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

99
import SwiftUI
1010

11-
/**
12-
This view adds a ``DotLoadingAnimation`` after the provided
13-
`text`, to indicate a loading state.
14-
15-
The view just renders plain text, so you can style the text
16-
just like you would any other text.
17-
*/
11+
@available(*, deprecated, message: "Use SF Symbols instead. See https://danielsaidi.com/blog/2025/06/19/creating-amazing-loading-animations-with-sf-symbols for more information.")
1812
public struct DotLoadingAnimationText: View {
1913

2014
/// Create a dot animation text.
@@ -49,35 +43,24 @@ public struct DotLoadingAnimationText: View {
4943
.opacity(0)
5044
.overlay(titleAnimation, alignment: .leading)
5145
}
52-
}
53-
54-
private extension DotLoadingAnimationText {
5546

56-
var dotAnimation: some View {
47+
private var dotAnimation: some View {
5748
DotLoadingAnimation(
5849
dotCount: dotCount,
5950
interval: interval
6051
)
6152
}
6253

63-
var staticDotString: String {
54+
private var staticDotString: String {
6455
(0..<dotCount)
6556
.map { _ in "." }
6657
.joined(separator: "")
6758
}
6859

69-
var titleAnimation: some View {
60+
private var titleAnimation: some View {
7061
HStack(spacing: 0) {
7162
Text(text)
7263
dotAnimation
7364
}
7465
}
7566
}
76-
77-
#Preview {
78-
79-
DotLoadingAnimationText(
80-
text: "Preview.LoadingNoDots",
81-
bundle: .module
82-
)
83-
}

0 commit comments

Comments
 (0)