ios - Need to convert a swift snippet of code into Objective C -


i had use swift made code on: https://github.com/lourenco-marinho/actionbutton in objective-c project. couldn't convert following swift line objective-c:

actionbutton.action = { button in button.togglemenu() } 

p.s. there no reference of variable button before or after code

let me show how things defined:

actionbutton is: var actionbutton: actionbutton! , actionbutton nsobject class

action defined in actionbutton class as: var action: actionbuttonaction?

and actionbuttonaction is: typealias actionbuttonaction = (actionbutton) -> void defined globally in actionbutton class

pretty messy? well, still want understand/convert above swift statement objective-c. clearance may follow link above.

that block in objective c

actionbutton.action = ^(actionbutton * button){     [button togglemenu]; }; 

also,typealise converted objective c

typedef void(^actionbuttonaction)(actionbutton * button); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -