Skip to content

Instantly share code, notes, and snippets.

View okwasniewski's full-sized avatar
💭
💻

Oskar Kwaśniewski okwasniewski

💭
💻
View GitHub Profile
@okwasniewski
okwasniewski / Podfile
Created January 16, 2025 08:20
swift-modular-headers-blog-post-2
target 'MyApp' do
pod 'SomeLibrary', :modular_headers => true
end
@okwasniewski
okwasniewski / Podfile
Created January 16, 2025 08:19
swift-modular-headers-blog-post-1
target 'MyApp' do
pod 'SomeLibrary'
end
@main
struct BrownfieldSwiftUIApp: App {
@UIApplicationDelegateAdaptor var delegate: AppDelegate
var body: some Scene {
WindowGroup {
TabView {
ContentView()
.tabItem {
Label("Home", systemImage: "house")
const ReactNativeScreen = ({ prop1 }) => // ...
rootViewFactory.view(withModuleName: moduleName, initialProperties: ["prop1": "test"])
AppRegistry.registerComponent('ReactNativeScreen', () => App)
@okwasniewski
okwasniewski / ReactNativeView.swift
Created September 30, 2024 14:18
ReactNativeView.swift
struct ReactNativeView: UIViewRepresentable {
var moduleName: String
var rootViewFactory: RCTRootViewFactory
func makeUIView(context: Context) -> UIView {
return rootViewFactory.view(withModuleName: moduleName)
}
func updateUIView(_ uiView: UIView, context: Context) {
// noop
@main
struct BrownfieldSwiftUIApp: App {
@UIApplicationDelegateAdaptor var delegate: AppDelegate
var body: some Scene {
WindowGroup {
TabView {
ContentView()
.tabItem {
Label("Home", systemImage: "house")
import UIKit
import React
import React_RCTAppDelegate
class AppDelegate: RCTAppDelegate {
// ... application didFinishLaunchingWithOptions
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
import UIKit
import React
import React_RCTAppDelegate
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// Do any setup your app needs
self.automaticallyLoadReactNativeWindow = false
// Remember to call super