Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ android/keystores/debug.keystore
packages/react-native-avoid-softinput/lib/

.npmrc

# SPM
.build/
.swiftpm/
62 changes: 62 additions & 0 deletions packages/react-native-avoid-softinput/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// swift-tools-version: 6.0
import PackageDescription

let package = Package(
name: "ReactNativeAvoidSoftinput",
platforms: [.iOS(.v15)],
products: [
.library(name: "ReactNativeAvoidSoftinput", targets: ["ReactNativeAvoidSoftinput"])
],
dependencies: [
.package(name: "ReactNative", path: "../../../../xcframeworks"),
.package(name: "React-GeneratedCode", path: "../../../ios"),
],
targets: [
.target(
name: "ReactNativeAvoidSoftinput",
dependencies: [
.product(name: "ReactHeaders", package: "ReactNative"),
.product(name: "ReactNativeHeaders", package: "ReactNative"),
.product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"),
.product(name: "ReactAppHeaders", package: "React-GeneratedCode"),
],
path: ".",
sources: [
"ios/AvoidSoftInput.h",
"ios/AvoidSoftInput.mm",
"ios/AvoidSoftInputAnimationHandler.h",
"ios/AvoidSoftInputAnimationHandler.mm",
"ios/AvoidSoftInputAnimator.h",
"ios/AvoidSoftInputAnimator.mm",
"ios/AvoidSoftInputConstants.h",
"ios/AvoidSoftInputConstants.mm",
"ios/AvoidSoftInputListener.h",
"ios/AvoidSoftInputListener.mm",
"ios/AvoidSoftInputManager.h",
"ios/AvoidSoftInputManager.mm",
"ios/AvoidSoftInputUtils.h",
"ios/AvoidSoftInputUtils.mm",
"ios/AvoidSoftInputViewComponentView.h",
"ios/AvoidSoftInputViewComponentView.mm",
"ios/RCTConvert+UIViewAnimationOptions.h",
"ios/RCTConvert+UIViewAnimationOptions.mm",
],
publicHeadersPath: "ios",
cSettings: [
.headerSearchPath("ios"),
.define("REACT_NATIVE_AVOID_SOFTINPUT_USING_SPM")
],
cxxSettings: [
.headerSearchPath("ios"),
.define("REACT_NATIVE_AVOID_SOFTINPUT_USING_SPM"),
.define("DEBUG", .when(configuration: .debug)),
.define("NDEBUG", .when(configuration: .release))
],
linkerSettings: [
.linkedFramework("UIKit"),
.linkedFramework("Foundation")
]
)
],
cxxLanguageStandard: .cxx20
)
4 changes: 1 addition & 3 deletions packages/react-native-avoid-softinput/ios/AvoidSoftInput.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#import <React/RCTEventEmitter.h>

#import "rnavoidsoftinput.h"

@class AvoidSoftInputConstants;
@class AvoidSoftInputManager;
@protocol AvoidSoftInputManagerDelegate;

@interface AvoidSoftInput : RCTEventEmitter <NativeAvoidSoftInputModuleSpec>
@interface AvoidSoftInput : RCTEventEmitter

@property (nonatomic, readonly, strong) AvoidSoftInputManager *_Nonnull manager;

Expand Down
9 changes: 9 additions & 0 deletions packages/react-native-avoid-softinput/ios/AvoidSoftInput.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
#import "AvoidSoftInputManager.h"
#import "RCTConvert+UIViewAnimationOptions.h"

#ifdef REACT_NATIVE_AVOID_SOFTINPUT_USING_SPM
#import <rnavoidsoftinput/rnavoidsoftinput.h>
#else
#import "rnavoidsoftinput.h"
#endif

@interface AvoidSoftInput () <NativeAvoidSoftInputModuleSpec>
@end

@interface AvoidSoftInput () <AvoidSoftInputManagerDelegate>
@end

Expand Down
1 change: 1 addition & 0 deletions packages/react-native-avoid-softinput/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"android",
"ios",
"cpp",
"Package.swift",
"ReactNativeAvoidSoftinput.podspec",
"jest",
"LICENSE",
Expand Down
Loading