Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

iOS 14 Crash when setting label line break mode, text alignment and text color

$
0
0

I've been using React Native SVG for a project and with the upgrade to iOS 14 I've started to receive a crash on a resizable box. I've tracked the crash down to three assignments in a library but am unsure of why they cause a EXEC_BAD_INSTRUCTION or a EXC_BAD_ACCESS.

This crash occurs only after the initial render within the app when you resize the box. The first render is fine and then the subsequent move of the item causes the fault. This code worked in iOS 13 but does not in iOS 14.

I've created a reproducible example here. I've also created an issue on the repo here.

In the library I've attempted to hard code the assignments to known good values assuming something went wrong with how they were being assigned with no luck.

The following is where I receive the error:

label.attributedText = (__bridge NSAttributedString * _Nullable)(attrString);label.baselineAdjustment = UIBaselineAdjustmentNone;//label.lineBreakMode = NSLineBreakByWordWrapping;label.backgroundColor = UIColor.clearColor;//label.textAlignment = NSTextAlignmentRight;label.numberOfLines = 0;label.opaque = NO;label.font = font;//label.textColor = [UIColor colorWithCGColor:color];

This is from line 203 in RNSVGTSpan, the comments are the lines I've removed to make it work but this takes away functionality that is used.

I'm at a loss as to why this would work on the initial render but not with the subsequent changes in iOS 14 but works flawlessly in iOS 13.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>