Skip to content

Swift code generation is outdated #100

Description

@domingguss

Enums are lowerCamelCased nowadays, and paramaters should be made explicit.
Try testing it in a XCode8 Playground context.

import Foundation
letheaders=["authorization":"Bearer eyJhbGciOiJSUzI1NiJ","content-type":"application/json"]varrequest=NSMutableURLRequest(url:URL(string:"http://foo.bar/api/items")!, cachePolicy:.useProtocolCachePolicy, timeoutInterval:10.0)
request.httpMethod ="GET"
request.allHTTPHeaderFields = headers
letsession=URLSession.shared
letdataTask= session.dataTask(with: request asURLRequest, completionHandler:{(data, response, error)->Voidiniflet e = error {print(e)}else{iflet httpResponse = response as?HTTPURLResponse{print(httpResponse)}}})
dataTask.resume()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions