Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,24 @@ extension ActivityDetailsView: ViewCodable {

// MARK: Interface Constraints
func setupConstraints() {

let bagImageSize: CGFloat = 150

NSLayoutConstraint.activate([
vStack.topAnchor.constraint(equalTo: topAnchor, constant: 48),
vStack.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 4),
vStack.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -4),
vStack.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor, constant: 16),
vStack.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 4),
vStack.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor, constant: -4),

//Inside vStack
bagImage.widthAnchor.constraint(equalToConstant: bagImageSize),
bagImage.heightAnchor.constraint(equalToConstant: bagImageSize),
])

NSLayoutConstraint.activate([
vCenterStack.centerXAnchor.constraint(equalTo: centerXAnchor),
vCenterStack.centerYAnchor.constraint(equalTo: centerYAnchor),
])

NSLayoutConstraint.activate([

vCenterStack.centerXAnchor.constraint(equalTo: safeAreaLayoutGuide.centerXAnchor),
vCenterStack.centerYAnchor.constraint(equalTo: safeAreaLayoutGuide.centerYAnchor),

reportIssueButton.heightAnchor.constraint(equalToConstant: 44),
reportIssueButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16),
reportIssueButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
reportIssueButton.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -32),
reportIssueButton.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor, constant: -16),
reportIssueButton.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 16),
reportIssueButton.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor, constant: -32),
])
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class ActivityDetailsViewController: UIViewController {

let container = ActivityDetailsView()

override func loadView() {
self.view = container
}
override func loadView() {
self.view = container
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ extension ActivityListView: ViewCodable {

func setupConstraints(){
NSLayoutConstraint.activate([
tableView.topAnchor.constraint(equalTo: self.topAnchor),
tableView.leadingAnchor.constraint(equalTo: self.leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: self.trailingAnchor),
tableView.bottomAnchor.constraint(equalTo: self.bottomAnchor)
tableView.topAnchor.constraint(equalTo: topAnchor),
tableView.leadingAnchor.constraint(equalTo: leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: trailingAnchor),
tableView.bottomAnchor.constraint(equalTo: bottomAnchor)
])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@

import UIKit

struct HomeViewConfiguration {
let homeData: HomeData
}

protocol HomeViewDelegate: AnyObject {
func showActivityDetails()
func didSelectActivity()
}

struct HomeViewConfiguration {
let homeData: HomeData
}

final class HomeView: UIView {

private var activities: [Activity] = []
var delegate: HomeViewDelegate?
weak var delegate: HomeViewDelegate?

private lazy var accountSummaryView: AccountSummaryView = {
let element = AccountSummaryView()
Expand Down Expand Up @@ -77,8 +79,8 @@ private extension HomeView {
}
}

//MARK: - Tableview
extension HomeView: UITableViewDataSource, UITableViewDelegate {

public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
activities.count
}
Expand All @@ -93,7 +95,9 @@ extension HomeView: UITableViewDataSource, UITableViewDelegate {
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
delegate?.didSelectActivity()
delegate?.showActivityDetails()
print("touched")
//delegate?.didSelectActivity()
}

func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
class HomeViewController: UIViewController {

private let service = FinanceService()

private let homeView: HomeView = {
let homeView = HomeView()
return homeView
Expand Down Expand Up @@ -58,8 +58,12 @@ class HomeViewController: UIViewController {
}
}


extension HomeViewController: HomeViewDelegate {
func showActivityDetails() {
let vc = ActivityDetailsViewController()
navigationController?.pushViewController(vc, animated: true)
}

func didSelectActivity() {
present(ContactListViewController(), animated: true)
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion solutions/devsprint-caio-santos-7/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ target 'FinanceApp' do
# Pods for testing
pod 'SnapshotTesting', '~> 1.9.0'
end

end
2 changes: 1 addition & 1 deletion solutions/devsprint-caio-santos-7/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ SPEC REPOS:
SPEC CHECKSUMS:
SnapshotTesting: 6141c48b6aa76ead61431ca665c14ab9a066c53b

PODFILE CHECKSUM: 943c16186866fd17226e49884f6360bcda0046f8
PODFILE CHECKSUM: 329ee3d83fde0ac6a4546f9316b16ae63f8da3d2

COCOAPODS: 1.11.3