Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ac39182

Browse files
committedMay 9, 2025
Merge branch 'main' into separate-libraries
2 parents cc313c1 + d94fdbf commit ac39182

File tree

6 files changed

+90
-90
lines changed

6 files changed

+90
-90
lines changed
 

‎Examples/Demo/Demo/AppState.swift

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,54 @@ final class AppState: ObservableObject {
1818
var description: String {
1919
switch self {
2020
case .default:
21-
return "Default"
21+
"Default"
2222
case .crossFade:
23-
return "Fade"
23+
"Fade"
2424
case .slide:
25-
return "Slide"
25+
"Slide"
2626
case .slideVertically:
27-
return "Slide Vertically"
27+
"Slide Vertically"
2828
case .slideAndFadeIn:
29-
return "Slide + Fade In"
29+
"Slide + Fade In"
3030
case .slideAndFadeOut:
31-
return "Slide + Fade Out"
31+
"Slide + Fade Out"
3232
case .flip:
33-
return "Flip"
33+
"Flip"
3434
case .flipVertically:
35-
return "Flip Vertically"
35+
"Flip Vertically"
3636
case .swing:
37-
return "Swing"
37+
"Swing"
3838
case .zoom:
39-
return "Zoom"
39+
"Zoom"
4040
case .zoomAndSlide:
41-
return "Zoom + Slide"
41+
"Zoom + Slide"
4242
}
4343
}
4444

4545
func callAsFunction() -> AnyNavigationTransition {
4646
switch self {
4747
case .default:
48-
return .default
48+
.default
4949
case .crossFade:
50-
return .fade(.cross)
50+
.fade(.cross)
5151
case .slide:
52-
return .slide
52+
.slide
5353
case .slideVertically:
54-
return .slide(axis: .vertical)
54+
.slide(axis: .vertical)
5555
case .slideAndFadeIn:
56-
return .slide.combined(with: .fade(.in))
56+
.slide.combined(with: .fade(.in))
5757
case .slideAndFadeOut:
58-
return .slide.combined(with: .fade(.out))
58+
.slide.combined(with: .fade(.out))
5959
case .flip:
60-
return .flip
60+
.flip
6161
case .flipVertically:
62-
return .flip(axis: .vertical)
62+
.flip(axis: .vertical)
6363
case .swing:
64-
return .swing
64+
.swing
6565
case .zoom:
66-
return .zoom
66+
.zoom
6767
case .zoomAndSlide:
68-
return .zoom.combined(with: .slide)
68+
.zoom.combined(with: .slide)
6969
}
7070
}
7171
}
@@ -79,13 +79,13 @@ final class AppState: ObservableObject {
7979
var description: String {
8080
switch self {
8181
case .none:
82-
return "None"
82+
"None"
8383
case .linear:
84-
return "Linear"
84+
"Linear"
8585
case .easeInOut:
86-
return "Ease In Out"
86+
"Ease In Out"
8787
case .spring:
88-
return "Spring"
88+
"Spring"
8989
}
9090
}
9191

@@ -96,13 +96,13 @@ final class AppState: ObservableObject {
9696
) -> AnyNavigationTransition.Animation? {
9797
switch self {
9898
case .none:
99-
return .none
99+
.none
100100
case .linear:
101-
return .linear(duration: duration())
101+
.linear(duration: duration())
102102
case .easeInOut:
103-
return .easeInOut(duration: duration())
103+
.easeInOut(duration: duration())
104104
case .spring:
105-
return .interpolatingSpring(stiffness: stiffness(), damping: damping())
105+
.interpolatingSpring(stiffness: stiffness(), damping: damping())
106106
}
107107
}
108108
}
@@ -115,22 +115,22 @@ final class AppState: ObservableObject {
115115
var description: String {
116116
switch self {
117117
case .slow:
118-
return "Slow"
118+
"Slow"
119119
case .medium:
120-
return "Medium"
120+
"Medium"
121121
case .fast:
122-
return "Fast"
122+
"Fast"
123123
}
124124
}
125125

126126
func callAsFunction() -> Double {
127127
switch self {
128128
case .slow:
129-
return 1
129+
1
130130
case .medium:
131-
return 0.6
131+
0.6
132132
case .fast:
133-
return 0.35
133+
0.35
134134
}
135135
}
136136
}
@@ -143,22 +143,22 @@ final class AppState: ObservableObject {
143143
var description: String {
144144
switch self {
145145
case .low:
146-
return "Low"
146+
"Low"
147147
case .medium:
148-
return "Medium"
148+
"Medium"
149149
case .high:
150-
return "High"
150+
"High"
151151
}
152152
}
153153

154154
func callAsFunction() -> Double {
155155
switch self {
156156
case .low:
157-
return 300
157+
300
158158
case .medium:
159-
return 120
159+
120
160160
case .high:
161-
return 50
161+
50
162162
}
163163
}
164164
}
@@ -172,26 +172,26 @@ final class AppState: ObservableObject {
172172
var description: String {
173173
switch self {
174174
case .low:
175-
return "Low"
175+
"Low"
176176
case .medium:
177-
return "Medium"
177+
"Medium"
178178
case .high:
179-
return "High"
179+
"High"
180180
case .veryHigh:
181-
return "Very High"
181+
"Very High"
182182
}
183183
}
184184

185185
func callAsFunction() -> Double {
186186
switch self {
187187
case .low:
188-
return 20
188+
20
189189
case .medium:
190-
return 25
190+
25
191191
case .high:
192-
return 30
192+
30
193193
case .veryHigh:
194-
return 50
194+
50
195195
}
196196
}
197197
}
@@ -204,22 +204,22 @@ final class AppState: ObservableObject {
204204
var description: String {
205205
switch self {
206206
case .disabled:
207-
return "Disabled"
207+
"Disabled"
208208
case .edgePan:
209-
return "Edge Pan"
209+
"Edge Pan"
210210
case .pan:
211-
return "Pan"
211+
"Pan"
212212
}
213213
}
214214

215215
func callAsFunction() -> AnyNavigationTransition.Interactivity {
216216
switch self {
217217
case .disabled:
218-
return .disabled
218+
.disabled
219219
case .edgePan:
220-
return .edgePan
220+
.edgePan
221221
case .pan:
222-
return .pan
222+
.pan
223223
}
224224
}
225225
}

