Skip to content

Default tapBlock no longer works with iOS 10, issue not detected by Xcode #23

@bengotow

Description

@bengotow

When you use the standard UIAlertView+Blocks API to provide a tapBlock, it is called when - alertView:clickedButtonAtIndex: is fired. This API was deprecated in iOS 9, and choosing iOS 10 as a Base SDK causes it to never be executed, meaning that your tapBlock is never run.

This issue isn't picked up by Xcode during compilation because the UIAlertView (Blocks) category isn't explicitly declared as a UIAlertViewDelegate. (I'm not sure this is possible, though.) Unfortunately this means I shipped an app update this month with a handful of unreachable tapBlocks.

The quickest solution is to pass NULL as the tapBlock when instantiating, and then separately set the setDidDismissBlock:, which does still fire in iOS 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions