forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modify template to use SwiftUI
- Loading branch information
1 parent
7c22888
commit 4a0600d
Showing
8 changed files
with
42 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/react-native/template/visionos/HelloWorld/App.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import SwiftUI | ||
import React | ||
import React_RCTSwiftExtensions | ||
|
||
@main | ||
struct HelloWorldApp: App { | ||
@UIApplicationDelegateAdaptor var delegate: AppDelegate | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
RCTRootViewRepresentable(moduleName: "HelloWorld", initialProps: nil) | ||
} | ||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
packages/react-native/template/visionos/HelloWorld/AppDelegate.h
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
packages/react-native/template/visionos/HelloWorld/AppDelegate.mm
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
packages/react-native/template/visionos/HelloWorld/AppDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import UIKit | ||
import React | ||
import React_RCTAppDelegate | ||
|
||
class AppDelegate: RCTAppDelegate { | ||
override func sourceURL(for bridge: RCTBridge) -> URL? { | ||
self.bundleURL() | ||
} | ||
|
||
override func bundleURL() -> URL? { | ||
#if DEBUG | ||
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") | ||
#else | ||
Bundle.main.url(forResource: "main", withExtension: "jsbundle") | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
packages/react-native/template/visionos/HelloWorld/LaunchScreen.storyboard
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.