‎Sources/AtomicTransition/AtomicTransitionBuilder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public enum AtomicTransitionBuilder {
1414

1515
public static func buildOptional<T: AtomicTransition>(_ component: T?) -> _OptionalTransition<T> {
1616
if let component {
17-
return _OptionalTransition(component)
17+
_OptionalTransition(component)
1818
} else {
19-
return _OptionalTransition(nil)
19+
_OptionalTransition(nil)
2020
}
2121
}
2222

@@ -76,9 +76,9 @@ extension _ConditionalTransition: MirrorableAtomicTransition where TrueTransitio
7676
public func mirrored() -> _ConditionalTransition<TrueTransition.Mirrored, FalseTransition.Mirrored> {
7777
switch transition {
7878
case .left(let trueTransition):
79-
return .init(trueTransition: trueTransition.mirrored())
79+
.init(trueTransition: trueTransition.mirrored())
8080
case .right(let falseTransition):
81-
return .init(falseTransition: falseTransition.mirrored())
81+
.init(falseTransition: falseTransition.mirrored())
8282
}
8383
}
8484
}

‎Sources/AtomicTransition/Move.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ public struct Move: MirrorableAtomicTransition {
4747
public func mirrored() -> Move {
4848
switch edge {
4949
case .top:
50-
return .init(edge: .bottom)
50+
.init(edge: .bottom)
5151
case .leading:
52-
return .init(edge: .trailing)
52+
.init(edge: .trailing)
5353
case .bottom:
54-
return .init(edge: .top)
54+
.init(edge: .top)
5555
case .trailing:
56-
return .init(edge: .leading)
56+
.init(edge: .leading)
5757
}
5858
}
5959
}

