[swift-corelibs-dev] NSObject's performSelector(inBackground:with:) doesn't feel right in Swift 3

Philippe Hausler phausler at apple.com
Tue Aug 16 10:42:30 CDT 2016


Those methods should probably all belong to the same family of `perform` but it matches the method naming of:

open func performSelector(onMainThread aSelector: Selector, with arg: Any?, waitUntilDone wait: Bool, modes array: [String]?)

But perhaps the naming family should belong to this one:

open func perform(_ aSelector: Selector, on thr: Thread, with arg: Any?, waitUntilDone wait: Bool)

> On Aug 15, 2016, at 3:53 PM, Paul Hudson via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
> 
> Hello!
> 
> I just noticed that performSelectorInBackground(_:withObject:) has
> been mapped to performSelector(inBackground:with:) in Swift 3. So:
> 
> performSelector(inBackground: #selector(doStuff), with: nil)
> 
> This seems confusing to me – the "inBackground" label has little to do
> with the selector that is attached to it. It's possible this has been
> through careful API review and if so I apologize. On the other hand,
> if it's an oversight is there time for it to be looked at again?
> 
> Thank you!
> 
> 
> Paul
> --
> Free Swift tutorials – hackingwithswift.com
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev



More information about the swift-corelibs-dev mailing list