Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,61 @@ jobs:
-scheme NavigationStackExample \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO

ui-tests-example:
name: Example UI Tests
runs-on: macos-26
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Run UI Tests On Newest iOS Simulator
run: |
SIM_ID=$(xcrun simctl list devices available -j | python3 -c '
import json, sys
devices = json.load(sys.stdin)["devices"]
runtimes = sorted((k for k in devices if ".iOS-" in k), key=lambda k: [int(x) for x in k.split(".iOS-")[1].split("-")])
for runtime in reversed(runtimes):
phones = [d["udid"] for d in devices[runtime] if d["name"].startswith("iPhone")]
if phones:
print(phones[0])
break
')
if [ -z "$SIM_ID" ]; then
echo "::error::No iPhone simulator available"
exit 1
fi
xcodebuild test \
-project NavigationStackExample/NavigationStackExample.xcodeproj \
-scheme NavigationStackExample \
-destination "id=$SIM_ID" \
-resultBundlePath UITests.xcresult \
CODE_SIGNING_ALLOWED=NO

- name: Upload Result Bundle (screenshots)
if: always()
uses: actions/upload-artifact@v4
with:
name: example-ui-tests-xcresult
path: UITests.xcresult
if-no-files-found: ignore

binary-size:
name: Binary Size
runs-on: macos-26
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Check Library Binary Size Budget
run: scripts/check-binary-size.sh 80000
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project are documented here. Format follows [Keep a

## [Unreleased]

### Fixed
- `View.navigationRouter(...)` on a hand-built `NavigationStack`: pushed destinations crashed when reading the router from `@Environment`, because `.environment(router)` was applied inside the stack. The router is now injected into every pushed destination (sheets and covers already inherited it). `BaseNavigationContainer` was not affected.

### Added
- Example app UI tests (`NavigationStackExampleUITests`) covering push/pop, nested sheet stack, full screen cover, background `send`, the modifier recipe (pushed screen and sheet), duplicate-push guard, `maxDepth` truncation, and sheet rejection while a cover is shown. CI runs them and attaches screenshots to the result bundle.

## [2.0.0] - 2026-11-02

### Added
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ The project uses Git Flow:
```bash
swift test
swiftlint --strict
scripts/check-binary-size.sh # library must add < 80 KB to a release app
```
5. CI must pass (macOS, iOS Simulator, tvOS, watchOS, visionOS, example app, SwiftLint).
Changes that affect rendering should also pass the example UI tests (scheme `NavigationStackExample`, target `NavigationStackExampleUITests`); each step attaches a screenshot to the result bundle.
5. CI must pass (macOS, iOS Simulator, tvOS, watchOS, visionOS, example app build and UI tests, binary size, SwiftLint).

## Versioning

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,45 @@
objects = {

/* Begin PBXBuildFile section */
2F415C30082A237CE9040EB5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8947B5544ECAFE722A93B6CC /* Foundation.framework */; };
3E7A81C32B2B06C60003D5A3 /* NavigationStackExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E7A81C22B2B06C60003D5A3 /* NavigationStackExampleApp.swift */; };
3E7A81C52B2B06C60003D5A3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E7A81C42B2B06C60003D5A3 /* ContentView.swift */; };
3E7A81C72B2B06C70003D5A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3E7A81C62B2B06C70003D5A3 /* Assets.xcassets */; };
3E7A81CA2B2B06C70003D5A3 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3E7A81C92B2B06C70003D5A3 /* Preview Assets.xcassets */; };
3E7A81D52B2B07C50003D5A3 /* BaseNavigationStack in Frameworks */ = {isa = PBXBuildFile; productRef = 3E7A81D42B2B07C50003D5A3 /* BaseNavigationStack */; };
AC7418F0D4DFC75CE7265C5A /* NavigationFlowUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCBA617EF856AC0741BA0D65 /* NavigationFlowUITests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
32DFD30F4FA9EE8EA0E8F8AA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3E7A81B72B2B06C50003D5A3 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 3E7A81BE2B2B06C60003D5A3;
remoteInfo = NavigationStackExample;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
3E7A81BF2B2B06C60003D5A3 /* NavigationStackExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationStackExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
3E7A81C22B2B06C60003D5A3 /* NavigationStackExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationStackExampleApp.swift; sourceTree = "<group>"; };
3E7A81C42B2B06C60003D5A3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
3E7A81C62B2B06C70003D5A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3E7A81C92B2B06C70003D5A3 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
6E3B2544D9A08AC0C04E7D89 /* NavigationStackExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NavigationStackExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8947B5544ECAFE722A93B6CC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
CCBA617EF856AC0741BA0D65 /* NavigationFlowUITests.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NavigationFlowUITests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
104829D03CBC760B8A6278F1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2F415C30082A237CE9040EB5 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3E7A81BC2B2B06C60003D5A3 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -39,13 +62,16 @@
children = (
3E7A81C12B2B06C60003D5A3 /* NavigationStackExample */,
3E7A81C02B2B06C60003D5A3 /* Products */,
5F599B154D6A3E05F3E95133 /* Frameworks */,
806789F8DAA2C52F51E0F308 /* NavigationStackExampleUITests */,
);
sourceTree = "<group>";
};
3E7A81C02B2B06C60003D5A3 /* Products */ = {
isa = PBXGroup;
children = (
3E7A81BF2B2B06C60003D5A3 /* NavigationStackExample.app */,
6E3B2544D9A08AC0C04E7D89 /* NavigationStackExampleUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -69,9 +95,52 @@
path = "Preview Content";
sourceTree = "<group>";
};
5F599B154D6A3E05F3E95133 /* Frameworks */ = {
isa = PBXGroup;
children = (
BC6690ABD9CC6A44B9BFC02E /* iOS */,
);
name = Frameworks;
sourceTree = "<group>";
};
806789F8DAA2C52F51E0F308 /* NavigationStackExampleUITests */ = {
isa = PBXGroup;
children = (
CCBA617EF856AC0741BA0D65 /* NavigationFlowUITests.swift */,
);
name = NavigationStackExampleUITests;
path = NavigationStackExampleUITests;
sourceTree = "<group>";
};
BC6690ABD9CC6A44B9BFC02E /* iOS */ = {
isa = PBXGroup;
children = (
8947B5544ECAFE722A93B6CC /* Foundation.framework */,
);
name = iOS;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
03412AC37194981B7A5118EA /* NavigationStackExampleUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 636323033ED8E83B3F78E2AD /* Build configuration list for PBXNativeTarget "NavigationStackExampleUITests" */;
buildPhases = (
28195A8B9D26B02A521FB54C /* Sources */,
104829D03CBC760B8A6278F1 /* Frameworks */,
B02A721A51B055B6254F85B7 /* Resources */,
);
buildRules = (
);
dependencies = (
9D466A08BE0EC8E47BAE9B1F /* PBXTargetDependency */,
);
name = NavigationStackExampleUITests;
productName = NavigationStackExampleUITests;
productReference = 6E3B2544D9A08AC0C04E7D89 /* NavigationStackExampleUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
3E7A81BE2B2B06C60003D5A3 /* NavigationStackExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3E7A81CD2B2B06C70003D5A3 /* Build configuration list for PBXNativeTarget "NavigationStackExample" */;
Expand Down Expand Up @@ -124,6 +193,7 @@
projectRoot = "";
targets = (
3E7A81BE2B2B06C60003D5A3 /* NavigationStackExample */,
03412AC37194981B7A5118EA /* NavigationStackExampleUITests */,
);
};
/* End PBXProject section */
Expand All @@ -138,9 +208,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
B02A721A51B055B6254F85B7 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
28195A8B9D26B02A521FB54C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AC7418F0D4DFC75CE7265C5A /* NavigationFlowUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3E7A81BB2B2B06C60003D5A3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -152,6 +237,15 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
9D466A08BE0EC8E47BAE9B1F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = NavigationStackExample;
target = 3E7A81BE2B2B06C60003D5A3 /* NavigationStackExample */;
targetProxy = 32DFD30F4FA9EE8EA0E8F8AA /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
3E7A81CB2B2B06C70003D5A3 /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -330,6 +424,41 @@
};
name = Release;
};
7EBFF36BD61EC1EBC3921615 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = AP58YLHQ2S;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
PRODUCT_BUNDLE_IDENTIFIER = com.baseNavigationStack.NavigationStackExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = NavigationStackExample;
};
name = Debug;
};
FDE56473E18DA50FBF2A25AC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = AP58YLHQ2S;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
PRODUCT_BUNDLE_IDENTIFIER = com.baseNavigationStack.NavigationStackExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = NavigationStackExample;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand All @@ -351,6 +480,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
636323033ED8E83B3F78E2AD /* Build configuration list for PBXNativeTarget "NavigationStackExampleUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FDE56473E18DA50FBF2A25AC /* Release */,
7EBFF36BD61EC1EBC3921615 /* Debug */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
Expand Down
Loading
Loading