Skip to content

Commit 6ca5d93

Browse files
committed
Support Vision Pro
1 parent 6769216 commit 6ca5d93

7 files changed

Lines changed: 98 additions & 57 deletions

File tree

Demo/What's New?.xcodeproj/project.pbxproj

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
305305
CODE_SIGN_ENTITLEMENTS = "What's New?/What_s_New_.entitlements";
306306
CODE_SIGN_STYLE = Automatic;
307-
CURRENT_PROJECT_VERSION = 7;
307+
CURRENT_PROJECT_VERSION = 8;
308308
DEVELOPMENT_ASSET_PATHS = "\"What's New?/Preview Content\"";
309309
DEVELOPMENT_TEAM = "";
310310
ENABLE_HARDENED_RUNTIME = YES;
@@ -318,14 +318,17 @@
318318
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
319319
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
320320
MACOSX_DEPLOYMENT_TARGET = 11.0;
321-
MARKETING_VERSION = 4.0.0;
321+
MARKETING_VERSION = 4.1;
322322
PRODUCT_BUNDLE_IDENTIFIER = io.startway.WhatsNew;
323323
PRODUCT_NAME = "$(TARGET_NAME)";
324324
SDKROOT = auto;
325-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
325+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
326+
SUPPORTS_MACCATALYST = NO;
327+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
328+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
326329
SWIFT_EMIT_LOC_STRINGS = YES;
327330
SWIFT_VERSION = 5.0;
328-
TARGETED_DEVICE_FAMILY = "1,2";
331+
TARGETED_DEVICE_FAMILY = "1,2,7";
329332
};
330333
name = Debug;
331334
};
@@ -336,7 +339,7 @@
336339
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
337340
CODE_SIGN_ENTITLEMENTS = "What's New?/What_s_New_.entitlements";
338341
CODE_SIGN_STYLE = Automatic;
339-
CURRENT_PROJECT_VERSION = 7;
342+
CURRENT_PROJECT_VERSION = 8;
340343
DEVELOPMENT_ASSET_PATHS = "\"What's New?/Preview Content\"";
341344
DEVELOPMENT_TEAM = "";
342345
ENABLE_HARDENED_RUNTIME = YES;
@@ -350,14 +353,17 @@
350353
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
351354
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
352355
MACOSX_DEPLOYMENT_TARGET = 11.0;
353-
MARKETING_VERSION = 4.0.0;
356+
MARKETING_VERSION = 4.1;
354357
PRODUCT_BUNDLE_IDENTIFIER = io.startway.WhatsNew;
355358
PRODUCT_NAME = "$(TARGET_NAME)";
356359
SDKROOT = auto;
357-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
360+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
361+
SUPPORTS_MACCATALYST = NO;
362+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
363+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
358364
SWIFT_EMIT_LOC_STRINGS = YES;
359365
SWIFT_VERSION = 5.0;
360-
TARGETED_DEVICE_FAMILY = "1,2";
366+
TARGETED_DEVICE_FAMILY = "1,2,7";
361367
};
362368
name = Release;
363369
};

Demo/What's New?.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

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

