[swift-evolution] Required Callback

James Campbell james at supmenow.com
Tue Aug 16 08:39:43 CDT 2016


It would be handy if a callback could be marked as required with an
optional descriptive message i.e

class BackgroundTask {
 func run(end: @required("You must call end otherwise iOS will penalise
your app for being a bad citizen") () -> Void)
}

That was the developer can comunicate the bad things that can happen if
this callback isn't called such as iOS peanlizing them for not ending a
background task or perhaps memory leaks caused by clean up code unable to
be triggered.

*___________________________________*

*James*

*james at supmenow.com <james at supmenow.com>⎥supmenow.com <http://supmenow.com>*

*Sup*

*Runway East *

*10 Finsbury Square*

*London*

* EC2A 1AF *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160816/b6e3b0db/attachment.html>


More information about the swift-evolution mailing list