Skip to content

Commit c5c57b6

Browse files
author
Alexei Danilovich
committed
# Conflicts: # package.json
2 parents 3d33fe1 + 10af70f commit c5c57b6

File tree

6 files changed

+114
-5
lines changed

6 files changed

+114
-5
lines changed

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,73 @@ Text input mask for React Native on iOS and Android.
1717

1818
```bash
1919
npm install --save react-native-text-input-mask
20+
# --- or ---
21+
yarn add react-native-text-input-mask
22+
```
23+
24+
# Installation
25+
26+
<details>
27+
<summary><b>For RN >= 0.61</b></summary>
28+
29+
#### iOS
30+
31+
1. Add following lines to your target in `Podfile`
32+
```
33+
use_frameworks!
34+
pod 'RNInputMask', :path => '../node_modules/react-native-text-input-mask/ios/InputMask'
35+
```
36+
2. Run following command
37+
```bash
38+
cd ios && pod install
39+
```
40+
41+
#### Android
42+
43+
No need to do anything.
44+
45+
</details>
46+
47+
<details>
48+
<summary><b>For RN = 0.60.*</b></summary>
49+
50+
#### iOS
51+
52+
1. In XCode, in the project navigator, right click your `[your project's name]` folder, choose ➜ `Add Files to [your project's name]`
53+
54+
![Create Swift File](https://i.imgur.com/00K5UZ1.png)
55+
56+
2. Select `Swift File``Next`
57+
58+
![Create Swift File](https://i.imgur.com/Mdc9MLk.png)
59+
60+
3. Specify name for example `Dummy.swift``Create`
61+
62+
![Create Swift File](https://i.imgur.com/2HSk7Jp.png)
63+
64+
4. Now a pop up is shown select `Create Bridging Header`
65+
66+
![Create Swift File](https://i.imgur.com/f2zA0n9.png)
67+
68+
5. Add following line to your target in `Podfile`
69+
```
70+
pod 'RNInputMask', :path => '../node_modules/react-native-text-input-mask/ios/InputMask'
71+
```
72+
6. Run following command
73+
```bash
74+
cd ios && pod install
75+
```
76+
77+
#### Android
78+
79+
No need to do anything.
80+
81+
</details>
82+
83+
<details><summary><b>For RN < 0.60</b></summary>
84+
85+
### Auto Linking
86+
```bash
2087
react-native link react-native-text-input-mask
2188
```
2289

@@ -26,13 +93,12 @@ react-native link react-native-text-input-mask
2693

2794
### Manual installation
2895

29-
3096
#### iOS
3197

3298
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
3399
2. Go to `node_modules``react-native-text-input-mask` and add `RNTextInputMask.xcodeproj`
34100
3. In XCode, in the project navigator, select your project. Add `libRNTextInputMask.a` to your project's `Build Phases``Link Binary With Libraries`
35-
4. Run your project (`Cmd+R`)<
101+
4. Run your project (`Cmd+R`)
36102

37103
#### Android
38104

@@ -48,6 +114,7 @@ react-native link react-native-text-input-mask
48114
```
49115
compile project(':react-native-text-input-mask')
50116
```
117+
</details>
51118

52119
## Usage
53120

ios/InputMask/RNInputMask.podspec

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Pod::Spec.new do |spec|
2+
spec.name = "RNInputMask"
3+
spec.version = "4.1.0"
4+
spec.summary = "InputMask"
5+
spec.description = "User input masking library."
6+
spec.homepage = "https://github.com/RedMadRobot/input-mask-ios"
7+
spec.license = "MIT"
8+
spec.author = { "Egor Taflanidi" => "et@redmadrobot.com" }
9+
spec.source = { :git => "https://github.com/RedMadRobot/input-mask-ios.git", :tag => spec.version.to_s }
10+
spec.platform = :ios, "8.0"
11+
spec.requires_arc = true
12+
spec.source_files = "InputMask/Classes/**/*"
13+
spec.swift_version = "5.0"
14+
end

ios/RNTextInputMask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import <React/RCTBridgeModule.h>
22

3-
@import InputMask;
3+
@import RNInputMask;
44

55
@interface RNTextInputMask : NSObject <RCTBridgeModule, MaskedTextFieldDelegateListener>
66
@end

ios/RNTextInputMask.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#import "RCTUITextField.h"
66
#import "RNTextInputMask.h"
77

8-
@import InputMask;
8+
@import RNInputMask;
99

1010
@implementation RNTextInputMask {
1111
NSMutableDictionary *masks;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-text-input-mask",
3-
"version": "1.0.7",
3+
"version": "2.0.0",
44
"description": "Text input mask for React Native.",
55
"main": "index.js",
66
"repository": {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Be sure to run `pod lib lint RNTextInputMask.podspec' to ensure this is a
3+
# valid spec before submitting.
4+
#
5+
# Any lines starting with a # are optional, but their use is encouraged
6+
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7+
#
8+
9+
require 'json'
10+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
11+
12+
Pod::Spec.new do |s|
13+
s.name = package['name']
14+
s.version = package['version']
15+
s.summary = package['description']
16+
s.description = package['description']
17+
s.homepage = package['homepage']
18+
s.license = package['license']
19+
s.author = package['author']
20+
s.license = { :type => 'MIT', :file => 'LICENSE' }
21+
s.source = { :git => 'https://github.com/react-native-community/react-native-text-input-mask.git', :tag => s.version.to_s }
22+
23+
s.ios.deployment_target = '8.0'
24+
25+
s.source_files = "ios/**/*.{h,m}"
26+
s.dependency 'React'
27+
s.dependency 'RNInputMask'
28+
end

0 commit comments

Comments
 (0)