Skip to content

Commit 9f2a98a

Browse files
author
Alexey Naumov
committed
Merge branch 'master' into mvvm
2 parents 1281215 + 578c6f6 commit 9f2a98a

File tree

9 files changed

+12
-20
lines changed

9 files changed

+12
-20
lines changed

CountriesSwiftUI.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@
10411041
repositoryURL = "https://github.com/nalexn/ViewInspector";
10421042
requirement = {
10431043
kind = exactVersion;
1044-
version = 0.8.1;
1044+
version = 0.9.0;
10451045
};
10461046
};
10471047
F6E7ACE023F5D1EC00AB48AB /* XCRemoteSwiftPackageReference "EnvironmentOverrides" */ = {

CountriesSwiftUI/Models/MockedData.swift

+1-1
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ extension SVGImageView {
8989
struct SVGImageView_Previews: PreviewProvider {
9090
static var previews: some View {
9191
SVGImageView(viewModel: SVGImageView.ViewModel(
92-
container: .preview, imageURL: URL(string: "https://restcountries.eu/data/usa.svg")!))
92+
container: .preview, imageURL: URL(string: "https://flagcdn.com/us.svg")!))
9393
}
9494
}
9595
#endif

README.md

+1-1
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 MVVM 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 [master branch](https://github.com/nalexn/clean-architecture-swiftui) for the Clean Architecture revision of the same app.**
1616

UnitTests/Repositories/CountriesDBRepositoryTests.swift

+1-1
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"],

UnitTests/System/SystemEventsHandlerTests.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ final class SystemEventsHandlerTests: XCTestCase {
117117

118118
#if os(iOS) && !targetEnvironment(macCatalyst)
119119
func test_keyboardHeight() throws {
120-
let textFiled = UITextField(frame: .zero)
120+
let textField = UITextField(frame: .zero)
121121
let window = try XCTUnwrap(UIApplication.shared.windows.first, "Cannot extract the host view")
122122
window.makeKeyAndVisible()
123-
window.addSubview(textFiled)
123+
window.addSubview(textField)
124124
setupSut()
125125
XCTAssertEqual(appState.system.keyboardHeight, 0)
126-
textFiled.becomeFirstResponder()
126+
textField.becomeFirstResponder()
127127
XCTAssertGreaterThan(appState.system.keyboardHeight, 0)
128-
textFiled.removeFromSuperview()
128+
textField.removeFromSuperview()
129129
verify()
130130
}
131131
#endif

UnitTests/UI/CountriesListTests.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ final class LocalizationTests: XCTestCase {
146146
// MARK: - CountriesList inspection helper
147147
extension InspectableView where View == ViewType.View<CountriesList> {
148148
func content() throws -> InspectableView<ViewType.AnyView> {
149-
return try geometryReader().navigationView()
150-
.navigationBarItems(0).anyView()
149+
return try find(ViewType.AnyView.self)
151150
}
152151
}

UnitTests/UI/CountryDetailsTests.swift

+1-8
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,7 @@ final class CountryDetailsTests: XCTestCase {
117117
}
118118

119119
func test_sheetPresentation() {
120-
let images: [MockedImagesService.Action]
121-
if #available(iOS 14.0, *) {
122-
// Image is requested by Details sheet only:
123-
images = [.loadImage(country.flag)]
124-
} else {
125-
// Image is requested by CountryDetails and Details sheet:
126-
images = [.loadImage(country.flag), .loadImage(country.flag)]
127-
}
120+
let images: [MockedImagesService.Action] = [.loadImage(country.flag), .loadImage(country.flag)]
128121
let services = DIContainer.Services.mocked(
129122
imagesService: images
130123
)

0 commit comments

Comments
 (0)