‎Sources/NavigationTransition/NavigationTransitionBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public enum NavigationTransitionBuilder {
1010

1111
public static func buildOptional<T: NavigationTransitionProtocol>(_ component: T?) -> _OptionalTransition<T> {
1212
if let component {
13-
return _OptionalTransition(component)
13+
_OptionalTransition(component)
1414
} else {
15-
return _OptionalTransition(nil)
15+
_OptionalTransition(nil)
1616
}
1717
}
1818

‎Sources/SwiftUINavigationTransitions/NavigationTransition+UIKit.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,56 +56,56 @@ extension UISplitViewController {
5656
extension UISplitViewController {
5757
var compactViewController: UIViewController? {
5858
if #available(iOS 14, tvOS 14, *) {
59-
return viewController(for: .compact)
59+
viewController(for: .compact)
6060
} else {
6161
if isCollapsed {
62-
return viewControllers.first
62+
viewControllers.first
6363
} else {
64-
return nil
64+
nil
6565
}
6666
}
6767
}
6868

6969
var primaryViewController: UIViewController? {
7070
if #available(iOS 14, tvOS 14, *) {
71-
return viewController(for: .primary)
71+
viewController(for: .primary)
7272
} else {
7373
if !isCollapsed {
74-
return viewControllers.first
74+
viewControllers.first
7575
} else {
76-
return nil
76+
nil
7777
}
7878
}
7979
}
8080

8181
var supplementaryViewController: UIViewController? {
8282
if #available(iOS 14, tvOS 14, *) {
83-
return viewController(for: .supplementary)
83+
viewController(for: .supplementary)
8484
} else {
8585
if !isCollapsed {
8686
if viewControllers.count >= 3 {
87-
return viewControllers[safe: 1]
87+
viewControllers[safe: 1]
8888
} else {
89-
return nil
89+
nil
9090
}
9191
} else {
92-
return nil
92+
nil
9393
}
9494
}
9595
}
9696

9797
var secondaryViewController: UIViewController? {
9898
if #available(iOS 14, tvOS 14, *) {
99-
return viewController(for: .secondary)
99+
viewController(for: .secondary)
100100
} else {
101101
if !isCollapsed {
102102
if viewControllers.count >= 3 {
103-
return viewControllers[safe: 2]
103+
viewControllers[safe: 2]
104104
} else {
105-
return viewControllers[safe: 1]
105+
viewControllers[safe: 1]
106106
}
107107
} else {
108-
return nil
108+
nil
109109
}
110110
}
111111
}
@@ -256,25 +256,25 @@ extension UINavigationController {
256256

257257
@objc private func popViewController_animateIfNeeded(animated: Bool) -> UIViewController? {
258258
if let transitionDelegate = customDelegate {
259-
return popViewController_animateIfNeeded(animated: transitionDelegate.transition.animation != nil)
259+
popViewController_animateIfNeeded(animated: transitionDelegate.transition.animation != nil)
260260
} else {
261-
return popViewController_animateIfNeeded(animated: animated)
261+
popViewController_animateIfNeeded(animated: animated)
262262
}
263263
}
264264

265265
@objc private func popToViewController_animateIfNeeded(_ viewController: UIViewController, animated: Bool) -> [UIViewController]? {
266266
if let transitionDelegate = customDelegate {
267-
return popToViewController_animateIfNeeded(viewController, animated: transitionDelegate.transition.animation != nil)
267+
popToViewController_animateIfNeeded(viewController, animated: transitionDelegate.transition.animation != nil)
268268
} else {
269-
return popToViewController_animateIfNeeded(viewController, animated: animated)
269+
popToViewController_animateIfNeeded(viewController, animated: animated)
270270
}
271271
}
272272

273273
@objc private func popToRootViewController_animateIfNeeded(animated: Bool) -> UIViewController? {
274274
if let transitionDelegate = customDelegate {
275-
return popToRootViewController_animateIfNeeded(animated: transitionDelegate.transition.animation != nil)
275+
popToRootViewController_animateIfNeeded(animated: transitionDelegate.transition.animation != nil)
276276
} else {
277-
return popToRootViewController_animateIfNeeded(animated: animated)
277+
popToRootViewController_animateIfNeeded(animated: animated)
278278
}
279279
}
280280
}

0 commit comments

Comments
 (0)