Skip to content

Commit 6d3875e

Browse files
committed
feat: integrate brownfield with demo iOS app
1 parent 56a02d5 commit 6d3875e

4 files changed

Lines changed: 94 additions & 30 deletions

File tree

example/iOSApp/Brownfield iOS App.xcodeproj/project.pbxproj

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@
66
objectVersion = 77;
77
objects = {
88

9+
/* Begin PBXBuildFile section */
10+
79A9BC812EF5781F009EC2E3 /* BrownfieldLib.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */; };
11+
79A9BC822EF5781F009EC2E3 /* ReactBrownfield.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */; };
12+
79A9BC832EF5781F009EC2E3 /* hermesvm.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */; };
13+
/* End PBXBuildFile section */
14+
915
/* Begin PBXFileReference section */
1016
793C76A72EEBF938008A2A34 /* Brownfield iOS App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Brownfield iOS App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
17+
79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = BrownfieldLib.xcframework; path = ../RNApp/ios/out/Release/BrownfieldLib.xcframework; sourceTree = SOURCE_ROOT; };
18+
79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = hermesvm.xcframework; path = ../RNApp/ios/out/Release/hermesvm.xcframework; sourceTree = SOURCE_ROOT; };
19+
79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ReactBrownfield.xcframework; path = ../RNApp/ios/out/Release/ReactBrownfield.xcframework; sourceTree = SOURCE_ROOT; };
1120
/* End PBXFileReference section */
1221

