Skip to content

Commit a175f08

Browse files
author
Alexey Naumov
committed
Migrate API to restcountries.com
1 parent 37aca2e commit a175f08

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

CountriesSwiftUI/Models/MockedData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Foundation
1313
extension Country {
1414
static let mockedData: [Country] = [
1515
Country(name: "United States", translations: [:], population: 125000000,
16-
flag: URL(string: "https://restcountries.eu/data/usa.svg"), alpha3Code: "USA"),
16+
flag: URL(string: "https://flagcdn.com/us.svg"), alpha3Code: "USA"),
1717
Country(name: "Georgia", translations: [:], population: 2340000, flag: nil, alpha3Code: "GEO"),
1818
Country(name: "Canada", translations: [:], population: 57600000, flag: nil, alpha3Code: "CAN")
1919
]

CountriesSwiftUI/System/AppEnvironment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extension AppEnvironment {
6464
private static func configuredWebRepositories(session: URLSession) -> DIContainer.WebRepositories {
6565
let countriesWebRepository = RealCountriesWebRepository(
6666
session: session,
67-
baseURL: "https://restcountries.eu/rest/v2")
67+
baseURL: "https://restcountries.com/v2")
6868
let imageWebRepository = RealImageWebRepository(
6969
session: session,
7070
baseURL: "https://ezgif.com")

CountriesSwiftUI/UI/Components/SVGImageView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ private extension SVGImageView {
7777
struct SVGImageView_Previews: PreviewProvider {
7878
static var previews: some View {
7979
VStack {
80-
SVGImageView(imageURL: URL(string: "https://restcountries.eu/data/usa.svg")!)
81-
SVGImageView(imageURL: URL(string: "https://restcountries.eu/data/alb.svg")!)
82-
SVGImageView(imageURL: URL(string: "https://restcountries.eu/data/rus.svg")!)
80+
SVGImageView(imageURL: URL(string: "https://flagcdn.com/us.svg")!)
81+
SVGImageView(imageURL: URL(string: "https://flagcdn.com/al.svg")!)
82+
SVGImageView(imageURL: URL(string: "https://flagcdn.com/ru.svg")!)
8383
}
8484
}
8585
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
A demo project showcasing the setup of the SwiftUI app with Clean Architecture.
1212

13-
The app uses the [restcountries.eu](https://restcountries.eu/) REST API to show the list of countries and details about them.
13+
The app uses the [restcountries.com](https://restcountries.com/) REST API to show the list of countries and details about them.
1414

1515
**Check out [mvvm branch](https://github.com/nalexn/clean-architecture-swiftui/tree/mvvm) for the MVVM revision of the same app.**
1616

UnitTests/Repositories/CountriesDBRepositoryTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private extension Country {
142142
translations: ["fr": "United States in Frénch",
143143
"ja": "Unitd States in Japaneese"],
144144
population: 125000000,
145-
flag: URL(string: "https://restcountries.eu/data/usa.svg"),
145+
flag: URL(string: "https://flagcdn.com/us.svg"),
146146
alpha3Code: "USA"),
147147
Country(name: "Canada",
148148
translations: ["ja": "Canada not in French"],

0 commit comments

Comments
 (0)