Skip to content

Commit 0fe0817

Browse files
authored
Merge pull request #46 from CSolanaM/develop
[SU-RELEASE] 2.0.0
2 parents e3cf87c + 151ef8c commit 0fe0817

File tree

195 files changed

+227
-987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+227
-987
lines changed

Diff for: .github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: push
33
jobs:
44
build:
55
name: build
6-
runs-on: macOS-11
6+
runs-on: macOS-12
77
steps:
88
- name: checkout
99
uses: actions/checkout@master

Diff for: .github/workflows/test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ on: push
33
jobs:
44
build:
55
name: test
6-
runs-on: macOS-11
6+
runs-on: macOS-12
77
steps:
88
- name: checkout
99
uses: actions/checkout@master
1010
- name: swift test
1111
run: |
1212
# TODO: @CSolanaM macOS tests not passing because CI screen scale factor is 1, local is 2
1313
# xcodebuild test -destination platform="macOS" -scheme "SkeletonUISnapshotTests"
14-
xcodebuild test -destination name="Apple TV" -scheme "SkeletonUISnapshotTests"
15-
xcodebuild test -destination name="Apple TV 4K (2nd generation)" -scheme "SkeletonUISnapshotTests"
14+
# xcodebuild test -destination name="Apple TV" -scheme "SkeletonUISnapshotTests"
15+
# xcodebuild test -destination name="Apple TV 4K (3rd generation)" -scheme "SkeletonUISnapshotTests"
1616
xcodebuild test -destination name="iPhone 8" -scheme "SkeletonUISnapshotTests"
17-
xcodebuild test -destination name="iPhone 13 Pro Max" -scheme "SkeletonUISnapshotTests"
18-
xcodebuild test -destination name="iPad Pro (12.9-inch) (5th generation)" -scheme "SkeletonUISnapshotTests"
17+
xcodebuild test -destination name="iPhone 14 Pro Max" -scheme "SkeletonUISnapshotTests"
18+
xcodebuild test -destination name="iPad Pro (12.9-inch) (6th generation)" -scheme "SkeletonUISnapshotTests"

Diff for: CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [2.0.0](https://github.com/CSolanaM/SkeletonUI/releases/tag/2.0.0)
5+
### Added
6+
-
7+
### Changed
8+
- Refactored old codebase to meet current SwiftUI standards. No Combine needed anymore!
9+
### Removed
10+
-
11+
### Fixed
12+
- Animations now use AnimatableModifier, improving performance and reliability
13+
414
## [1.0.11](https://github.com/CSolanaM/SkeletonUI/releases/tag/1.0.11)
515
### Added
616
-

Diff for: Examples/SkeletonUI-macOS-iOS/SkeletonUI-macOS-iOS/Views/CharacterView.swift

+2-9
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,11 @@ struct CharacterView: View {
1616
HStack {
1717
Image(uiImage: UIImage(data: imageViewModel.data))
1818
.resizable()
19-
.skeleton(with: loading)
20-
.shape(type: .circle)
21-
.appearance(type: .gradient())
22-
.animation(type: .linear())
19+
.skeleton(with: loading, animation: .linear(), appearance: .gradient(.radial), shape: .circle)
2320
.frame(width: 100, height: 100)
2421
.clipShape(Circle())
2522
Text(character?.name)
26-
.skeleton(with: loading)
27-
.shape(type: .capsule)
28-
.multiline(lines: 3, scales: [1: 0.5, 2: 0.25])
29-
.appearance(type: .gradient())
30-
.animation(type: .linear())
23+
.skeleton(with: loading, animation: .linear(), appearance: .gradient(), shape: .capsule, lines: 3, scales: [1: 0.5, 2: 0.25])
3124
}
3225
}
3326
}

