[Library] iTunes library #5

Merged
javier merged 25 commits from library/itunes into main 2024-03-17 22:48:28 +00:00
3 changed files with 62 additions and 0 deletions
Showing only changes of commit 54a546594d - Show all commits

View File

@ -0,0 +1,22 @@
//
// JSONDecoder+Constants.swift
// ReviewsiTunesKit
//
// Created by Javier Cicchelli on 17/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import Foundation
extension JSONDecoder {
// MARK: Constants
static let `default` = {
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601
return decoder
}()
}

View File

@ -0,0 +1,23 @@
//
// ServiceConfiguration+Inits.swift
// ReviewsiTunesKit
//
// Created by Javier Cicchelli on 17/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import Foundation
import ReviewsFeedKit
extension ServiceConfiguration {
// MARK: Initialisers
init(session: URLSessionConfiguration = .ephemeral) {
self.init(
host: .iTunes,
session: session,
decoder: .default
)
}
}

View File

@ -0,0 +1,17 @@
//
// URL+Constants.swift
// ReviewsiTunesKit
//
// Created by Javier Cicchelli on 17/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import Foundation
import ReviewsFoundationKit
extension URL {
// MARK: Constants
static let iTunes: URL = .init(string: "https://itunes.apple.com") ?? .bitBucket
}