Auto Layout Error Using UIDocumentMenuViewController

I get an Autolayout error when using UIDocumentMenuViewController, an error occurred while initializing DocumentMenu, this is my code:

let importMenu = UIDocumentMenuViewController(documentTypes: doctypes, inMode: .Import) //Error message here importMenu.delegate = self importMenu.popoverPresentationController?.barButtonItem = self.addButon; self.presentViewController(importMenu, animated: true, completion: nil) 

And this is a mistake, and it is related to UICollectionViewFlowLayout

 the behavior of the UICollectionViewFlowLayout is not defined because: 2016-02-17 13:28:44.538 App[35218:1131869] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values. 2016-02-17 13:28:44.538 App[35218:1131869] The relevant UICollectionViewFlowLayout instance is <_UIAlertControllerCollectionViewFlowLayout: 0x7fbcd5d18e90>, and it is attached to <UICollectionView: 0x7fbcd6823000; frame = (0 44; 10 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7fbcd3e63150>; animations = { bounds.origin=<CASpringAnimation: 0x7fbcd5c80c50>; bounds.size=<CASpringAnimation: 0x7fbcd5c80d40>; position=<CASpringAnimation: 0x7fbcd5c80e40>; }; layer = <CALayer: 0x7fbcd5d19450>; contentOffset: {0, 0}; contentSize: {0, 0}> collection view layout: <_UIAlertControllerCollectionViewFlowLayout: 0x7fbcd5d18e90>. 2016-02-17 13:28:44.538 App[35218:1131869] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger. 

I am using Xcode v7.2 and my deployment target is 8.0, it happens on iPhone and iPad, did someone encounter this error using UIDocumentMenuViewController?

This is a weird behavior:

Picture

EDIT : Also happening on Xcode 7.3

+7
ios swift xcode7
source share

No one has answered this question yet.

See similar questions:

3
UIDocumentMenuViewController crashes on iPad, but not on iPhone

or similar:

1473
Using auto layout in UITableView for dynamic layouts of cells and variable row heights
6
UICollectionViewFlowLayout exception when executing XHR request in NativeScript
4
UICollectionViewFlowLayout behavior not defined
4
Why is UICollectionView insetForSectionsAtIndex not called?
3
UICollection View calls "UICollectionViewFlowLayoutBreakForInvalidSizes" on smaller devices
3
UIDocumentMenuViewController crashes on iPad, but not on iPhone
2
UICollectionViewFlowLayout behavior is undefined because
one
UICollectionView must be initialized with a non-nil layout parameter as Subview
0
A nested collection in table view throws an error
0
Failed to create CollectionView AutoResize shortcut.

All Articles