Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// swift-tools-version: 6.0
// Built through React Native's SwiftPM autolinker, which links this package at
// <app>/build/generated/autolinking/libs/RNCPicker. The relative package paths
// resolve from there to the app's React Native xcframeworks and codegen output.
// This file has no scaffolder marker, so `react-native spm scaffold` leaves it alone.

import PackageDescription

let package = Package(
name: "RNCPicker",
platforms: [.iOS("15.1")],
products: [
.library(name: "RNCPicker", targets: ["RNCPickerTarget"]),
],
dependencies: [
.package(name: "ReactNative", path: "../../../../xcframeworks"),
.package(name: "React-GeneratedCode", path: "../../../ios"),
],
targets: [
// Not named RNCPicker: SwiftPM would take ios/RNCPicker.h as the umbrella
// header and then reject the RNCPicker.xcodeproj folder next to it,
// excluded or not. React Native links only the product, so the target
// name is free.
.target(
name: "RNCPickerTarget",
dependencies: [.product(name: "ReactHeaders", package: "ReactNative"), .product(name: "ReactNativeHeaders", package: "ReactNative"), .product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"), .product(name: "ReactAppHeaders", package: "React-GeneratedCode")],
path: "ios",
exclude: ["RNCPicker.xcodeproj"],
publicHeadersPath: ".",
// CocoaPods gets RCT_NEW_ARCH_ENABLED from install_modules_dependencies;
// without it every Fabric source compiles empty and the component is
// never registered.
cSettings: [.define("RCT_NEW_ARCH_ENABLED", to: "1"), .headerSearchPath(".")],
cxxSettings: [.define("RCT_NEW_ARCH_ENABLED", to: "1"), .headerSearchPath("."), .define("DEBUG", .when(configuration: .debug)), .define("NDEBUG", .when(configuration: .release))],
linkerSettings: [.linkedFramework("UIKit"), .linkedFramework("Foundation"), .linkedFramework("CoreGraphics")]
),
],
cxxLanguageStandard: .cxx20
)
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"typings",
"windows",
"react-native.config.js",
"RNCPicker.podspec"
"RNCPicker.podspec",
"Package.swift"
],
"react-native-builder-bob": {
"source": "js",
Expand Down Expand Up @@ -180,5 +181,8 @@
"workspaces": [
"example"
],
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.1.1",
"swiftpmConfig": {
"name": "RNCPicker"
}
}