diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h index 095a002ee748db..0351d65ed502ed 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h @@ -55,9 +55,9 @@ void RCTAppSetupPrepareApp( RCT_EXTERN_C_BEGIN -[[deprecated("Use the 3-argument overload of RCTAppSetupPrepareApp instead")]] void RCTAppSetupPrepareApp( - UIApplication *application, - BOOL turboModuleEnabled); +//[[deprecated("Use the 3-argument overload of RCTAppSetupPrepareApp instead")]] void RCTAppSetupPrepareApp( +// UIApplication *application, +// BOOL turboModuleEnabled); UIView *RCTAppSetupDefaultRootView( RCTBridge *bridge, diff --git a/packages/rn-tester/RNTester-visionOS/AppDelegate.swift b/packages/rn-tester/RNTester-visionOS/AppDelegate.swift index 1328889fbab179..5a189f419d42e6 100644 --- a/packages/rn-tester/RNTester-visionOS/AppDelegate.swift +++ b/packages/rn-tester/RNTester-visionOS/AppDelegate.swift @@ -9,20 +9,21 @@ import Foundation import UIKit import React +import ReactCommon import React_RCTAppDelegate +import CxxStdlib + class AppDelegate: NSObject, UIApplicationDelegate, ObservableObject { - private var bridge: RCTBridge? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { - // Do magic - print("application did finish launching") + let cxxString = std.string("Swift with C++") + let reactNativeConfig = facebook.react.EmptyReactNativeConfig() + return true } - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - let sceneConfig = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role) - sceneConfig.delegateClass = SceneDelegate.self - return sceneConfig - } +// override func sourceURL(for bridge: RCTBridge!) -> URL! { +// RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "js/RNTesterApp.ios") +// } } diff --git a/packages/rn-tester/RNTester-visionOS/ReactRootViewRepresentable.swift b/packages/rn-tester/RNTester-visionOS/ReactRootViewRepresentable.swift index 0c4a39bd2cdcda..524ca7675761a3 100644 --- a/packages/rn-tester/RNTester-visionOS/ReactRootViewRepresentable.swift +++ b/packages/rn-tester/RNTester-visionOS/ReactRootViewRepresentable.swift @@ -7,18 +7,18 @@ // import SwiftUI -import React +//import React struct ReactRootViewRepresentable: UIViewRepresentable { - var bridge: RCTBridge - var moduleName: String - +// var bridge: RCTBridge +// var moduleName: String +// func updateUIView(_ uiView: UIViewType, context: Context) { // Do nothing } - +// func makeUIView(context: Context) -> some UIView { - let rootView = RCTRootView(bridge: bridge, moduleName: moduleName, initialProperties: nil) + let rootView = UIView() //RCTRootView(bridge: bridge, moduleName: moduleName, initialProperties: nil) return rootView } diff --git a/packages/rn-tester/RNTester-visionOS/SceneDelegate.swift b/packages/rn-tester/RNTester-visionOS/SceneDelegate.swift deleted file mode 100644 index 41c905581a35d9..00000000000000 --- a/packages/rn-tester/RNTester-visionOS/SceneDelegate.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// SceneDelegate.swift -// RNTester-visionOS -// -// Created by Oskar Kwaśniewski on 21/12/2023. -// Copyright © 2023 Facebook. All rights reserved. -// - -import Foundation -import UIKit - -class SceneDelegate: NSObject, UIWindowSceneDelegate { - func sceneWillEnterForeground(_ scene: UIScene) { - // ... - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // ... - } - - func sceneWillResignActive(_ scene: UIScene) { - // ... - } -} diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index e188ba119afbf5..9c0ac9c23dd082 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 763DC3802B0F824400D2C0C5 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 763DC37F2B0F824400D2C0C5 /* Preview Assets.xcassets */; }; 76E4BB282B34909800B02A15 /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76E4BB272B34909800B02A15 /* App.swift */; }; 76E4BB2C2B34932200B02A15 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76E4BB2B2B34932200B02A15 /* AppDelegate.swift */; }; - 76E4BB2E2B34940500B02A15 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76E4BB2D2B34940500B02A15 /* SceneDelegate.swift */; }; 76E4BB302B34950500B02A15 /* ReactRootViewRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76E4BB2F2B34950500B02A15 /* ReactRootViewRepresentable.swift */; }; 8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; }; 832F45BB2A8A6E1F0097B4E6 /* SwiftTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 832F45BA2A8A6E1F0097B4E6 /* SwiftTest.swift */; }; @@ -109,7 +108,6 @@ 763DC3812B0F824400D2C0C5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 76E4BB272B34909800B02A15 /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = ""; }; 76E4BB2B2B34932200B02A15 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 76E4BB2D2B34940500B02A15 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 76E4BB2F2B34950500B02A15 /* ReactRootViewRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactRootViewRepresentable.swift; sourceTree = ""; }; 7CDA7A212644C6BB8C0D00D8 /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = ""; }; 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = ""; }; @@ -302,7 +300,6 @@ 763DC3732B0F824200D2C0C5 /* RNTester-visionOS */ = { isa = PBXGroup; children = ( - 76E4BB2D2B34940500B02A15 /* SceneDelegate.swift */, 76E4BB2B2B34932200B02A15 /* AppDelegate.swift */, 76E4BB272B34909800B02A15 /* App.swift */, 76E4BB2F2B34950500B02A15 /* ReactRootViewRepresentable.swift */, @@ -895,7 +892,6 @@ 76E4BB2C2B34932200B02A15 /* AppDelegate.swift in Sources */, 76E4BB282B34909800B02A15 /* App.swift in Sources */, 76E4BB302B34950500B02A15 /* ReactRootViewRepresentable.swift in Sources */, - 76E4BB2E2B34940500B02A15 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1137,6 +1133,7 @@ SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INCLUDE_PATHS = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit-visionOS\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit-iOS\""; "SWIFT_INCLUDE_PATHS[arch=*]" = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit-visionOS\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit-iOS\""; + SWIFT_OBJC_INTEROP_MODE = objcxx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,7"; @@ -1234,6 +1231,7 @@ SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_INCLUDE_PATHS = "$(inherited) \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit-visionOS\" \"${PODS_CONFIGURATION_BUILD_DIR}/YogaKit-iOS\""; + SWIFT_OBJC_INTEROP_MODE = objcxx; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,7"; };