Since Xcode 10 on iOS, the following is crashing with:
[Animation] +[UIView setAnimationsEnabled:] being called from a background thread. Performing any operation from a background thread on UIView or a subclass is not supported and may result in unexpected and insidious behavior. trace=...
when launched from background thread.
+(UIImage *)circularImage:(UIImage *)image withDiameter:(NSUInteger)diameter
{
CGRect frame = CGRectMake(0.0f, 0.0f, diameter, diameter);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame];
imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.clipsToBounds = YES;
[imageView setImage:image]; <--- crashing here
...
}
Is that normal that I can't assign a simple UIImage to an UIImageView in a background thread ?