Post not yet marked as solved
A StackOverflow user suggested switching Xcode versions, and indeed, using 15.2 instead of 15.3 appears to have solved the problem.
Post not yet marked as solved
I am sorry, I meant hang point, not "pont" . As far as more complete code goes, I don' t see much point, since it happens at initailization of a CGFloat instance variable, but here you go, code for the entire class:
class FileOrFolderCell: UICollectionViewCell, CustomCell {
@IBOutlet weak var emojiLabel: UILabel!
@IBOutlet weak var nameLabel: MarqueeLabel!
@IBOutlet weak var emojiBadge: UILabel!
@IBOutlet weak var imageView: UIImageView!
let emojiLabelInitialFontSize: CGFloat = 64
@IBOutlet weak var newBadge: UILabel!
var url: URL!
var thumbURL: URL?
var isNew = false {
didSet {
newBadge.isHidden = !isNew
}
}
var emoji = "" {
didSet {
emojiLabel.text = emoji
emojiBadge.text = emoji
}
}
func setFontSizesFor(width: CGFloat) {
emojiLabel.font = emojiLabel.font?.withSize(32)
newBadge.font = newBadge.font?.withSize(20)
}
}
As you see, there is basically nothing there and whatever little this is, it all has to run on the UI thread (it is a subclass of UICollectionView).
My experience with this indicates that you also have to enclose the call to URL(resolvingBookmarkData:) between startAccessingSecurityScopedResource() and stopAccessingSecurityScopedResource() for it to work reliably. After much searching, I only found a passing reference to this fact somewhere on the web (which, to my knowledge, appears not to be properly documented) and suddenly, a lot of issues I was having went away as if by magic.