Skip to content

Commit 04faad2

Browse files
duom青源duom青源
authored andcommitted
feat: change ios structure
1 parent c03149a commit 04faad2

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

example/ios/Podfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ target 'VariableTextInputExample' do
5555
# necessary for Mac Catalyst builds
5656
:mac_catalyst_enabled => false
5757
)
58+
# NOTE: Change IPHONEOS_DEPLOYMENT_TARGET to 12.4.
59+
installer.pods_project.targets.each do |target|
60+
target.build_configurations.each do |config|
61+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
62+
end
63+
end
5864
__apply_Xcode_12_5_M1_post_install_workaround(installer)
5965
end
6066
end

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,6 @@ SPEC CHECKSUMS:
624624
Yoga: 79dd7410de6f8ad73a77c868d3d368843f0c93e0
625625
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
626626

627-
PODFILE CHECKSUM: 0ae1cc8a442824ae433ba7b6a9a18d36a5cd4696
627+
PODFILE CHECKSUM: 43569e7a31a8524b23dd56412400f293ae2c924d
628628

629629
COCOAPODS: 1.12.0

example/src/App.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ export const App = () => {
7676
{'blur'}
7777
</Text>
7878
</TouchableOpacity>
79-
<TouchableOpacity onPress={focus} style={{ marginLeft: 20 }}>
79+
<TouchableOpacity onPress={focus} style={{ marginLeft: 10 }}>
8080
<Text style={{ backgroundColor: 'yellow', color: 'red' }}>
8181
{'focus'}
8282
</Text>
8383
</TouchableOpacity>
84-
<TouchableOpacity onPress={insertMonthons} style={{ marginLeft: 20 }}>
84+
<TouchableOpacity onPress={insertMonthons} style={{ marginLeft: 10 }}>
8585
<Text style={{ backgroundColor: 'yellow', color: 'red' }}>
8686
{'insertMonthons'}
8787
</Text>
8888
</TouchableOpacity>
89-
<TouchableOpacity onPress={insertEmoji} style={{ marginLeft: 20 }}>
89+
<TouchableOpacity onPress={insertEmoji} style={{ marginLeft: 10 }}>
9090
<Text style={{ backgroundColor: 'yellow', color: 'red' }}>
9191
{'insertEmoji'}
9292
</Text>
9393
</TouchableOpacity>
9494
<TouchableOpacity
9595
onPress={changeAttributedText}
96-
style={{ marginLeft: 20 }}
96+
style={{ marginLeft: 10 }}
9797
>
9898
<Text style={{ backgroundColor: 'yellow', color: 'red' }}>
99-
{'insertEmoji'}
99+
{'changeAttributedText'}
100100
</Text>
101101
</TouchableOpacity>
102102
</View>

ios/VariableTextInputViewManager.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ -(void)insertTextEmoji:(NSDictionary *)rnImageData{
172172
self.typingAttributes = self.textInput.typingAttributes;
173173
EmojiTextAttachment *emojiTextAttachment = [EmojiTextAttachment new];
174174
//Set tag and image
175-
emojiTextAttachment.emojiTag = rnImageData[@"tag"];
175+
emojiTextAttachment.emojiTag = rnImageData[@"emojiTag"];
176176
UIImage *image =[RCTConvert UIImage:rnImageData[@"img"]];
177-
emojiTextAttachment.showCopyStr =rnImageData[@"tag"];
178-
if ([self isOutMaxLength:rnImageData[@"tag"]]) {
177+
emojiTextAttachment.showCopyStr =rnImageData[@"emojiTag"];
178+
if ([self isOutMaxLength:rnImageData[@"emojiTag"]]) {
179179
return;
180180
}
181181
emojiTextAttachment.image = image;
@@ -225,13 +225,13 @@ -(void)setAttributedText:(NSArray *)arr{
225225
[attStr appendAttributedString:normMutaStr];
226226
}
227227
if(type == 1){
228-
NSDictionary *rnImageData = [RCTConvert NSDictionary:dic[@"emojiData"]];
228+
NSDictionary *rnImageData = dic;
229229
EmojiTextAttachment *emojiTextAttachment = [EmojiTextAttachment new];
230230
//Set tag and image
231-
emojiTextAttachment.emojiTag = rnImageData[@"tag"];
231+
emojiTextAttachment.emojiTag = rnImageData[@"emojiTag"];
232232
UIImage *image =[RCTConvert UIImage:rnImageData[@"img"]];
233-
emojiTextAttachment.showCopyStr =rnImageData[@"tag"];
234-
if ([self isOutMaxLength:rnImageData[@"tag"]]) {
233+
emojiTextAttachment.showCopyStr =rnImageData[@"emojiTag"];
234+
if ([self isOutMaxLength:rnImageData[@"emojiTag"]]) {
235235
return;
236236
}
237237
emojiTextAttachment.image = image;
@@ -241,7 +241,7 @@ -(void)setAttributedText:(NSArray *)arr{
241241
[attStr appendAttributedString:str];
242242
}
243243
if(type == 2){
244-
NSDictionary *mention =[RCTConvert NSDictionary:dic[@"targData"]];
244+
NSDictionary *mention =dic;
245245
NSString *tag = [RCTConvert NSString:mention[@"tag"]];
246246
NSString *name =[RCTConvert NSString:mention[@"name"]];
247247
UIColor *color = [RCTConvert UIColor:mention[@"color"]];

0 commit comments

Comments
 (0)