iDhaval/DTTextField

DTTextField Crash

WilliamBlais opened this issue · 4 comments

Hi!

Some users are getting this error when using DTTextField;

Crashed: com.apple.main-thread
0 DTTextField 0x104209498 specialized DTTextField.insetRectForBounds(rect : CGRect) -> CGRect (DTTextField.swift:285)
1 DTTextField 0x104206324 @objc DTTextField.textRect(forBounds : CGRect) -> CGRect + 344
2 UIKit 0x18cfec0fc -[UITextField _marginTopForBounds:] + 184
3 UIKit 0x18c428c70 -[UITextField _originForTextFieldLabel:] + 128
4 UIKit 0x18c4209f4 -[UIFieldEditor textContainerOrigin] + 212
5 UIFoundation 0x1a11c27b0 -[NSLayoutManager _primitiveInvalidateDisplayForGlyphRange:] + 2836
6 UIFoundation 0x1a11c2f34 -[NSLayoutManager invalidateDisplayForCharacterRange:] + 436
7 UIFoundation 0x1a119cbc0 -[NSLayoutManager(NSPrivate) _setExtraLineFragmentRect:usedRect:textContainer:] + 416
8 UIFoundation 0x1a11f952c -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] + 6060
9 UIFoundation 0x1a11a0c94 -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] + 364
10 UIFoundation 0x1a11bfc28 -[NSLayoutManager setTextStorage:] + 720
11 UIFoundation 0x1a11e97a8 -[NSTextStorage addLayoutManager:] + 100
12 UIKit 0x18c755040 -[UIFieldEditor initWithTextField:textStorage:] + 752
13 UIKit 0x18c429b38 -[UITextField _fieldEditor] + 196
14 UIKit 0x18cff6700 -[UITextField _initContentView] + 60
15 UIKit 0x18cfe928c -[UITextField initWithCoder:] + 1680
16 DTTextField 0x10420898c specialized DTTextField.init(coder : NSCoder) -> DTTextField? (DTTextField.swift:166)
17 DTTextField 0x1042050e4 @objc DTTextField.init(coder : NSCoder) -> DTTextField? (DTTextField.swift)
18 UIKit 0x18c963fb4 -[UIClassSwapper initWithCoder:] + 248
19 UIKit 0x18cb01d24 UINibDecoderDecodeObjectForValue + 680
20 UIKit 0x18cb01a64 -[UINibDecoder decodeObjectForKey:] + 104
21 UIKit 0x18c963c24 -[UIRuntimeConnection initWithCoder:] + 136
22 UIKit 0x18c9643f8 -[UIRuntimeEventConnection initWithCoder:] + 68
23 UIKit 0x18cb01d24 UINibDecoderDecodeObjectForValue + 680
24 UIKit 0x18cb01e9c UINibDecoderDecodeObjectForValue + 1056
25 UIKit 0x18cb01a64 -[UINibDecoder decodeObjectForKey:] + 104
26 UIKit 0x18c962f98 -[UINib instantiateWithOwner:options:] + 1168
27 UIKit 0x18c7632cc -[UIViewController _loadViewFromNibNamed:bundle:] + 372
28 UIKit 0x18c525dd4 -[UIViewController loadView] + 176
29 UIKit 0x18c4f6ca8 -[UITableViewController loadView] + 92
30 UIKit 0x18c406dd8 -[UIViewController loadViewIfRequired] + 184
31 UIKit 0x18c4af870 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 76
32 UIKit 0x18c4aed00 -[UINavigationController _startTransition:fromViewController:toViewController:] + 196
33 UIKit 0x18c4ae6e8 -[UINavigationController _startDeferredTransitionIfNeeded:] + 876
34 UIKit 0x18c4ae254 -[UINavigationController __viewWillLayoutSubviews] + 156
35 UIKit 0x18c4ae15c -[UILayoutContainerView layoutSubviews] + 188
36 UIKit 0x18c4044f0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1224
37 QuartzCore 0x18b920a84 -[CALayer layoutSublayers] + 148
38 QuartzCore 0x18b914d70 CA::Layer::layout_if_needed(CA::Transaction*) + 296
39 QuartzCore 0x18b914c2c CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
40 QuartzCore 0x18b88b88c CA::Context::commit_transaction(CA::Transaction*) + 276
41 QuartzCore 0x18b8b2ae4 CA::Transaction::commit() + 520
42 QuartzCore 0x18b8b361c CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
43 CoreFoundation 0x18558c6e4 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32
44 CoreFoundation 0x18558a18c __CFRunLoopDoObservers + 412
45 CoreFoundation 0x18558a670 __CFRunLoopRun + 1076
46 CoreFoundation 0x1854a503c CFRunLoopRunSpecific + 436
47 GraphicsServices 0x195cfaf94 GSEventRunModal + 100
48 UIKit 0x18c46a86c UIApplicationMain + 208
49 0x103e7db80 main (LoginViewController.swift:16)
50 libdyld.dylib 0x1a8c37d1c start + 4

Does someone have any ideas why there's this crash?

Thanks!
W

Yes even i got this crash in iOS 11. i am not understanding why, any ideas?

fileprivate func insetRectForBounds(rect:CGRect) -> CGRect {

   // guard !lblFloatPlaceholder.text!.isEmptyStr else { return insetRectForEmptyBounds(rect: rect) }

Just comment the above line, got it work.

Hey,
I have resolved that crash. you can update your pod.
Kindly close this issue
Thank you

@iDhaval Thank you! I don't think I can close it myself.