[Framework] Feed item view in the Feed framework #10
@ -16,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
window = UIWindow(frame: UIScreen.main.bounds)
|
||||
let viewController = FeedViewController()
|
||||
let viewController = FeedListViewController()
|
||||
window?.rootViewController = UINavigationController(rootViewController: viewController)
|
||||
window?.makeKeyAndVisible()
|
||||
return true
|
||||
|
@ -9,11 +9,11 @@
|
||||
import Foundation
|
||||
import ReviewsiTunesKit
|
||||
|
||||
extension FeedViewController {
|
||||
extension FeedListViewController {
|
||||
final class ViewModel: ObservableObject {
|
||||
|
||||
// MARK: Type aliases
|
||||
typealias Configuration = FeedViewController.Configuration
|
||||
typealias Configuration = FeedListViewController.Configuration
|
||||
|
||||
// MARK: Constants
|
||||
private let configuration: Configuration
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// FeedListViewController.swift
|
||||
// ReviewsFeed
|
||||
//
|
||||
// Created by Dmitrii Ivanov on 21/07/2020.
|
||||
@ -11,7 +11,7 @@ import ReviewsUIKit
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
public class FeedViewController: UITableViewController {
|
||||
public class FeedListViewController: UITableViewController {
|
||||
|
||||
// MARK: Constants
|
||||
private let viewModel: ViewModel
|
||||
@ -90,7 +90,7 @@ public class FeedViewController: UITableViewController {
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
private extension FeedViewController {
|
||||
private extension FeedListViewController {
|
||||
|
||||
// MARK: Functions
|
||||
func bindViewModel() {
|
||||
@ -124,7 +124,7 @@ private extension FeedViewController {
|
||||
}
|
||||
|
||||
// MARK: - Configuration
|
||||
extension FeedViewController {
|
||||
extension FeedListViewController {
|
||||
public struct Configuration {
|
||||
|
||||
// MARK: Constants
|
||||
@ -159,16 +159,16 @@ import ReviewsFoundationKit
|
||||
import ReviewsiTunesKit
|
||||
|
||||
@available(iOS 17.0, *)
|
||||
#Preview("Feed View Controller loading reviews") {
|
||||
#Preview("Feed List loading reviews") {
|
||||
MockURLProtocol.response = .init(statusCode: 200)
|
||||
|
||||
return UINavigationController(
|
||||
rootViewController: FeedViewController(configuration: .init(session: .mock))
|
||||
)
|
||||
rootViewController: FeedListViewController(configuration: .init(session: .mock))
|
||||
)
|
||||
}
|
||||
|
||||
@available(iOS 17.0, *)
|
||||
#Preview("Feed View Controller with few reviews") {
|
||||
#Preview("Feed List with few reviews") {
|
||||
MockURLProtocol.response = .init(
|
||||
statusCode: 200,
|
||||
object: Feed(entries: [
|
||||
@ -221,24 +221,24 @@ import ReviewsiTunesKit
|
||||
)
|
||||
|
||||
return UINavigationController(
|
||||
rootViewController: FeedViewController(configuration: .init(session: .mock))
|
||||
rootViewController: FeedListViewController(configuration: .init(session: .mock))
|
||||
)
|
||||
}
|
||||
|
||||
@available(iOS 17.0, *)
|
||||
#Preview("Feed View Controller with no reviews") {
|
||||
#Preview("Feed List with no reviews") {
|
||||
MockURLProtocol.response = .init(
|
||||
statusCode: 200,
|
||||
object: Feed(entries: [])
|
||||
)
|
||||
|
||||
return UINavigationController(
|
||||
rootViewController: FeedViewController(configuration: .init(session: .mock))
|
||||
rootViewController: FeedListViewController(configuration: .init(session: .mock))
|
||||
)
|
||||
}
|
||||
|
||||
@available(iOS 17.0, *)
|
||||
#Preview("Feed View Controller with live reviews") {
|
||||
UINavigationController(rootViewController: FeedViewController())
|
||||
#Preview("Feed List with live reviews") {
|
||||
UINavigationController(rootViewController: FeedListViewController())
|
||||
}
|
||||
#endif
|
@ -13,7 +13,7 @@
|
||||
02DC7FA22BA51793000EEEBE /* ReviewsFeed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */; };
|
||||
02DC7FA32BA51793000EEEBE /* ReviewsFeed.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
02DC7FAC2BA51B4C000EEEBE /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */; };
|
||||
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */; };
|
||||
02DC7FAE2BA51B4C000EEEBE /* FeedListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedListViewController.swift */; };
|
||||
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13124C6EE64004E2EE1 /* Review.swift */; };
|
||||
02DC7FB32BA52518000EEEBE /* ReviewsKit in Frameworks */ = {isa = PBXBuildFile; productRef = 02DC7FB22BA52518000EEEBE /* ReviewsKit */; };
|
||||
02DC7FB52BA52520000EEEBE /* ReviewsKit in Frameworks */ = {isa = PBXBuildFile; productRef = 02DC7FB42BA52520000EEEBE /* ReviewsKit */; };
|
||||
@ -57,7 +57,7 @@
|
||||
345AD12424C6EDDC004E2EE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
345AD12724C6EDDC004E2EE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
345AD12924C6EDDC004E2EE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; };
|
||||
345AD12F24C6EE64004E2EE1 /* FeedListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedListViewController.swift; sourceTree = "<group>"; };
|
||||
345AD13124C6EE64004E2EE1 /* Review.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Review.swift; sourceTree = "<group>"; };
|
||||
345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailsViewController.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@ -121,7 +121,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */,
|
||||
345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */,
|
||||
345AD12F24C6EE64004E2EE1 /* FeedListViewController.swift */,
|
||||
);
|
||||
path = "View Controllers";
|
||||
sourceTree = "<group>";
|
||||
@ -377,7 +377,7 @@
|
||||
02DC7FAC2BA51B4C000EEEBE /* DetailsViewController.swift in Sources */,
|
||||
0220ADA32BA90646001E6A9F /* FeedItemCell.swift in Sources */,
|
||||
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */,
|
||||
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */,
|
||||
02DC7FAE2BA51B4C000EEEBE /* FeedListViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user