Skip to content

Commit 5e1cdc8

Browse files
authored
Separate into SwiftUI and UIKit specific libraries (#150)
1 parent d94fdbf commit 5e1cdc8

File tree

26 files changed

+79
-55
lines changed

26 files changed

+79
-55
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ jobs:
3939
platform: ${{ matrix.platform }}
4040
swift: ~${{ matrix.swift }}
4141
action: test
42-
scheme: NavigationTransitions
42+
workspace: SwiftUINavigationTransitions.xcworkspace
43+
scheme: SwiftUINavigationTransitions
4344

4445
- name: Build Examples/Demo
4546
uses: mxcl/xcodebuild@v3
4647
with:
4748
platform: ${{ matrix.platform }}
4849
swift: ~${{ matrix.swift }}
4950
action: build
51+
workspace: SwiftUINavigationTransitions.xcworkspace
5052
scheme: Demo

.spi.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 1
22
builder:
33
configs:
4-
- platform: ios
5-
scheme: NavigationTransitions
6-
documentation_targets: [NavigationTransitions]
7-
custom_documentation_parameters: [--include-extended-types]
8-
- platform: tvos
9-
scheme: NavigationTransitions
4+
- platform: ios
5+
scheme: SwiftUINavigationTransitions
6+
documentation_targets: [SwiftUINavigationTransitions]
7+
custom_documentation_parameters: [--include-extended-types]
8+
- platform: tvos
9+
scheme: SwiftUINavigationTransitions

Examples/Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
D52A95512DCEC08F00885069 /* SwiftUINavigationTransitions in Frameworks */ = {isa = PBXBuildFile; productRef = D52A95502DCEC08F00885069 /* SwiftUINavigationTransitions */; };
1011
D5535823290E9692009E5D72 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D5535822290E9692009E5D72 /* Assets.xcassets */; };
1112
D5535826290E9692009E5D72 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D5535825290E9692009E5D72 /* Preview Assets.xcassets */; };
1213
D5535834290E9718009E5D72 /* Swing.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553582C290E9718009E5D72 /* Swing.swift */; };
1314
D5535835290E9718009E5D72 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553582D290E9718009E5D72 /* RootView.swift */; };
1415
D5535836290E9718009E5D72 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553582E290E9718009E5D72 /* SceneDelegate.swift */; };
1516
D5535837290E9718009E5D72 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D553582F290E9718009E5D72 /* LaunchScreen.storyboard */; platformFilter = ios; };
1617
D5535839290E9718009E5D72 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5535831290E9718009E5D72 /* AppDelegate.swift */; };
17-
D553583F290E97C5009E5D72 /* NavigationTransitions in Frameworks */ = {isa = PBXBuildFile; productRef = D553583E290E97C5009E5D72 /* NavigationTransitions */; };
1818
D5535843290F4BEA009E5D72 /* AppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5535842290F4BEA009E5D72 /* AppView.swift */; };
1919
D5535845290F52F7009E5D72 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5535844290F52F7009E5D72 /* SettingsView.swift */; };
2020
D5535847290F5E6F009E5D72 /* AppState.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5535846290F5E6F009E5D72 /* AppState.swift */; };
@@ -49,7 +49,7 @@
4949
isa = PBXFrameworksBuildPhase;
5050
buildActionMask = 2147483647;
5151
files = (
52-
D553583F290E97C5009E5D72 /* NavigationTransitions in Frameworks */,
52+
D52A95512DCEC08F00885069 /* SwiftUINavigationTransitions in Frameworks */,
5353
);
5454
runOnlyForDeploymentPostprocessing = 0;
5555
};
@@ -136,7 +136,7 @@
136136
);
137137
name = Demo;
138138
packageProductDependencies = (
139-
D553583E290E97C5009E5D72 /* NavigationTransitions */,
139+
D52A95502DCEC08F00885069 /* SwiftUINavigationTransitions */,
140140
);
141141
productName = Demo;
142142
productReference = D553581B290E9691009E5D72 /* Demo.app */;
@@ -150,7 +150,7 @@
150150
attributes = {
151151
BuildIndependentTargetsInParallel = 1;
152152
LastSwiftUpdateCheck = 1410;
153-
LastUpgradeCheck = 1500;
153+
LastUpgradeCheck = 1640;
154154
TargetAttributes = {
155155
D553581A290E9691009E5D72 = {
156156
CreatedOnToolsVersion = 14.1;
@@ -248,6 +248,7 @@
248248
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
249249
COPY_PHASE_STRIP = NO;
250250
DEBUG_INFORMATION_FORMAT = dwarf;
251+
DEVELOPMENT_TEAM = 26CPNYHDUU;
251252
ENABLE_STRICT_OBJC_MSGSEND = YES;
252253
ENABLE_TESTABILITY = YES;
253254
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -311,6 +312,7 @@
311312
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
312313
COPY_PHASE_STRIP = NO;
313314
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
315+
DEVELOPMENT_TEAM = 26CPNYHDUU;
314316
ENABLE_NS_ASSERTIONS = NO;
315317
ENABLE_STRICT_OBJC_MSGSEND = YES;
316318
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -343,7 +345,6 @@
343345
CODE_SIGN_STYLE = Automatic;
344346
CURRENT_PROJECT_VERSION = 1;
345347
DEVELOPMENT_ASSET_PATHS = "\"Demo/Preview Content\"";
346-
DEVELOPMENT_TEAM = 26CPNYHDUU;
347348
ENABLE_PREVIEWS = YES;
348349
GENERATE_INFOPLIST_FILE = YES;
349350
INFOPLIST_FILE = Demo/Info.plist;
@@ -381,7 +382,6 @@
381382
CODE_SIGN_STYLE = Automatic;
382383
CURRENT_PROJECT_VERSION = 1;
383384
DEVELOPMENT_ASSET_PATHS = "\"Demo/Preview Content\"";
384-
DEVELOPMENT_TEAM = 26CPNYHDUU;
385385
ENABLE_PREVIEWS = YES;
386386
GENERATE_INFOPLIST_FILE = YES;
387387
INFOPLIST_FILE = Demo/Info.plist;
@@ -432,9 +432,9 @@
432432
/* End XCConfigurationList section */
433433

434434
/* Begin XCSwiftPackageProductDependency section */
435-
D553583E290E97C5009E5D72 /* NavigationTransitions */ = {
435+
D52A95502DCEC08F00885069 /* SwiftUINavigationTransitions */ = {
436436
isa = XCSwiftPackageProductDependency;
437-
productName = NavigationTransitions;
437+
productName = SwiftUINavigationTransitions;
438438
};
439439
/* End XCSwiftPackageProductDependency section */
440440
};

Examples/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1500"
3+
LastUpgradeVersion = "1640"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Examples/Demo/Demo/AppState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import NavigationTransitions
2+
import SwiftUINavigationTransitions
33

44
final class AppState: ObservableObject {
55
enum Transition: CaseIterable, CustomStringConvertible, Hashable {

Examples/Demo/Demo/Pages.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33
struct PageOne: View {
44
var body: some View {
55
let content = Group {
6-
Text("**NavigationTransitions** is a library that integrates seamlessly with SwiftUI's **Navigation** views, allowing complete customization over **push and pop transitions**!")
6+
Text("**SwiftUINavigationTransitions** is a library that integrates seamlessly with SwiftUI's **Navigation** views, allowing complete customization over **push and pop transitions**!")
77
}
88

99
PageView(number: 1, title: "Welcome", color: .orange) {

Examples/Demo/Demo/RootView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import NavigationTransitions
21
import SwiftUI
2+
import SwiftUINavigationTransitions
33

44
struct RootView: View {
55
@EnvironmentObject var appState: AppState

Examples/Demo/Demo/SettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import NavigationTransitions
21
import SwiftUI
2+
import SwiftUINavigationTransitions
33

44
struct SettingsView: View {
55
@EnvironmentObject var appState: AppState

Package.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ let package = Package(
1010
.tvOS(.v13),
1111
],
1212
products: [
13-
.library(name: "NavigationTransitions", targets: ["NavigationTransitions"]),
13+
.library(name: "SwiftUINavigationTransitions", targets: ["SwiftUINavigationTransitions"]),
14+
.library(name: "UIKitNavigationTransitions", targets: ["UIKitNavigationTransitions"]),
1415
],
1516
targets: [
1617
.target(name: "Animation"),
@@ -35,10 +36,17 @@ let package = Package(
3536
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
3637
]),
3738

38-
.target(name: "NavigationTransitions", dependencies: [
39+
.target(name: "UIKitNavigationTransitions", dependencies: [
3940
"NavigationTransition",
4041
"RuntimeAssociation",
4142
"RuntimeSwizzling",
43+
]),
44+
45+
.target(name: "SwiftUINavigationTransitions", dependencies: [
46+
"NavigationTransition",
47+
"RuntimeAssociation",
48+
"RuntimeSwizzling",
49+
"UIKitNavigationTransitions",
4250
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect"),
4351
]),
4452

@@ -48,7 +56,7 @@ let package = Package(
4856
.target(name: "TestUtils", dependencies: [
4957
.product(name: "CustomDump", package: "swift-custom-dump"),
5058
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
51-
"NavigationTransitions",
59+
"SwiftUINavigationTransitions",
5260
]),
5361
]
5462
)

[email protected]

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ let package = Package(
1010
.tvOS(.v13),
1111
],
1212
products: [
13-
.library(name: "NavigationTransitions", targets: ["NavigationTransitions"]),
13+
.library(name: "SwiftUINavigationTransitions", targets: ["SwiftUINavigationTransitions"]),
14+
.library(name: "UIKitNavigationTransitions", targets: ["UIKitNavigationTransitions"]),
1415
],
1516
targets: [
1617
.target(name: "Animation"),
@@ -35,10 +36,17 @@ let package = Package(
3536
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
3637
]),
3738

38-
.target(name: "NavigationTransitions", dependencies: [
39+
.target(name: "UIKitNavigationTransitions", dependencies: [
3940
"NavigationTransition",
4041
"RuntimeAssociation",
4142
"RuntimeSwizzling",
43+
]),
44+
45+
.target(name: "SwiftUINavigationTransitions", dependencies: [
46+
"NavigationTransition",
47+
"RuntimeAssociation",
48+
"RuntimeSwizzling",
49+
"UIKitNavigationTransitions",
4250
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect"),
4351
]),
4452

@@ -48,7 +56,7 @@ let package = Package(
4856
.target(name: "TestUtils", dependencies: [
4957
.product(name: "CustomDump", package: "swift-custom-dump"),
5058
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
51-
"NavigationTransitions",
59+
"SwiftUINavigationTransitions",
5260
]),
5361
],
5462
swiftLanguageModes: [.v5]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Overview
1717

18-
Instead of reinventing the entire navigation stack just to control its transitions, `NavigationTransitions` ships with a **simple modifier** that can be applied directly to SwiftUI's very own **first-party navigation** components.
18+
Instead of reinventing the entire navigation stack just to control its transitions, this library ships with a **simple modifier** that can be applied directly to SwiftUI's very own **first-party navigation** components.
1919

2020
### The Basics
2121

Sources/NavigationTransitions/Documentation.docc/Articles/Custom Transitions.md renamed to Sources/SwiftUINavigationTransitions/Documentation.docc/Articles/Custom Transitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Next up, let's explore two ways of conforming to `NavigationTransitionProtocol`.
213213

214214
The simplest (and most recommended) way is by declaring our atomic transitions (if needed), and composing them via `var body: some NavigationTransitionProtocol { ... }` like we saw [previously with `Slide`](#NavigationTransitionProtocol).
215215

216-
Check out the [documentation](https://swiftpackageindex.com/davdroman/swiftui-navigation-transitions/0.2.0/documentation/navigationtransitions/NavigationTransitionProtocol) to learn about the different `NavigationTransitionProtocol` types and how they compose.
216+
Check out the [documentation](https://swiftpackageindex.com/davdroman/swiftui-navigation-transitions/main/documentation/swiftuinavigationtransitions/NavigationTransitionProtocol) to learn about the different `NavigationTransitionProtocol` types and how they compose.
217217

218218
The Demo project in the repo is also a great source of learning about different types of custom transitions and the way to implement them.
219219

Sources/NavigationTransitions/NavigationTransition+SwiftUI.swift renamed to Sources/SwiftUINavigationTransitions/SwiftUISupport.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
public import UIKitNavigationTransitions
12
public import SwiftUI
2-
@_spi(Advanced) import SwiftUIIntrospect
3+
@_spi(Advanced) internal import SwiftUIIntrospect
34

45
extension View {
56
@MainActor

Sources/TestUtils/AnimatorTransientView+Mocks.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@testable public import Animator
2-
public import UIKit
2+
internal import UIKit
33
import IssueReporting
44

55
extension AnimatorTransientView {
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public import NavigationTransition
2+
3+
extension AnyNavigationTransition {
4+
public enum Interactivity {
5+
case disabled
6+
case edgePan
7+
case pan
8+
9+
@inlinable
10+
public static var `default`: Self {
11+
.edgePan
12+
}
13+
}
14+
}

Sources/NavigationTransitions/NavigationTransition+UIKit.swift renamed to Sources/UIKitNavigationTransitions/UIKitSupport.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@ import RuntimeAssociation
33
import RuntimeSwizzling
44
public import UIKit
55

6-
extension AnyNavigationTransition {
7-
public enum Interactivity {
8-
case disabled
9-
case edgePan
10-
case pan
11-
12-
@inlinable
13-
public static var `default`: Self {
14-
.edgePan
15-
}
16-
}
17-
}
18-
196
public struct UISplitViewControllerColumns: OptionSet {
207
public static let primary = Self(rawValue: 1)
218
public static let supplementary = Self(rawValue: 1 << 1)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@_exported public import Animation
2+
@_exported public import Animator
3+
@_exported public import AtomicTransition
4+
@_exported public import NavigationTransition

NavigationTransitions.xcworkspace/xcshareddata/xcschemes/NavigationTransitions.xcscheme renamed to SwiftUINavigationTransitions.xcworkspace/xcshareddata/xcschemes/SwiftUINavigationTransitions.xcscheme

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
buildForAnalyzing = "YES">
1616
<BuildableReference
1717
BuildableIdentifier = "primary"
18-
BlueprintIdentifier = "NavigationTransitions"
19-
BuildableName = "NavigationTransitions"
20-
BlueprintName = "NavigationTransitions"
18+
BlueprintIdentifier = "SwiftUINavigationTransitions"
19+
BuildableName = "SwiftUINavigationTransitions"
20+
BlueprintName = "SwiftUINavigationTransitions"
2121
ReferencedContainer = "container:">
2222
</BuildableReference>
2323
</BuildActionEntry>
@@ -30,7 +30,7 @@
3030
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<TestPlans>
3232
<TestPlanReference
33-
reference = "container:Tests/TestPlans/NavigationTransitions.xctestplan"
33+
reference = "container:Tests/TestPlans/SwiftUINavigationTransitions.xctestplan"
3434
default = "YES">
3535
</TestPlanReference>
3636
</TestPlans>
@@ -55,9 +55,9 @@
5555
<MacroExpansion>
5656
<BuildableReference
5757
BuildableIdentifier = "primary"
58-
BlueprintIdentifier = "NavigationTransitions"
59-
BuildableName = "NavigationTransitions"
60-
BlueprintName = "NavigationTransitions"
58+
BlueprintIdentifier = "SwiftUINavigationTransitions"
59+
BuildableName = "SwiftUINavigationTransitions"
60+
BlueprintName = "SwiftUINavigationTransitions"
6161
ReferencedContainer = "container:">
6262
</BuildableReference>
6363
</MacroExpansion>

Tests/TestPlans/NavigationTransitions.xctestplan renamed to Tests/TestPlans/SwiftUINavigationTransitions.xctestplan

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"configurations" : [
33
{
4-
"id" : "8246DD19-912B-4BFD-B95F-A885D62913FC",
4+
"id" : "8C608A98-3C43-44EC-9508-ECA482696F28",
55
"name" : "Test Scheme Action",
66
"options" : {
77

@@ -16,15 +16,15 @@
1616
{
1717
"target" : {
1818
"containerPath" : "container:",
19-
"identifier" : "AtomicTransitionTests",
20-
"name" : "AtomicTransitionTests"
19+
"identifier" : "AnimatorTests",
20+
"name" : "AnimatorTests"
2121
}
2222
},
2323
{
2424
"target" : {
2525
"containerPath" : "container:",
26-
"identifier" : "AnimatorTests",
27-
"name" : "AnimatorTests"
26+
"identifier" : "AtomicTransitionTests",
27+
"name" : "AtomicTransitionTests"
2828
}
2929
}
3030
],

0 commit comments

Comments
 (0)