#uikit
2 entries · All tags
-
Is there no way in UIKit to do a custom animation from the preview of a context menu to a new view controller triggered from one of the menu actions?
I am stuck at getting the frame of the preview's view. The previewViewController property of the UIContextMenuInteractionAnimating is always nil. I can hang onto it manually, but it's not in the view hierarchy nor does it have a window, so I can't get the frame that way either.
-
Oh my, hit a nasty #UIKit crash when using #SwiftUI in a collection view using the UIHostingConfiguration.
Crashes whenever I change interface orientation on my phone. Can be reproduced with this trivial snippet:
cell.contentConfiguration = UIHostingConfiguration {
Text("Noooo!")
.frame(width: 150)
}The frame bit triggers a UICollectionViewRecursion warning and then crashes.
Added details on my blog and filed a radar. Hopefully it'll be fixed, as UIHostingConfiguration is otherwise a good way to get the most out of both SwiftUI and UIKit.
https://adrian.schoenig.me/blog/2023/02/10/uicollectionviewrecursion/