Skip to content

Commit

Permalink
Merge pull request #44 from thanhcuong1990/master
Browse files Browse the repository at this point in the history
Fix crash `Exception 'accessing _cachedSystemAnimationFence requires …
  • Loading branch information
douglasjunior authored Apr 2, 2019
2 parents 4e9ff7e + 70fc423 commit 0b9105c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ios/ReactNativeKeyboardManager/ReactNativeKeyboardManager.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// MIT License
//
//
// Copyright (c) 2017 Douglas Nassif Roma Junior
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -70,8 +70,10 @@ + (BOOL)requiresMainQueueSetup
// UIKeyboard handling

RCT_EXPORT_METHOD(setEnable: (BOOL) enabled) {
if (debugging) RCTLogInfo(@"KeyboardManager.setEnable: %d", enabled);
[[IQKeyboardManager sharedManager] setEnable:enabled];
dispatch_sync(dispatch_get_main_queue(), ^{
if (debugging) RCTLogInfo(@"KeyboardManager.setEnable: %d", enabled);
[[IQKeyboardManager sharedManager] setEnable:enabled];
});
}

RCT_EXPORT_METHOD(setKeyboardDistanceFromTextField: (CGFloat) distance) {
Expand All @@ -96,8 +98,10 @@ + (BOOL)requiresMainQueueSetup
}

RCT_EXPORT_METHOD(setEnableAutoToolbar: (BOOL) enabled) {
if (debugging) RCTLogInfo(@"KeyboardManager.setEnableAutoToolbar: %d", enabled);
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:enabled];
dispatch_sync(dispatch_get_main_queue(), ^{
if (debugging) RCTLogInfo(@"KeyboardManager.setEnableAutoToolbar: %d", enabled);
[[IQKeyboardManager sharedManager] setEnableAutoToolbar:enabled];
});
}

RCT_EXPORT_METHOD(setShouldToolbarUsesTextFieldTintColor: (BOOL) enabled) {
Expand Down

0 comments on commit 0b9105c

Please sign in to comment.