Last active
August 29, 2015 14:23
-
-
Save mschmulen/b55dace6f69cc6529409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
public class MyClass { | |
private let instanceData:String = "yack" | |
public typealias COMP_CALLBACK_FUNC = (param:String) ->(String) | |
public func completionCallback( param:String, completionCallback: COMP_CALLBACK_FUNC ) | |
{ | |
completionCallback(param: param) | |
} | |
} | |
let my = MyClass() | |
my.completionCallback("yack", completionCallback: { (param) -> (String) in | |
let newString = "\(param)_YACK " | |
println(newString) | |
return newString | |
}) | |
//you can also do it with a trailing closure | |
my.completionCallback("yack"){ (param) -> (String) in | |
let newString = "\(param)_YACK " | |
println(newString) | |
return newString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment