ios - Passing closure to be called later -


I am trying to create an array of custom action objects, each of which is a closure that can be called later is. What am I doing wrong here? How can i stop {Println ("1 blue"}} action 2 = verb (title: "2", image: "yellow");

  actionone = action (title: "1", image: "blue" ") {Println (" 2 yellow ")} Actions: Array & lt; Action & gt; = [Actionwalker, Action] // How to run off a action? ActionOne.closure () // COLLECTION ERROR: Invalid use of '()' to call the value of 'non-function type' (?)? ' ----- Class action {var title: string? Var Image: String? Var closed: ()? Init (title: string, image: string, closing: () -> ()) {self.title = title self.image = image self.closure = close ()}}  
< / Div>

  class action {title: string giving two pictures: close the string: () -> () Title: String, Image: String, Closing: () - & gt; ()) {Self.title = title self.image = image self.closure = close}} let actionOne = verb (title: "1", "blue")} {println ("1 blue"}} action 2 = action (Title: "2", image: "yellow") {println ("2 yellow")} Actions: Array  = [proceeding, proceeding] verb one. ()  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -