Implemented the "init(session: )" initialiser for the ServiceConfiguration+Inits extension in the iTunes library.
This commit is contained in:
parent
ab81347b22
commit
54a546594d
22
Libraries/iTunes/Kit/Extensions/JSONDecoder+Constants.swift
Normal file
22
Libraries/iTunes/Kit/Extensions/JSONDecoder+Constants.swift
Normal 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
|
||||
}()
|
||||
|
||||
}
|
@ -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
|
||||
)
|
||||
}
|
||||
|
||||
}
|
17
Libraries/iTunes/Kit/Extensions/URL+Constants.swift
Normal file
17
Libraries/iTunes/Kit/Extensions/URL+Constants.swift
Normal 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
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user