Demo/What's New?/en.lproj/data.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
[
2+
{
3+
"version": "4.1",
4+
"subVersion": "4.1.0",
5+
"new": [
6+
{
7+
"icon": "eye",
8+
"title": "Support Vision Pro",
9+
"subtitle": "& visionOS",
10+
"body": "Drops Framework is temp-disabled due to conflict."
11+
},
12+
{
13+
"icon": "macpro.gen3.server",
14+
"title": "Serverless",
15+
"subtitle": "Design",
16+
"body": "Free and open source! ❤️‍🔥"
17+
},
18+
{
19+
"icon": "arrow.triangle.pull",
20+
"title": "Contribute",
21+
"subtitle": "Together",
22+
"body": "Pull requests and make it better for everyone! 🎉"
23+
}
24+
]
25+
},
226
{
327
"version": "4.0",
428
"subVersion": "4.0.0",

Demo/What's New?/zh-Hant.lproj/data.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
[
2+
{
3+
"version": "4.1",
4+
"subVersion": "4.1.0",
5+
"new": [
6+
{
7+
"icon": "eye",
8+
"title": "支持 Vision Pro",
9+
"subtitle": "和 visionOS",
10+
"body": "Drops Framework 由於衝突而被臨時禁用。"
11+
},
12+
{
13+
"icon": "macpro.gen3.server",
14+
"title": "無服務器",
15+
"subtitle": "設計",
16+
"body": "免費開源! ❤️‍🔥"
17+
},
18+
{
19+
"icon": "arrow.triangle.pull",
20+
"title": "貢獻",
21+
"subtitle": "一起",
22+
"body": "提出請求,變得更好! 🎉"
23+
}
24+
]
25+
},
226
{
327
"version": "4.0",
428
"subVersion": "4.0.0",

Package.resolved

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

Package.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.4
1+
// swift-tools-version: 5.7
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33
//
44
// Created by Ming on 11/6/2022.
@@ -11,7 +11,8 @@ let package = Package(
1111
platforms: [
1212
.iOS(.v14),
1313
.watchOS(.v7),
14-
.macOS(.v11)
14+
.macOS(.v11),
15+
.custom("xros", versionString: "1.0")
1516
],
1617
products: [
1718
.library(
@@ -20,14 +21,14 @@ let package = Package(
2021
],
2122
dependencies: [
2223
.package(name: "SwiftVB", url: "https://github.com/1998code/SwiftVBKit.git", .upToNextMinor(from: "1.4.0")),
23-
.package(name: "Drops", url: "https://github.com/1998code/Drops.git", .upToNextMinor(from: "2.1.0"))
24+
// .package(name: "Drops", url: "https://github.com/1998code/Drops.git", .upToNextMinor(from: "2.1.0"))
2425
],
2526
targets: [
2627
.target(
2728
name: "SwiftNEW",
2829
dependencies: [
2930
"SwiftVB",
30-
"Drops"
31+
// "Drops"
3132
]
3233
)
3334
]

Sources/SwiftNEW/SwiftNEW.swift

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import SwiftUI
66
import SwiftVB
77

8-
#if os(iOS)
9-
import Drops
10-
#endif
8+
//#if os(iOS)
9+
//import Drops
10+
//#endif
1111

1212
@available(iOS 14, watchOS 7.0, macOS 11.0, *)
1313
public struct SwiftNEW: View {
@@ -59,7 +59,7 @@ public struct SwiftNEW: View {
5959
else if size == "normal" {
6060
Label(label, systemImage: labelImage)
6161
.frame(width: 300, height: 50)
62-
#if os(iOS)
62+
#if os(iOS) && !os(xrOS)
6363
.foregroundColor(labelColor)
6464
.background(color)
6565
.cornerRadius(15)
@@ -71,6 +71,9 @@ public struct SwiftNEW: View {
7171
.sheet(isPresented: $historySheet) {
7272
sheetHistory
7373
}
74+
#if os(xrOS)
75+
.padding()
76+
#endif
7477
}
7578
}
7679

@@ -182,7 +185,10 @@ public struct SwiftNEW: View {
182185
Text("Show History")
183186
Image(systemName: "arrow.up.bin")
184187
}.font(.body)
185-
}.foregroundColor(color)
188+
}
189+
#if !os(xrOS)
190+
.foregroundColor(color)
191+
#endif
186192
}
187193
public var closeCurrentButton: some View {
188194
Button(action: { show = false }) {
@@ -197,11 +203,11 @@ public struct SwiftNEW: View {
197203
}
198204
}.font(.body)
199205
.frame(width: 300, height: 50)
200-
#if os(iOS)
206+
#if os(iOS) && !os(xrOS)
201207
.foregroundColor(.white)
202208
.background(color)
203209
.cornerRadius(15)
204-
#endif
210+
#endif
205211
}
206212
}
207213

@@ -331,13 +337,13 @@ public struct SwiftNEW: View {
331337

332338
#if os(iOS)
333339
public func drop() {
334-
let drop = Drop(title: "Tap", subtitle: "To See What's New.", icon: UIImage(systemName: labelImage),
335-
action: .init {
336-
Drops.hideCurrent()
337-
show = true
338-
},
339-
position: .top, duration: 3.0, accessibility: "Alert: Tap to see what's new." )
340-
Drops.show(drop)
340+
// let drop = Drop(title: "Tap", subtitle: "To See What's New.", icon: UIImage(systemName: labelImage),
341+
// action: .init {
342+
// Drops.hideCurrent()
343+
// show = true
344+
// },
345+
// position: .top, duration: 3.0, accessibility: "Alert: Tap to see what's new." )
346+
// Drops.show(drop)
341347
}
342348
#endif
343349
}

0 commit comments

Comments
 (0)