1322
/* Begin PBXFileSystemSynchronizedRootGroup section */
@@ -23,6 +32,9 @@
2332
isa = PBXFrameworksBuildPhase;
2433
buildActionMask = 2147483647;
2534
files = (
35+
79A9BC812EF5781F009EC2E3 /* BrownfieldLib.xcframework in Frameworks */,
36+
79A9BC822EF5781F009EC2E3 /* ReactBrownfield.xcframework in Frameworks */,
37+
79A9BC832EF5781F009EC2E3 /* hermesvm.xcframework in Frameworks */,
2638
);
2739
runOnlyForDeploymentPostprocessing = 0;
2840
};
@@ -32,6 +44,9 @@
3244
793C769E2EEBF938008A2A34 = {
3345
isa = PBXGroup;
3446
children = (
47+
79A9BC7E2EF5781F009EC2E3 /* BrownfieldLib.xcframework */,
48+
79A9BC7F2EF5781F009EC2E3 /* hermesvm.xcframework */,
49+
79A9BC802EF5781F009EC2E3 /* ReactBrownfield.xcframework */,
3550
793C76A92EEBF938008A2A34 /* Brownfield iOS App */,
3651
793C76A82EEBF938008A2A34 /* Products */,
3752
);
@@ -78,7 +93,7 @@
7893
attributes = {
7994
BuildIndependentTargetsInParallel = 1;
8095
LastSwiftUpdateCheck = 2610;
81-
LastUpgradeCheck = 2610;
96+
LastUpgradeCheck = 2620;
8297
TargetAttributes = {
8398
793C76A62EEBF938008A2A34 = {
8499
CreatedOnToolsVersion = 26.1.1;
@@ -159,6 +174,7 @@
159174
CLANG_WARN_UNREACHABLE_CODE = YES;
160175
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
161176
COPY_PHASE_STRIP = NO;
177+
DEAD_CODE_STRIPPING = YES;
162178
DEBUG_INFORMATION_FORMAT = dwarf;
163179
ENABLE_STRICT_OBJC_MSGSEND = YES;
164180
ENABLE_TESTABILITY = YES;
@@ -181,6 +197,7 @@
181197
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
182198
MTL_FAST_MATH = YES;
183199
ONLY_ACTIVE_ARCH = YES;
200+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
184201
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
185202
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
186203
};
@@ -220,6 +237,7 @@
220237
CLANG_WARN_UNREACHABLE_CODE = YES;
221238
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
222239
COPY_PHASE_STRIP = NO;
240+
DEAD_CODE_STRIPPING = YES;
223241
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
224242
ENABLE_NS_ASSERTIONS = NO;
225243
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -235,6 +253,7 @@
235253
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
236254
MTL_ENABLE_DEBUG_INFO = NO;
237255
MTL_FAST_MATH = YES;
256+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
238257
SWIFT_COMPILATION_MODE = wholemodule;
239258
};
240259
name = Release;
@@ -246,6 +265,7 @@
246265
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
247266
CODE_SIGN_STYLE = Automatic;
248267
CURRENT_PROJECT_VERSION = 1;
268+
DEAD_CODE_STRIPPING = YES;
249269
ENABLE_APP_SANDBOX = YES;
250270
ENABLE_PREVIEWS = YES;
251271
ENABLE_USER_SELECTED_FILES = readonly;
@@ -288,6 +308,7 @@
288308
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
289309
CODE_SIGN_STYLE = Automatic;
290310
CURRENT_PROJECT_VERSION = 1;
311+
DEAD_CODE_STRIPPING = YES;
291312
ENABLE_APP_SANDBOX = YES;
292313
ENABLE_PREVIEWS = YES;
293314
ENABLE_USER_SELECTED_FILES = readonly;

example/iOSApp/Brownfield iOS App/Brownfield_iOS_AppApp.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import BrownfieldLib
2+
import ReactBrownfield
3+
import SwiftUI
4+
5+
class AppDelegate: NSObject, UIApplicationDelegate {
6+
var window: UIWindow?
7+
}
8+
9+
@main
10+
struct BrownfieldiOSApp: App {
11+
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
12+
13+
init() {
14+
ReactNativeBrownfield.shared.bundle = ReactNativeBundle
15+
ReactNativeBrownfield.shared.startReactNative {
16+
print("React Native has been loaded")
17+
}
18+
}
19+
20+
var body: some Scene {
21+
WindowGroup {
22+
ContentView()
23+
}
24+
}
25+
}
Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,59 @@
1-
//
2-
// ContentView.swift
3-
// Brownfield iOS App
4-
//
5-
// Created by Artur Morys-Magiera on 12/12/2025.
6-
//
7-
1+
import ReactBrownfield
82
import SwiftUI
93

104
struct ContentView: View {
115
var body: some View {
12-
VStack {
13-
Image(systemName: "globe")
14-
.imageScale(.large)
15-
.foregroundStyle(.tint)
16-
Text("Hello, world!")
6+
NavigationView {
7+
MainScreen()
8+
.padding(16)
9+
}
10+
}
11+
}
12+
13+
struct MainScreen: View {
14+
var body: some View {
15+
VStack(spacing: 16) {
16+
GreetingCard(name: "iOS")
17+
18+
ReactNativeView(moduleName: "RNApp")
19+
.navigationBarHidden(true)
20+
.clipShape(RoundedRectangle(cornerRadius: 16))
21+
.background(Color(UIColor.systemBackground))
1722
}
23+
.frame(maxWidth: .infinity, maxHeight: .infinity)
1824
.padding()
1925
}
2026
}
2127

28+
struct GreetingCard: View {
29+
let name: String
30+
@State private var counter: Int = 0
31+
32+
var body: some View {
33+
VStack(spacing: 12) {
34+
Text("Hello native \(name) 👋")
35+
.font(.title3)
36+
.multilineTextAlignment(.center)
37+
38+
Text(
39+
"You clicked the button \(counter) time\(counter == 1 ? "" : "s")"
40+
)
41+
.multilineTextAlignment(.center)
42+
.font(.body)
43+
44+
Button("Increment counter") {
45+
counter += 1
46+
}
47+
.buttonStyle(.borderedProminent)
48+
}
49+
.padding(16)
50+
.frame(maxWidth: .infinity)
51+
.background(Color(UIColor.secondarySystemBackground))
52+
.cornerRadius(16)
53+
.shadow(radius: 4)
54+
}
55+
}
56+
2257
#Preview {
2358
ContentView()
2459
}

0 commit comments

Comments
 (0)