Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit cfba250

Browse files
authored
Adding TextInput basic iOS API (#14)
* Revert "Remove ios implementation (#6)" This reverts commit c1ca314. c1ca314 * build project on iOS * draft iOS impl of TextInput multiline with over-ride bg color * copy logic PR in the TextInputImproved component * text shows in the TextInput, but adding shadownode causes issues * minor changes * refactor iOS TextView to RCTSinglelineTextInputViewImproved * rename react-native-text to react-native-improved refactor and add textinput ios component * remove not required logic * remove xcode env * remove js TextInput api from src
1 parent 5f6ed4c commit cfba250

18 files changed

+698
-11
lines changed

example/Gemfile.lock

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.6)
5+
rexml
6+
activesupport (7.0.8)
7+
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
i18n (>= 1.6, < 2)
9+
minitest (>= 5.1)
10+
tzinfo (~> 2.0)
11+
addressable (2.8.6)
12+
public_suffix (>= 2.0.2, < 6.0)
13+
algoliasearch (1.27.5)
14+
httpclient (~> 2.8, >= 2.8.3)
15+
json (>= 1.5.1)
16+
atomos (0.1.3)
17+
claide (1.1.0)
18+
cocoapods (1.14.3)
19+
addressable (~> 2.8)
20+
claide (>= 1.0.2, < 2.0)
21+
cocoapods-core (= 1.14.3)
22+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23+
cocoapods-downloader (>= 2.1, < 3.0)
24+
cocoapods-plugins (>= 1.0.0, < 2.0)
25+
cocoapods-search (>= 1.0.0, < 2.0)
26+
cocoapods-trunk (>= 1.6.0, < 2.0)
27+
cocoapods-try (>= 1.1.0, < 2.0)
28+
colored2 (~> 3.1)
29+
escape (~> 0.0.4)
30+
fourflusher (>= 2.3.0, < 3.0)
31+
gh_inspector (~> 1.0)
32+
molinillo (~> 0.8.0)
33+
nap (~> 1.0)
34+
ruby-macho (>= 2.3.0, < 3.0)
35+
xcodeproj (>= 1.23.0, < 2.0)
36+
cocoapods-core (1.14.3)
37+
activesupport (>= 5.0, < 8)
38+
addressable (~> 2.8)
39+
algoliasearch (~> 1.0)
40+
concurrent-ruby (~> 1.1)
41+
fuzzy_match (~> 2.0.4)
42+
nap (~> 1.0)
43+
netrc (~> 0.11)
44+
public_suffix (~> 4.0)
45+
typhoeus (~> 1.0)
46+
cocoapods-deintegrate (1.0.5)
47+
cocoapods-downloader (2.1)
48+
cocoapods-plugins (1.0.0)
49+
nap
50+
cocoapods-search (1.0.1)
51+
cocoapods-trunk (1.6.0)
52+
nap (>= 0.8, < 2.0)
53+
netrc (~> 0.11)
54+
cocoapods-try (1.2.0)
55+
colored2 (3.1.2)
56+
concurrent-ruby (1.2.3)
57+
escape (0.0.4)
58+
ethon (0.16.0)
59+
ffi (>= 1.15.0)
60+
ffi (1.16.3)
61+
fourflusher (2.3.1)
62+
fuzzy_match (2.0.4)
63+
gh_inspector (1.1.3)
64+
httpclient (2.8.3)
65+
i18n (1.14.1)
66+
concurrent-ruby (~> 1.0)
67+
json (2.7.1)
68+
minitest (5.21.2)
69+
molinillo (0.8.0)
70+
nanaimo (0.3.0)
71+
nap (1.1.0)
72+
netrc (0.11.0)
73+
public_suffix (4.0.7)
74+
rexml (3.2.6)
75+
ruby-macho (2.5.1)
76+
typhoeus (1.4.1)
77+
ethon (>= 0.9.0)
78+
tzinfo (2.0.6)
79+
concurrent-ruby (~> 1.0)
80+
xcodeproj (1.23.0)
81+
CFPropertyList (>= 2.3.3, < 4.0)
82+
atomos (~> 0.1.3)
83+
claide (>= 1.0.2, < 2.0)
84+
colored2 (~> 3.1)
85+
nanaimo (~> 0.3.0)
86+
rexml (~> 3.2.4)
87+
88+
PLATFORMS
89+
ruby
90+
91+
DEPENDENCIES
92+
activesupport (>= 6.1.7.3, < 7.1.0)
93+
cocoapods (~> 1.13)
94+
95+
RUBY VERSION
96+
ruby 2.7.5p203
97+
98+
BUNDLED WITH
99+
2.1.4

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ PODS:
944944
- React-Mapbuffer (0.73.0):
945945
- glog
946946
- React-debug
947-
- react-native-text (0.1.8):
947+
- react-native-improved (0.1.8):
948948
- glog
949949
- RCT-Folly (= 2022.05.16.00)
950950
- React-Core
@@ -1171,7 +1171,7 @@ DEPENDENCIES:
11711171
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector-modern`)
11721172
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
11731173
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
1174-
- react-native-text (from `../..`)
1174+
- react-native-improved (from `../..`)
11751175
- React-nativeconfig (from `../node_modules/react-native/ReactCommon`)
11761176
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
11771177
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
@@ -1266,7 +1266,7 @@ EXTERNAL SOURCES:
12661266
:path: "../node_modules/react-native/ReactCommon/logger"
12671267
React-Mapbuffer:
12681268
:path: "../node_modules/react-native/ReactCommon"
1269-
react-native-text:
1269+
react-native-improved:
12701270
:path: "../.."
12711271
React-nativeconfig:
12721272
:path: "../node_modules/react-native/ReactCommon"
@@ -1351,7 +1351,7 @@ SPEC CHECKSUMS:
13511351
React-jsinspector: 9f6fb9ed9f03a0fb961ab8dc2e0e0ee0dc729e77
13521352
React-logger: 008caec0d6a587abc1e71be21bfac5ba1662fe6a
13531353
React-Mapbuffer: 58fe558faf52ecde6705376700f848d0293d1cef
1354-
react-native-text: 83ab23e90480b1bc84541067c5f2096c8ebe3559
1354+
react-native-improved: c8616d377654ca6505f12390ee31ab275f74c410
13551355
React-nativeconfig: a063483672b8add47a4875b0281e202908ff6747
13561356
React-NativeModulesApple: 169506a5fd708ab22811f76ee06a976595c367a1
13571357
React-perflogger: b61e5db8e5167f5e70366e820766c492847c082e

example/src/App.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import * as React from 'react';
22

3-
import { ScrollView, View, StyleSheet, Text, TextInput } from 'react-native';
4-
import { TextScreen } from './TextScreen';
3+
import { View, StyleSheet, Text, TextInput } from 'react-native';
54
import { TextInputScreen } from './TextInputScreen';
65

76
export default function App() {
8-
const email =
9-
107
return <CurrentScreen />;
118
}
129

example/src/TextInputScreen.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export function TextInputScreen() {
66
return (
77
<View style={styles.container}>
88
<TextInput
9+
numberOfLines={1}
910
onChangeText={(text) => {
1011
console.log('onChangeText text is: ', text);
1112
setText(text);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
#import "RCTBaseTextShadowView.h"
9+
#import <React/RCTBaseTextInputShadowView.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface RCTBaseTextInputShadowViewImproved : RCTBaseTextInputShadowView
14+
15+
- (instancetype)initWithBridge:(RCTBridge *)bridge;
16+
17+
@property (nonatomic, copy, nullable) NSString *text;
18+
@property (nonatomic, copy, nullable) NSString *placeholder;
19+
@property (nonatomic, assign) NSInteger maximumNumberOfLines;
20+
@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange;
21+
22+
- (void)uiManagerWillPerformMounting;
23+
24+
@end
25+
26+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)