TPKeyboardAvoiding
TPKeyboardAvoiding copied to clipboard
These two places often crash,I used the inputview
Any idea what's going on here? I have the exact same issue.
Same Issue. I am creating an instance of TPKeyboardAvoidingScrollView for my scroll view.
UIScrollView *scrollView = [[TPKeyboardAvoidingScrollView alloc]initWithFrame:CGRectNull];
Also, the keyboard fails to show up when the crash happens. On other views where ScrollView is not required, keyboard works fine (E.g. Search Bar in a Table View).
Error Details: Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [-4.25 nan]'
Stack Trace:
0 CoreFoundation 0x0000000108d6de65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010845adeb objc_exception_throw + 48
2 CoreFoundation 0x0000000108d6dd9d +[NSException raise:format:] + 205
3 QuartzCore 0x000000010e4cca86 _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152
4 QuartzCore 0x000000010e4ccbf9 -[CALayer setPosition:] + 44
5 QuartzCore 0x000000010e4cd25d -[CALayer setFrame:] + 650
6 UIKit 0x000000010966725f -[UIView(Geometry) setFrame:] + 356
7 UIKit 0x00000001097d12ad -[UIImageView _setViewGeometry:forMetric:] + 255
8 UIKit 0x00000001097d1514 -[UIImageView setFrame:] + 58
9 UIKit 0x000000010969e942 -[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 5461
10 **** 0x0000000107d3dbb9 -[UIScrollView(TPKeyboardAvoidingAdditions) TPKeyboardAvoiding_keyboardWillShow:] + 3097
11 CoreFoundation 0x0000000108d3a69c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
EDIT: My case may be a little different. I am able to reproduce it 100% on simulator. The TextField uses UIKeyboardTypeNumberPad. Use case:
- User taps on TextField fills in the number.
- User taps on Next Button on Navigation Bar to navigate to next view.
It does not crash for following use case:
- User taps on TextField fills in the number.
- User taps on scroll view. Keyboard Dismisses.
- User taps on Next Button on Navigation Bar to navigate to next view.
Should I explicitly dismiss keyboard before navigating to next view ?
Hey @rachin-pepo - would you be able to make/adapt a sample app demonstrating this issue?