Skip to content

Commit 20701c0

Browse files
ynagatomoYasuhito Nagatomo
and
Yasuhito Nagatomo
authored
Fix visionOS support on the LVMEval Target (#199)
* Fix visionOS support * Passed swift-format --------- Co-authored-by: Yasuhito Nagatomo <[email protected]>
1 parent c743526 commit 20701c0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Applications/VLMEval/ContentView.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import MLXVLM
99
import PhotosUI
1010
import SwiftUI
1111

12-
#if os(iOS)
12+
#if os(iOS) || os(visionOS)
1313
typealias PlatformImage = UIImage
1414
#else
1515
typealias PlatformImage = NSImage
@@ -63,7 +63,7 @@ struct ContentView: View {
6363
VStack {
6464
if let selectedImage {
6565
Group {
66-
#if os(iOS)
66+
#if os(iOS) || os(visionOS)
6767
Image(uiImage: selectedImage)
6868
.resizable()
6969
#else
@@ -99,7 +99,7 @@ struct ContentView: View {
9999
}
100100

101101
HStack {
102-
#if os(iOS)
102+
#if os(iOS) || os(visionOS)
103103
PhotosPicker(
104104
selection: $selectedItem,
105105
matching: PHPickerFilter.any(of: [
@@ -249,7 +249,7 @@ struct ContentView: View {
249249
private func generate() {
250250
Task {
251251
if let selectedImage = selectedImage {
252-
#if os(iOS)
252+
#if os(iOS) || os(visionOS)
253253
let ciImage = CIImage(image: selectedImage)
254254
await llm.generate(prompt: prompt, image: ciImage ?? CIImage(), videoURL: nil)
255255
#else
@@ -449,7 +449,7 @@ class VLMEvaluator {
449449
}
450450
}
451451

452-
#if os(iOS)
452+
#if os(iOS) || os(visionOS)
453453
struct TransferableVideo: Transferable {
454454
let url: URL
455455

mlx-swift-examples.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@
10511051
CURRENT_PROJECT_VERSION = 1;
10521052
DEBUG_INFORMATION_FORMAT = dwarf;
10531053
DEVELOPMENT_ASSET_PATHS = "\"Applications/VLMEval/Preview Content\"";
1054-
DEVELOPMENT_TEAM = YQZQG7N4WG;
1054+
DEVELOPMENT_TEAM = J5CY9Q9UP5;
10551055
ENABLE_PREVIEWS = YES;
10561056
ENABLE_USER_SCRIPT_SANDBOXING = YES;
10571057
GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -1117,7 +1117,7 @@
11171117
CURRENT_PROJECT_VERSION = 1;
11181118
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
11191119
DEVELOPMENT_ASSET_PATHS = "\"Applications/VLMEval/Preview Content\"";
1120-
DEVELOPMENT_TEAM = YQZQG7N4WG;
1120+
DEVELOPMENT_TEAM = J5CY9Q9UP5;
11211121
ENABLE_NS_ASSERTIONS = NO;
11221122
ENABLE_PREVIEWS = YES;
11231123
ENABLE_USER_SCRIPT_SANDBOXING = YES;

0 commit comments

Comments
 (0)