Swift UIRefreshControl target action function with a default value

Originator:keithbsmiley
Number:rdar://19880996 Date Originated:18-Feb-2015 02:43 PM
Status:Open Resolved:
Product:iOS SDK Product Version:8.1
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
When using target action, at least with UIRefreshControl, to call a swift function that has a default value, the app crashes.

Steps to Reproduce:
1. Create a UITableViewController with a UIRefreshControl
2. Add a target to the UIRefreshControl such as `refresh:`
3. Create the refresh function with this signature `@objc func reload(sender: UIRefreshControl? = nil)`

Expected Results:
`reload:` is called and everything is fine.

Actual Results:
The application crashes with `unrecognized selector sent to instance`

Notes:
See the attached project for an example.

Comments

https://github.com/Keithbsmiley/radars/tree/master/UIRefreshControlDefaultSender

By keithbsmiley at Feb. 18, 2015, 10:45 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!