Skip to content

Commit

Permalink
Merge pull request #998 from DeluxeAlonso/feature/code-cleanup
Browse files Browse the repository at this point in the history
Feature/code cleanup
  • Loading branch information
DeluxeAlonso authored Oct 21, 2024
2 parents c7bbfec + ce792de commit d0d47c7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
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 @@ final class NavigationHandler: NavigationHandlerProtocol {
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 }
switch host {
case .upcomingMovies:
changeTabBarToSelectedIndex(RootCoordinatorIdentifier.upcomingMovies, from: window)

case .searchMovies:
changeTabBarToSelectedIndex(RootCoordinatorIdentifier.searchMovies, from: window)
case .detail:
// TODO: - Implement DeepLink Handler
break
}
}
}
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 @@ import Foundation

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? {
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

0 comments on commit d0d47c7

Please sign in to comment.