Swift selector with arguments


Jul 06, 2016 · The `selector` is key to Objective-C's dynamic runtime nature. It's just a name that's used, at runtime, as a key into a dictionary of function pointers. Whenever you send a message to an Objective-C object, you're actually using a selector to look up a function to call. Sometimes selectors bubble up in Cocoa/CocoaTouch API, and you will need to deal with them in Swift. The message to send to target when the timer fires.. The selector should have the following signature: timer Fire Method: (including a colon to indicate that the method takes an argument). Argument of '#selector' refers to instance method 'startDownloadTask().....Objecのエラー ... 調べていく中でSwiftのバージョンが変わって3.0以降 ... Swift provides the Selector type for working with these. (Swift automatically uses this in place of ObjC's SEL type.) In Swift 2.2 (Xcode 7.3) and later (including Swift 3 / Xcode 8 and Swift 4 / Xcode 9): You can construct a Selector from a Swift function type using the #selector expression.