Moved the FeedViewController and DetailsViewController view controllers, the ReviewCell cell, and the Review model from the App target to the Feed framework.
This commit is contained in:
parent
8bd5924d6e
commit
e1829bb03d
@ -8,25 +8,33 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
class FeedViewController: UITableViewController {
|
||||
public class FeedViewController: UITableViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
public init() {
|
||||
super.init(style: .plain)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
public override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
tableView.register(ReviewCell.self, forCellReuseIdentifier: "cellId")
|
||||
tableView.rowHeight = 160
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
public override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return 100
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
public override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let c = tableView.dequeueReusableCell(withIdentifier: "cellId", for: indexPath) as! ReviewCell
|
||||
c.update(item: randomReview())
|
||||
return c
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
public override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
tableView.deselectRow(at: indexPath, animated: true)
|
||||
let vc = DetailsViewController(review: randomReview())
|
||||
navigationController!.pushViewController(vc, animated: true)
|
@ -10,13 +10,13 @@
|
||||
02DC7F9F2BA51793000EEEBE /* ReviewsFeed.h in Headers */ = {isa = PBXBuildFile; fileRef = 02DC7F912BA51793000EEEBE /* ReviewsFeed.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
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 */; };
|
||||
02DC7FAD2BA51B4C000EEEBE /* ReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */; };
|
||||
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */; };
|
||||
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13124C6EE64004E2EE1 /* Review.swift */; };
|
||||
345AD11C24C6EDD9004E2EE1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */; };
|
||||
345AD12524C6EDDC004E2EE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 345AD12424C6EDDC004E2EE1 /* Assets.xcassets */; };
|
||||
345AD12824C6EDDC004E2EE1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 345AD12624C6EDDC004E2EE1 /* LaunchScreen.storyboard */; };
|
||||
345AD13324C6EE64004E2EE1 /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */; };
|
||||
345AD13424C6EE64004E2EE1 /* ReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */; };
|
||||
345AD13524C6EE64004E2EE1 /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13124C6EE64004E2EE1 /* Review.swift */; };
|
||||
345AD13624C6EE64004E2EE1 /* DetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -97,10 +97,6 @@
|
||||
02DC7F742BA4F93B000EEEBE /* Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */,
|
||||
345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */,
|
||||
345AD13124C6EE64004E2EE1 /* Review.swift */,
|
||||
345AD13024C6EE64004E2EE1 /* ReviewCell.swift */,
|
||||
345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */,
|
||||
);
|
||||
path = Sources;
|
||||
@ -126,6 +122,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
02DC7F912BA51793000EEEBE /* ReviewsFeed.h */,
|
||||
02DC7FB02BA51B4F000EEEBE /* Sources */,
|
||||
);
|
||||
path = Feed;
|
||||
sourceTree = "<group>";
|
||||
@ -138,6 +135,17 @@
|
||||
path = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
02DC7FB02BA51B4F000EEEBE /* Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
345AD13224C6EE64004E2EE1 /* DetailsViewController.swift */,
|
||||
345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */,
|
||||
345AD13124C6EE64004E2EE1 /* Review.swift */,
|
||||
345AD13024C6EE64004E2EE1 /* ReviewCell.swift */,
|
||||
);
|
||||
path = Sources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
345AD10F24C6EDD9004E2EE1 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -278,6 +286,10 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
02DC7FAC2BA51B4C000EEEBE /* DetailsViewController.swift in Sources */,
|
||||
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */,
|
||||
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */,
|
||||
02DC7FAD2BA51B4C000EEEBE /* ReviewCell.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -285,11 +297,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
345AD13524C6EE64004E2EE1 /* Review.swift in Sources */,
|
||||
345AD13424C6EE64004E2EE1 /* ReviewCell.swift in Sources */,
|
||||
345AD13324C6EE64004E2EE1 /* FeedViewController.swift in Sources */,
|
||||
345AD11C24C6EDD9004E2EE1 /* AppDelegate.swift in Sources */,
|
||||
345AD13624C6EE64004E2EE1 /* DetailsViewController.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user