Skip to content

Commit 594450b

Browse files
authored
Add visionOS support (#98)
1 parent 7f073f2 commit 594450b

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

Examples/Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
attributes = {
151151
BuildIndependentTargetsInParallel = 1;
152152
LastSwiftUpdateCheck = 1410;
153-
LastUpgradeCheck = 1410;
153+
LastUpgradeCheck = 1500;
154154
TargetAttributes = {
155155
D553581A290E9691009E5D72 = {
156156
CreatedOnToolsVersion = 14.1;
@@ -217,6 +217,7 @@
217217
isa = XCBuildConfiguration;
218218
buildSettings = {
219219
ALWAYS_SEARCH_USER_PATHS = NO;
220+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
220221
CLANG_ANALYZER_NONNULL = YES;
221222
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
222223
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -249,6 +250,7 @@
249250
DEBUG_INFORMATION_FORMAT = dwarf;
250251
ENABLE_STRICT_OBJC_MSGSEND = YES;
251252
ENABLE_TESTABILITY = YES;
253+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
252254
GCC_C_LANGUAGE_STANDARD = gnu11;
253255
GCC_DYNAMIC_NO_PIC = NO;
254256
GCC_NO_COMMON_BLOCKS = YES;
@@ -278,6 +280,7 @@
278280
isa = XCBuildConfiguration;
279281
buildSettings = {
280282
ALWAYS_SEARCH_USER_PATHS = NO;
283+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
281284
CLANG_ANALYZER_NONNULL = YES;
282285
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
283286
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -310,6 +313,7 @@
310313
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
311314
ENABLE_NS_ASSERTIONS = NO;
312315
ENABLE_STRICT_OBJC_MSGSEND = YES;
316+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
313317
GCC_C_LANGUAGE_STANDARD = gnu11;
314318
GCC_NO_COMMON_BLOCKS = YES;
315319
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -356,13 +360,14 @@
356360
MARKETING_VERSION = 1.0;
357361
PRODUCT_BUNDLE_IDENTIFIER = mn.dro.Demo;
358362
PRODUCT_NAME = "$(TARGET_NAME)";
359-
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator";
363+
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator xros xrsimulator";
360364
SUPPORTS_MACCATALYST = YES;
361365
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
366+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
362367
SWIFT_EMIT_LOC_STRINGS = YES;
363368
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
364369
SWIFT_VERSION = 5.0;
365-
TARGETED_DEVICE_FAMILY = "1,2,3";
370+
TARGETED_DEVICE_FAMILY = "1,2,3,7";
366371
};
367372
name = Debug;
368373
};
@@ -393,12 +398,13 @@
393398
MARKETING_VERSION = 1.0;
394399
PRODUCT_BUNDLE_IDENTIFIER = mn.dro.Demo;
395400
PRODUCT_NAME = "$(TARGET_NAME)";
396-
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator";
401+
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator xros xrsimulator";
397402
SUPPORTS_MACCATALYST = YES;
398403
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
404+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
399405
SWIFT_EMIT_LOC_STRINGS = YES;
400406
SWIFT_VERSION = 5.0;
401-
TARGETED_DEVICE_FAMILY = "1,2,3";
407+
TARGETED_DEVICE_FAMILY = "1,2,3,7";
402408
};
403409
name = Release;
404410
};

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 = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Examples/Demo/Demo/Pages.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ struct PageLink: View {
125125

126126
var body: some View {
127127
ZStack {
128-
#if !os(tvOS)
129-
RoundedRectangle(cornerRadius: 6, style: .continuous)
128+
RoundedRectangle(cornerRadius: 6, style: .continuous)
129+
#if !os(tvOS) && !os(visionOS)
130130
.fill(Color.blue.opacity(0.8))
131-
#endif
131+
#else
132+
.fill(Color.clear)
133+
#endif
132134
Text(title)
133135
#if !os(tvOS)
134136
.foregroundColor(.white)
@@ -162,14 +164,14 @@ struct Code<Content: StringProtocol>: View {
162164
.font(.system(size: 14, design: .monospaced))
163165
.background(shape.stroke(Color(white: 0.1).opacity(0.35), lineWidth: 1))
164166
.background(Color(white: 0.94).opacity(0.6).clipShape(shape))
165-
#if !os(tvOS)
167+
#if !os(tvOS)
166168
.modifier {
167169
if #available(iOS 15, *) {
168170
$0.textSelection(.enabled)
169171
} else {
170172
$0
171173
}
172174
}
173-
#endif
175+
#endif
174176
}
175177
}

NavigationTransitions.xcworkspace/xcshareddata/xcschemes/NavigationTransitions.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 = "1410"
3+
LastUpgradeVersion = "1500"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Package.resolved

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/NavigationTransitions/NavigationTransition+SwiftUI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extension View {
88
) -> some View {
99
self.introspect(
1010
.navigationView(style: .stack),
11-
on: .iOS(.v13...), .tvOS(.v13...),
11+
on: .iOS(.v13...), .tvOS(.v13...), .visionOS(.v1...),
1212
scope: [.receiver, .ancestor]
1313
) { controller in
1414
controller.setNavigationTransition(transition, interactivity: interactivity)

Sources/NavigationTransitions/NavigationTransition+UIKit.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ extension UINavigationController {
147147
customDelegate.transition = transition
148148
}
149149

150-
#if !os(tvOS)
150+
#if !os(tvOS) && !os(visionOS)
151151
if defaultEdgePanRecognizer.strongDelegate == nil {
152152
defaultEdgePanRecognizer.strongDelegate = NavigationGestureRecognizerDelegate(controller: self)
153153
}
@@ -219,6 +219,7 @@ extension UINavigationController {
219219
}
220220

221221
@available(tvOS, unavailable)
222+
@available(visionOS, unavailable)
222223
private func exclusivelyEnableGestureRecognizer(_ gestureRecognizer: UIPanGestureRecognizer?) {
223224
for recognizer in [defaultEdgePanRecognizer!, defaultPanRecognizer!, edgePanRecognizer!, panRecognizer!] {
224225
if let gestureRecognizer, recognizer === gestureRecognizer {
@@ -237,6 +238,7 @@ extension UINavigationController {
237238
}
238239

239240
@available(tvOS, unavailable)
241+
@available(visionOS, unavailable)
240242
extension UINavigationController {
241243
var defaultEdgePanRecognizer: UIScreenEdgePanGestureRecognizer! {
242244
interactivePopGestureRecognizer as? UIScreenEdgePanGestureRecognizer

0 commit comments

Comments
 (0)