Skip to content

Instantly share code, notes, and snippets.

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