Convert the method signature to Swift

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Convert the method signature to Swift

Kien Weng Khaw
Hi,
I encounter problem when trying to convert the following method signature to Swift. It is actually the method that I need to implement for a protocol.

- (void)conversationListViewController:(ATLConversationListViewController *)conversationListViewController didSearchForText:(NSString *)searchText completion:(void (^)(NSSet *filteredParticipants))completion

May I know what is the equivalent of the Swift version?

Thanks. :-)

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/4aea00df-11d0-48b5-a8bd-d1152b779d8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Convert the method signature to Swift

Jens Alfke

On Jun 3, 2015, at 3:14 AM, Kien Weng Khaw <[hidden email]> wrote:

I encounter problem when trying to convert the following method signature to Swift. It is actually the method that I need to implement for a protocol.

Try command-clicking the protocol name in Xcode; it should open a window showing a Swift translation of its declaration.

I’m just typing this into Mail, but I think the translation would be:

func conversationListViewController(conversationListViewController: ATLConversationListViewController,
didSearchForText searchText: String,
completion: NSSet->( ) )

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/9FCFF551-97A5-4BB5-B5B4-2D4F679BF990%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Convert the method signature to Swift

Kien Weng Khaw
Hi Jens,
Thanks for your reply.

Thanks for the tips of using command-clicking. I tried, but it does not work. I wonder if this only work for particular cases or should work all the time?
Try command-clicking the protocol name in Xcode; it should open a window showing a Swift translation of its declaration.

At the end, this works.

    func conversationListViewController(conversationListViewController: ATLConversationListViewController, didSearchForText searchText: String, completion: ((Set<NSObject>!) -> Void)?)

Thanks. :-)


On Thursday, June 4, 2015 at 5:29:14 AM UTC+8, Jens Alfke wrote:

On Jun 3, 2015, at 3:14 AM, Kien Weng Khaw <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Mqn86RNx3lcJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">kwk...@...> wrote:

I encounter problem when trying to convert the following method signature to Swift. It is actually the method that I need to implement for a protocol.

Try command-clicking the protocol name in Xcode; it should open a window showing a Swift translation of its declaration.

I’m just typing this into Mail, but I think the translation would be:

func conversationListViewController(conversationListViewController: ATLConversationListViewController,
didSearchForText searchText: String,
completion: NSSet->( ) )

—Jens

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/923c445c-05d4-4696-927d-36368e7a9285%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.