-
-
Notifications
You must be signed in to change notification settings - Fork 159
Context Menus break Auto Layout #77
Comments
+1 Struggling with same issue and don’t know what should I do. |
I'm currently overseas but will have a look into this as soon as I can! Should be relatively straightforward to implement support via UIKit :) |
I've made a start by adding support for We could wrap it further to make a clearer struct-based API, however the UIKit method is relatively straightforward and allows for complexities such as nested menus - so I'll leave it be for now 👍 Interestingly, during my testing I found that constraints were broken even in a pure UIKit Collectionview using contextMenus (with no ASCollectionView or swiftUI involved). So sounds like there's also a UIKit bug :/ gladly it's just an annoying log message! |
I should also note that this seems to fix the SwiftUI bug with dynamicContent/Buttons not displaying 🎉 |
Wow! I also think that it’s a great implementation as is (miles better than the SwiftUI one which has no support for sections, and nesting, and can’t properly display icons, etc.). Thanks for investing your time in it! |
Preface
Not really this library's problem, but it could help solve it by bringing in support for UIKit Context Menu as opposed to relying on SwiftUI's problematic implementation.
Issue
The issue is as follows: whenever a Context Menu is accessed, Xcode throws an error regarding some broken constraints — on any view in any configuration (screenshots attached), but sometimes a context menu preview is recovered by being placed on top of the source view.
If, however, a view has dynamic content/Button in it, it's simply not displayed.
Proposed Solution
Implement per-cell Context Menus using UICollectionView API.
I think that you have created a fantastic framework that is simply necessary to create any sort of a complex and dynamic user interface in SwiftUI (at least until Apple adds a CollectionView analog) and it would greatly increase its value by providing a solution to this issue. Pretty Please?
To Reproduce
Interact with a Context Menu
Screenshots
Code
Rendered Result
Example with dynamic content/Button
Xcode Output
Xcode Version:
13.3.1
Simulator, Device, Both?
Both
The text was updated successfully, but these errors were encountered: