Skip to content

Commit 0f4745b

Browse files
authored
feat: migrate template to Swift (#45)
1 parent b3ed5a7 commit 0f4745b

File tree

5 files changed

+32
-57
lines changed

5 files changed

+32
-57
lines changed

template/ios/HelloWorld.xcodeproj/project.pbxproj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
/* Begin PBXBuildFile section */
1010
00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; };
1111
0C80B921A6F3F58F76C31292 /* libPods-HelloWorld.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */; };
12-
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
1312
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
14-
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
1513
7699B88040F8A987B510C191 /* libPods-HelloWorld-HelloWorldTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */; };
14+
76D661D02C777F4B0022369A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D661CF2C777F470022369A /* AppDelegate.swift */; };
1615
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
1716
/* End PBXBuildFile section */
1817

@@ -31,11 +30,8 @@
3130
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3231
00E356F21AD99517003FC87E /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = "<group>"; };
3332
13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
34-
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = "<group>"; };
35-
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = HelloWorld/AppDelegate.mm; sourceTree = "<group>"; };
3633
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = "<group>"; };
3734
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = "<group>"; };
38-
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = "<group>"; };
3935
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = HelloWorld/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4036
19F6CBCC0A4E27FBF8BF4A61 /* libPods-HelloWorld-HelloWorldTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld-HelloWorldTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4137
3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.debug.xcconfig"; path = "Target Support Files/Pods-HelloWorld/Pods-HelloWorld.debug.xcconfig"; sourceTree = "<group>"; };
@@ -44,6 +40,7 @@
4440
5DCACB8F33CDC322A6C60F78 /* libPods-HelloWorld.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorld.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4541
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = HelloWorld/LaunchScreen.storyboard; sourceTree = "<group>"; };
4642
89C6BE57DB24E9ADA2F236DE /* Pods-HelloWorld-HelloWorldTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld-HelloWorldTests.release.xcconfig"; path = "Target Support Files/Pods-HelloWorld-HelloWorldTests/Pods-HelloWorld-HelloWorldTests.release.xcconfig"; sourceTree = "<group>"; };
43+
76D661CF2C777F470022369A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4744
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4845
/* End PBXFileReference section */
4946

@@ -87,12 +84,10 @@
8784
13B07FAE1A68108700A75B9A /* HelloWorld */ = {
8885
isa = PBXGroup;
8986
children = (
90-
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
91-
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
9287
13B07FB51A68108700A75B9A /* Images.xcassets */,
88+
76D661CF2C777F470022369A /* AppDelegate.swift */,
9389
13B07FB61A68108700A75B9A /* Info.plist */,
9490
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
95-
13B07FB71A68108700A75B9A /* main.m */,
9691
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
9792
);
9893
name = HelloWorld;
@@ -394,8 +389,7 @@
394389
isa = PBXSourcesBuildPhase;
395390
buildActionMask = 2147483647;
396391
files = (
397-
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
398-
13B07FC11A68108700A75B9A /* main.m in Sources */,
392+
76D661D02C777F4B0022369A /* AppDelegate.swift in Sources */,
399393
);
400394
runOnlyForDeploymentPostprocessing = 0;
401395
};

template/ios/HelloWorld/AppDelegate.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

template/ios/HelloWorld/AppDelegate.mm

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import UIKit
2+
import React
3+
import React_RCTAppDelegate
4+
5+
@main
6+
class AppDelegate: RCTAppDelegate {
7+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
8+
self.moduleName = "HelloWorld";
9+
10+
// You can add your custom initial props in the dictionary below.
11+
// They will be passed down to the ViewController used by React Native.
12+
self.initialProps = [:];
13+
14+
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
15+
}
16+
17+
override func sourceURL(for bridge: RCTBridge) -> URL? {
18+
self.bundleURL()
19+
}
20+
21+
override func bundleURL() -> URL? {
22+
#if DEBUG
23+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
24+
#else
25+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
26+
#endif
27+
}
28+
}

template/ios/HelloWorld/main.m

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)