[App] Integrated the Feed List to the App with coordinators (#16)
This PR contains the work done to implement the integration of the `FeedListViewController` view controller in the `Feed` framework to the `App` target by using coordinators. Reviewed-on: rock-n-code/app-reviews#16 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #16.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// FeedListCoordinator.swift
|
||||
// ReviewsFeed
|
||||
//
|
||||
// Created by Javier Cicchelli on 21/03/2024.
|
||||
// Copyright © 2024 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import ReviewsCoordinationKit
|
||||
|
||||
public final class FeedListCoordinator: Coordinator {
|
||||
|
||||
// MARK: Constants
|
||||
public let router: any Router
|
||||
|
||||
private let sessionConfiguration: URLSessionConfiguration
|
||||
|
||||
// MARK: Properties
|
||||
public var children: [any Coordinator] = []
|
||||
|
||||
// MARK: Initialisers
|
||||
public init(
|
||||
router: any Router,
|
||||
sessionConfiguration: URLSessionConfiguration = .ephemeral
|
||||
) {
|
||||
self.router = router
|
||||
self.sessionConfiguration = sessionConfiguration
|
||||
}
|
||||
|
||||
// MARK: Functions
|
||||
public func present(
|
||||
animated: Bool,
|
||||
onDismiss: Router.OnDismissClosure? = nil
|
||||
) {
|
||||
router.present(
|
||||
FeedListViewController(configuration: .init(
|
||||
session: sessionConfiguration
|
||||
)),
|
||||
animated: animated,
|
||||
onDismiss: onDismiss
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user