Skip to content

Commit

Permalink
updating the access of the init function
Browse files Browse the repository at this point in the history
  • Loading branch information
codecat15 committed Jun 5, 2020
1 parent b03bad0 commit 2113b3d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions HttpUtility/HttpUtility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ enum HttpMethods
case delete
}

struct HttpUtility
public struct HttpUtility
{
private var _token: String? = nil
private var _customJsonDecoder: JSONDecoder? = nil

init(token: String?){
public init(token: String?){
_token = token
}

init(token: String?, decoder: JSONDecoder?){
public init(token: String?, decoder: JSONDecoder?){
_token = token
_customJsonDecoder = decoder
}

init(WithJsonDecoder decoder: JSONDecoder){
public init(WithJsonDecoder decoder: JSONDecoder){
_customJsonDecoder = decoder
}

init(){}
public init(){}

func request<T:Decodable>(requestUrl: URL, method: HttpMethods, requestBody: Data? = nil, resultType: T.Type, completionHandler:@escaping(Result<T?, NetworkError>)-> Void)
{
Expand Down

0 comments on commit 2113b3d

Please sign in to comment.