Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/code cleanup #998

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UpcomingMovies.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@
E2B6CFD82C1AAF3500E2C6FE /* MockListProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2B6CFD72C1AAF3500E2C6FE /* MockListProtocol.swift */; };
E2B8C49B28B738E2006A8ECC /* FavoritesSavedMoviesInteractorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2B8C49A28B738E2006A8ECC /* FavoritesSavedMoviesInteractorTests.swift */; };
E2BACB952BB6754800BA5417 /* MovieProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2BACB942BB6754800BA5417 /* MovieProtocol.swift */; };
E2BB433C2CC60F5B006567E9 /* DeepLinkDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20EF3BC2CC3801300FA72C1 /* DeepLinkDestination.swift */; };
E2BB64D22C2923EA007D77C2 /* ReviewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2BB64D12C2923EA007D77C2 /* ReviewModelTests.swift */; };
E2BB6F682BB52D6B00332AAB /* MovieListCellViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2BB6F672BB52D6B00332AAB /* MovieListCellViewModelTests.swift */; };
E2BC7F812C44F098003BB16A /* MovieVisitProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2BC7F802C44F098003BB16A /* MovieVisitProtocol.swift */; };
Expand Down Expand Up @@ -3498,6 +3499,7 @@
files = (
E2A02471256F635000D2018C /* UpcomingMoviesWidget.swift in Sources */,
E2671D8925D8AD9E00E457FF /* AppGroup.swift in Sources */,
E2BB433C2CC60F5B006567E9 /* DeepLinkDestination.swift in Sources */,
E2A02462256F634B00D2018C /* SearchMoviesWidget.swift in Sources */,
E2A02489256F662400D2018C /* WidgetProvider.swift in Sources */,
E2A024AA256F6B7600D2018C /* SmallWidgetView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@
guard let url = url, let urlHost = url.host else { return }

if url.scheme == AppExtension.scheme {
guard let host = AppExtension.Host(rawValue: urlHost) else { return }
guard let host = DeepLinkDestination(rawValue: urlHost) else { return }

Check warning on line 42 in UpcomingMovies/Helpers/Handlers/NavigationHandler/NavigationHandler.swift

View check run for this annotation

Codecov / codecov/patch

UpcomingMovies/Helpers/Handlers/NavigationHandler/NavigationHandler.swift#L42

Added line #L42 was not covered by tests
switch host {
case .upcomingMovies:
changeTabBarToSelectedIndex(RootCoordinatorIdentifier.upcomingMovies, from: window)

case .searchMovies:
changeTabBarToSelectedIndex(RootCoordinatorIdentifier.searchMovies, from: window)
case .detail:
// TODO: - Implement DeepLink Handler
break

Check warning on line 51 in UpcomingMovies/Helpers/Handlers/NavigationHandler/NavigationHandler.swift

View check run for this annotation

Codecov / codecov/patch

UpcomingMovies/Helpers/Handlers/NavigationHandler/NavigationHandler.swift#L49-L51

Added lines #L49 - L51 were not covered by tests
}
}
}
Expand Down
11 changes: 2 additions & 9 deletions UpcomingMovies/Helpers/Utils/AppExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@

struct AppExtension {

static let scheme = "extension"
static let scheme = "upcomingmovies"

enum Host: String {

case upcomingMovies = "upcoming"
case searchMovies = "search"

}

static func url(for host: AppExtension.Host) -> URL? {
static func url(for host: DeepLinkDestination) -> URL? {

Check warning on line 15 in UpcomingMovies/Helpers/Utils/AppExtension.swift

View check run for this annotation

Codecov / codecov/patch

UpcomingMovies/Helpers/Utils/AppExtension.swift#L15

Added line #L15 was not covered by tests
let urlString = scheme + "://" + host.rawValue
return URL(string: urlString)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
import Foundation

enum DeepLinkDestination: String {
case upcomingMovies = "upcoming"
case searchMovies = "search"
case detail
}
2 changes: 1 addition & 1 deletion UpcomingMovies/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>extension</string>
<string>upcomingmovies</string>
</array>
</dict>
</array>
Expand Down
Loading