Diff for: Examples/SkeletonUI.xcworkspace/xcshareddata/swiftpm/Package.resolved

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"object": {
33
"pins": [
44
{
5-
"package": "SnapshotTesting",
5+
"package": "swift-snapshot-testing",
66
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing",
77
"state": {
88
"branch": null,
9-
"revision": "f8a9c997c3c1dab4e216a8ec9014e23144cbab37",
10-
"version": "1.9.0"
9+
"revision": "dc46eeb3928a75390651fac6c1ef7f93ad59a73b",
10+
"version": "1.11.1"
1111
}
1212
}
1313
]

Diff for: Package.resolved

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"object": {
33
"pins": [
44
{
5-
"package": "SnapshotTesting",
5+
"package": "swift-snapshot-testing",
66
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing",
77
"state": {
88
"branch": null,
9-
"revision": "f8a9c997c3c1dab4e216a8ec9014e23144cbab37",
10-
"version": "1.9.0"
9+
"revision": "dc46eeb3928a75390651fac6c1ef7f93ad59a73b",
10+
"version": "1.11.1"
1111
}
1212
}
1313
]

Diff for: Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
)
1818
],
1919
dependencies: [
20-
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.9.0")
20+
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.11.1")
2121
],
2222
targets: [
2323
.target(

Diff for: README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ struct UsersView: View {
9595
var body: some View {
9696
SkeletonList(with: users, quantity: 6) { loading, user in
9797
Text(user?.name)
98-
.skeleton(with: loading)
99-
.shape(type: .rectangle)
100-
.appearance(type: .solid(color: .red, background: .blue))
101-
.multiline(lines: 3, scales: [1: 0.5])
102-
.animation(type: .pulse())
98+
.skeleton(with: loading,
99+
animation: .pulse(),
100+
appearance: .solid(color: .red, background: .blue),
101+
shape: .rectangle,
102+
lines: 3,
103+
scales: [1: 0.5])
103104
}
104105
.onAppear {
105106
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {

Diff for: Scripts/regenerate-mocks

-14
This file was deleted.

Diff for: Scripts/run-snapshot-tests

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ readonly root_directory=`"${scripts_path}/repository-root-path"`
1111
cd "${root_directory}"
1212

1313
xcodebuild test -destination name="Apple TV" -scheme "SkeletonUISnapshotTests"
14-
xcodebuild test -destination name="Apple TV 4K (2nd generation)" -scheme "SkeletonUISnapshotTests"
14+
xcodebuild test -destination name="Apple TV 4K (3rd generation)" -scheme "SkeletonUISnapshotTests"
1515
xcodebuild test -destination name="iPhone 8" -scheme "SkeletonUISnapshotTests"
16-
xcodebuild test -destination name="iPhone 13 Pro Max" -scheme "SkeletonUISnapshotTests"
17-
xcodebuild test -destination name="iPad Pro (12.9-inch) (5th generation)" -scheme "SkeletonUISnapshotTests"
16+
xcodebuild test -destination name="iPhone 14 Pro Max" -scheme "SkeletonUISnapshotTests"
17+
xcodebuild test -destination name="iPad Pro (12.9-inch) (6th generation)" -scheme "SkeletonUISnapshotTests"

Diff for: SkeletonUI.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'SkeletonUI'
3-
s.version = '1.0.11'
3+
s.version = '2.0.0'
44
s.summary = 'Elegant skeleton loading animation in SwiftUI and Combine'
55
s.description = <<-DESC
66
SkeletonUI aims to bring an elegant, declarative syntax to skeleton loading animations. Get rid of loading screens or spinners and start using skeletons to represent final content shapes

Diff for: Sources/SkeletonUI/Angle/AngleInteractor.swift

-29
This file was deleted.

Diff for: Sources/SkeletonUI/Angle/AnglePresenter.swift

-7
This file was deleted.

Diff for: Sources/SkeletonUI/Animation/AnimationInteractor.swift

-56
This file was deleted.

Diff for: Sources/SkeletonUI/Appearance/AppearanceInteractor.swift

-58
This file was deleted.

Diff for: Sources/SkeletonUI/Appearance/AppearancePresenter.swift

-5
This file was deleted.

Diff for: Sources/SkeletonUI/Enumerations/AnimationType.swift

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import SwiftUI
2+
3+
public enum AnimationType: Equatable {
4+
case none
5+
case pulse(duration: Double = 1.5, delay: Double = .zero, speed: Double = 1, autoreverses: Bool = true)
6+
case linear(duration: Double = 1.5, delay: Double = .zero, speed: Double = 1, autoreverses: Bool = false)
7+
8+
var type: Animation? {
9+
switch self {
10+
case .none:
11+
return .none
12+
case let .pulse(duration, delay, speed, autoreverses):
13+
return Animation.easeIn(duration: duration).delay(delay).speed(speed).repeatForever(autoreverses: autoreverses)
14+
case let .linear(duration, delay, speed, autoreverses):
15+
return Animation.easeInOut(duration: duration).delay(delay).speed(speed).repeatForever(autoreverses: autoreverses)
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)