Skip to content

Instantly share code, notes, and snippets.

@catalinaturlea
Last active June 30, 2016 14:05
Show Gist options
  • Save catalinaturlea/d00d411c3bf120c5d263 to your computer and use it in GitHub Desktop.
Save catalinaturlea/d00d411c3bf120c5d263 to your computer and use it in GitHub Desktop.
Unnecessary code clean up
class MyTest: NSObject {
private var identifier = "myIdentifier"
var defaultContent: [String]
init(withItem item: String) {
defaultContent = [item]
}
class func fetchInfo(success: (info: [AnyObject: AnyObject]?) -> (), failure: ((error: NSError?) -> ())? ) {
APIClient.fetchInfoWithSucess({ (_, _, json) -> Void in
info = json as? [AnyObject: AnyObject])
success?(info: info)
}, failure: { (_, _, error) -> Void in
failure?(error: error)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment