nicklockwood / layout

A declarative UI framework for iOS
MIT License
2.23k stars 97 forks source link

UIAlertController has missing UIAlertActions #47

Closed Eddpt closed 7 years ago

Eddpt commented 7 years ago

When using Layout all the UIAlertControllers seem to have missing UIAlertActions, only on iOS 9.

private func presentAlert() {
    let sheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)

    sheet.addAction(UIAlertAction(title: "Edit", style: .default, handler: nil))
    sheet.addAction(UIAlertAction(title: "Delete", style: .destructive, handler: nil))
    sheet.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))

    present(sheet, animated: true)
}

screenshot 2017-09-05 12 39 04

See the following sample project

When using Layout version 0.4.13 it works fine, but upgrading to 0.4.14 or greater breaks.

screenshot 2017-09-05 12 38 14

From inspecting the views, it does seem that Apple uses a UICollectionView to present the Sheet, so perhaps that's a good hint of where the issue might be.

nicklockwood commented 7 years ago

Thanks! I've pushed a fix to the develop branch.

Eddpt commented 7 years ago

Working 👍