Skip to content

Commit 897a724

Browse files
authored
Merge branch 'main' into main
2 parents af93ce5 + 7814b1e commit 897a724

File tree

11 files changed

+265
-9
lines changed

11 files changed

+265
-9
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ fastlane/report.xml
6969
fastlane/Preview.html
7070
fastlane/screenshots
7171
fastlane/test_output
72+
73+
### Projects ###
74+
solutions/devsprint-caio-santos-7/*.xcodeproj
75+
solutions/devsprint-caio-santos-7/*.xcworkspace

solutions/devsprint-caio-santos-7/FinanceApp/AppDelegate/SceneDelegate.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@
88
import UIKit
99

1010
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
11-
1211
var window: UIWindow?
1312

14-
1513
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
1614

1715
guard let windowScene = (scene as? UIWindowScene) else { return }
1816

1917
self.window = UIWindow(frame: UIScreen.main.bounds)
20-
self.window?.rootViewController = UINavigationController(rootViewController: ActivityDetailsViewController())
18+
self.window?.rootViewController = UINavigationController(rootViewController: TabBarViewController())
2119
self.window?.windowScene = windowScene
2220
self.window?.makeKeyAndVisible()
2321
}
2422
}
25-
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// TabBarController.swift
3+
// FinanceApp
4+
//
5+
// Created by Vinicius on 13/10/22.
6+
//
7+
8+
import Foundation
9+
import UIKit
10+
11+
class TabBarViewController: UITabBarController, UITabBarControllerDelegate {
12+
override func viewDidLoad() {
13+
super.viewDidLoad()
14+
15+
// Atribuir delegate para que a VC utilize os metodos do delegate
16+
self.delegate = self
17+
}
18+
19+
override func viewWillAppear(_ animated: Bool) {
20+
super.viewWillAppear(animated)
21+
22+
//Criação da primeira tab
23+
let tabHome = HomeViewController()
24+
let tabHomeBarItem = UITabBarItem(title: "Home",
25+
image: UIImage(systemName: "house.fill"),
26+
selectedImage: nil)
27+
28+
tabHome.tabBarItem = tabHomeBarItem
29+
30+
//Criacao da segunda tab
31+
let tabTransfers = TransfersViewController()
32+
let tabTransfersBarItem = UITabBarItem(title: "Transfers",
33+
image: UIImage(systemName: "arrow.up.arrow.down"),
34+
selectedImage: nil)
35+
36+
tabTransfers.tabBarItem = tabTransfersBarItem
37+
38+
self.viewControllers = [tabHome, tabTransfers]
39+
}
40+
41+
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
42+
43+
}
44+
}

solutions/devsprint-caio-santos-7/FinanceApp/Resources/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
<key>NSAppTransportSecurity</key>
22+
<true/>
523
<key>UIApplicationSceneManifest</key>
624
<dict>
725
<key>UIApplicationSupportsMultipleScenes</key>
@@ -19,5 +37,9 @@
1937
</array>
2038
</dict>
2139
</dict>
40+
<key>UILaunchStoryboardName</key>
41+
<string>LaunchScreen</string>
42+
<key>UISupportedInterfaceOrientations</key>
43+
<array/>
2244
</dict>
2345
</plist>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
//
2+
// ActivityCellView.swift
3+
// FinanceApp
4+
//
5+
// Created by Cleber Reis on 13/10/22.
6+
//
7+
8+
import UIKit
9+
10+
class ActivityCellView: UITableViewCell {
11+
12+
private lazy var icon: UIImageView = {
13+
let image = UIImageView()
14+
image.translatesAutoresizingMaskIntoConstraints = false
15+
image.image = UIImage(named: "fork.knife.circle.fill")
16+
image.contentMode = .scaleAspectFit
17+
image.layer.cornerRadius = 24
18+
image.clipsToBounds = true
19+
20+
return image
21+
}()
22+
23+
private lazy var stackView: UIStackView = {
24+
let stack = UIStackView()
25+
stack.translatesAutoresizingMaskIntoConstraints = false
26+
stack.axis = .vertical
27+
stack.spacing = 4
28+
29+
return stack
30+
}()
31+
32+
private lazy var titleLabel: UILabel = {
33+
let label = UILabel()
34+
label.translatesAutoresizingMaskIntoConstraints = false
35+
label.text = "Food court"
36+
label.font = .systemFont(ofSize: 16, weight: .semibold)
37+
38+
return label
39+
}()
40+
41+
private lazy var titleDescription: UILabel = {
42+
let label = UILabel()
43+
label.translatesAutoresizingMaskIntoConstraints = false
44+
label.text = "R$ 1000 - 8:57"
45+
label.font = .systemFont(ofSize: 14, weight: .regular)
46+
47+
return label
48+
}()
49+
50+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
51+
super.init(style: style, reuseIdentifier: reuseIdentifier)
52+
setupView()
53+
configViews()
54+
}
55+
56+
@available(*, unavailable)
57+
required init?(coder: NSCoder) { nil }
58+
}
59+
60+
extension ActivityCellView: ViewCodable {
61+
62+
func configViews() {
63+
backgroundColor = .white
64+
}
65+
66+
func buildHierarchy() {
67+
contentView.addSubview(icon)
68+
contentView.addSubview(stackView)
69+
stackView.addArrangedSubview(titleLabel)
70+
stackView.addArrangedSubview(titleDescription)
71+
}
72+
73+
74+
func setupConstraints() {
75+
76+
NSLayoutConstraint.activate([
77+
icon.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 8),
78+
icon.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 8),
79+
icon.heightAnchor.constraint(equalToConstant: 48),
80+
icon.widthAnchor.constraint(equalToConstant: 48),
81+
82+
stackView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
83+
stackView.leadingAnchor.constraint(equalTo: icon.trailingAnchor, constant: 8),
84+
stackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -8),
85+
86+
titleLabel.leadingAnchor.constraint(equalTo: stackView.trailingAnchor),
87+
titleLabel.trailingAnchor.constraint(equalTo: stackView.trailingAnchor),
88+
89+
titleDescription.leadingAnchor.constraint(equalTo: titleLabel.leadingAnchor),
90+
titleDescription.trailingAnchor.constraint(equalTo: titleLabel.trailingAnchor),
91+
])
92+
}
93+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// ActivityCellViewTests.swift
3+
// FinanceAppTests
4+
//
5+
// Created by Cleber Reis on 13/10/22.
6+
//
7+
8+
import UIKit
9+
import SnapshotTesting
10+
import XCTest
11+
12+
@testable import FinanceApp
13+
14+
final class ActivityCellViewTests: XCTestCase {
15+
16+
private var sut: ActivityCellView?
17+
18+
override func setUp() {
19+
20+
sut = ActivityCellView()
21+
let frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 64)
22+
sut?.frame = frame
23+
24+
}
25+
26+
func test_WhenInitActivityCellView_ThenView_ShouldHaveValidSnapshot() throws {
27+
let unwrappedSut = try XCTUnwrap(sut)
28+
assertSnapshot(matching: unwrappedSut, as: .image)
29+
30+
}
31+
32+
override func tearDown() {
33+
sut = nil
34+
}
35+
}

solutions/devsprint-caio-santos-7/Podfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@ target 'FinanceApp' do
1313
pod 'SnapshotTesting', '~> 1.9.0'
1414
end
1515

16-
target 'FinanceAppUITests' do
17-
# Pods for testing
18-
end
19-
2016
end

solutions/devsprint-caio-santos-7/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ SPEC REPOS:
1111
SPEC CHECKSUMS:
1212
SnapshotTesting: 6141c48b6aa76ead61431ca665c14ab9a066c53b
1313

14-
PODFILE CHECKSUM: 47d5e29d1f724e8d7c597d87a8ae9ab07e5d53aa
14+
PODFILE CHECKSUM: 943c16186866fd17226e49884f6360bcda0046f8
1515

1616
COCOAPODS: 1.11.3

0 commit comments

Comments
 (0)