-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXC_BAD_ACCESS during autocapture of layer borderColor #226
Comments
Hey @jadar! Thanx for reporting this. I'll take a look. From the screenshot, it seems you are assigning a named color from an asset catalog or color set. Could you confirm if there are any specific settings adjusted in the Attribute Inspector? My initial thought is that the color may is not RGB scale (grayscale?) and we may not handle that case correctly. In the meantime, you might try enabling screenshot mode to bypass this issue temporarily. |
@ioannisj would a simple try/catch here works as a quick win? |
No, I don't think so since there are no throwing functions involved here. |
@ioannisj I think you can do this:
Can you validate if that would help? |
Digging a bit deeper on this one, it seems that the real underlying issue is not the color space (since we were safe with the components.count >= 3 part) but the fact that all named/dynamic colors from the interface builder get their true values set after viewDidLoad. I imagine this is because the view needs to be fully loaded to check the traits before assigning a Adding the RGB check will only handle the cases where the dynamic color happens to be gray scale (and it's an additional check other that components.count which won't crash), but that's not the ultimate reason for the crash 🤔 Printing out layer.borderColor.numberOfComponents prints out some random values like |
You're correct that the color comes from an asset catalog. The settings are sRGB with a hexadecimal value of #676767, with 100% opacity. Here's the full contents: ButtonTitleGray.colorset/Contents.json{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x67",
"green" : "0x67",
"red" : "0x67"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
I did end up using this workaround as well. I removed references to the custom color in the project, which allowed it to function without crashing. However, the default session capture did not function properly at all, as nothing was distinguishable in the capture. |
Are you referring here to the session recording having some blacked out content. You can try experimenting with A temporary fix on the crash should be out soon btw, I'll let you know once it's out. Hope that helps |
It's a little out of the scope of this issue, and I don't know what exactly was the issue, but it appeared all the UI elements were clustered in the top left part of the screen. |
Hey @jadar, fyi fix for this bug has been release with 3.14.0 Regarding the session recording issue, can you please open a bug report when you get a chance with some screenshots? I have a feeling you are describing an issue with wireframe mode and not screenshot mode. |
Thank you! |
Version
3.13.3
Steps to Reproduce
layer.borderColor
in the Storyboard file.Expected Result
No crash
Actual Result
The text was updated successfully, but these errors were encountered: