Skip to content

Commit

Permalink
Few helper methods updated
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakparmar92 committed Sep 20, 2018
1 parent 4edea6c commit 0212196
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ProjectUtilities/Classes/CommonUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@ class CommonUtilities: NSObject {
guard range.lowerBound <= str.count && range.upperBound <= str.count else {
return nil
}
return Range<String.Index>(str.index(str.startIndex, offsetBy: range.lowerBound)..<str.index(str.startIndex, offsetBy: range.upperBound))
return (str.index(str.startIndex,
offsetBy: range.lowerBound)..<str.index(str.startIndex,offsetBy: range.upperBound))
}

class func fixOrientation(img: UIImage?) -> UIImage? {
Expand Down
7 changes: 7 additions & 0 deletions ProjectUtilities/Classes/NetworkLibrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ enum ServiceResponse<T> {
let session = URLSession.shared
let task = session.dataTask(with: request) { (data, response, error) -> Void in

do {
let temp = try JSONSerialization.jsonObject(with: data!,
options: JSONSerialization.ReadingOptions.allowFragments)
} catch {
print(error)
}

if let httpResponse = response as? HTTPURLResponse,
httpResponse.statusCode == 200,
let responseData = data {
Expand Down

0 comments on commit 0212196

Please sign in to comment.