Skip to content

Commit

Permalink
Adding file with validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
insha committed Mar 16, 2023
1 parent c0d3031 commit 91e8c0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
11 changes: 6 additions & 5 deletions Examples/GopherExample/GopherExample/DownloadQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class DownloadQueue
{
enum Error: Swift.Error
{
case empty
case Empty
}

var count: Int
Expand All @@ -21,7 +21,7 @@ final class DownloadQueue

private var queue: [DownloadItem] = []

func add(url: URL, download_location: URL? = nil)
func add(url: URL, download_location _: URL? = nil)
{
queue.append(DownloadItem(url: url))
}
Expand All @@ -33,7 +33,8 @@ final class DownloadQueue

func clear()
{
queue.forEach { item in
queue.forEach
{ item in
switch item.status
{
case .in_progress:
Expand Down Expand Up @@ -154,7 +155,7 @@ extension DownloadQueue
return url
}

static private func imageFromFileSystem(for request: URLRequest) throws -> UIImage?
private static func imageFromFileSystem(for request: URLRequest) throws -> UIImage?
{
guard let url = fileName(for: request)
else
Expand All @@ -167,7 +168,7 @@ extension DownloadQueue
return UIImage(data: data)
}

static private func fileName(for urlRequest: URLRequest) -> URL?
private static func fileName(for urlRequest: URLRequest) -> URL?
{
guard let fileName = urlRequest.url?.absoluteString.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed),
let applicationSupport = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first
Expand Down
4 changes: 3 additions & 1 deletion Examples/GopherExample/GopherExample/MovieInfoProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ extension MovieInfoProvider
{
func popular() async throws
{
_ = URL(string: "https://road.to.nowhere")!
let result: MovieResult = try await service.invoke(resource: .popular)

DispatchQueue.main.async {
DispatchQueue.main.async
{
self.movies = result.results
}
}
Expand Down
8 changes: 4 additions & 4 deletions Examples/GopherExample/GopherExample/NetworkService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class NetworkService
init(service: Gopher)
{
self.service = service
self.download_queue = DownloadQueue()
download_queue = DownloadQueue()
}

func invoke<Model>(resource: TheMovieDatabase,
Expand Down Expand Up @@ -48,9 +48,9 @@ extension NetworkService
static let language = "language"
}

case auth_temp_token
case auth_new_session
case authenticate
case Auth_temp_token
case Auth_new_session
case Authenticate
case popular
case popular_persons
case topRated
Expand Down

0 comments on commit 91e8c0e

Please sign in to comment.