Skip to content

Commit 22ed984

Browse files
Rodrigo SoaresRodrigo Soares
authored andcommitted
Base project for Dev Sprint Pedro Alvarez 2
1 parent 58692d3 commit 22ed984

File tree

73 files changed

+3384
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3384
-0
lines changed

solutions/devsprint-pedro-alvarez-2/FinanceApp.xcodeproj/project.pbxproj

Lines changed: 849 additions & 0 deletions
Large diffs are not rendered by default.

solutions/devsprint-pedro-alvarez-2/FinanceApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// AppDelegate.swift
3+
// FinanceApp
4+
//
5+
// Created by Rodrigo Borges on 30/12/21.
6+
//
7+
8+
import UIKit
9+
10+
@main
11+
class AppDelegate: UIResponder, UIApplicationDelegate {
12+
13+
14+
15+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16+
17+
return true
18+
}
19+
20+
// MARK: UISceneSession Lifecycle
21+
22+
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
23+
24+
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
25+
}
26+
}
27+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// SceneDelegate.swift
3+
// FinanceApp
4+
//
5+
// Created by Rodrigo Borges on 30/12/21.
6+
//
7+
8+
import UIKit
9+
10+
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
11+
12+
var window: UIWindow?
13+
14+
15+
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
16+
17+
guard let windowScene = (scene as? UIWindowScene) else { return }
18+
19+
self.window = UIWindow(frame: UIScreen.main.bounds)
20+
self.window?.rootViewController = UINavigationController(rootViewController: HomeViewController())
21+
self.window?.windowScene = windowScene
22+
self.window?.makeKeyAndVisible()
23+
}
24+
}
25+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// DebugViewController.swift
3+
// GitHubApp
4+
//
5+
// Created by Rodrigo Borges on 07/01/22.
6+
//
7+
8+
import UIKit
9+
10+
/**
11+
12+
Use this ViewController to debug your View components.
13+
14+
1) Change `myView` type to your UIView subclass
15+
2) Set `myViewHeight` according to your View
16+
3) Set an instance of DebugViewController as window's rootViewController in `SceneDelegate.swift` file
17+
18+
*/
19+
20+
class DebugViewController: UIViewController {
21+
22+
private let myView: UIView = {
23+
24+
let view = UIView()
25+
view.translatesAutoresizingMaskIntoConstraints = false
26+
return view
27+
}()
28+
29+
private let myViewHeight: CGFloat = 100
30+
31+
init() {
32+
super.init(nibName: nil, bundle: nil)
33+
34+
view.backgroundColor = .white
35+
36+
view.addSubview(myView)
37+
38+
NSLayoutConstraint.activate([
39+
40+
myView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
41+
myView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
42+
myView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
43+
myView.heightAnchor.constraint(equalToConstant: myViewHeight),
44+
45+
])
46+
}
47+
48+
required init?(coder: NSCoder) {
49+
fatalError("init(coder:) has not been implemented")
50+
}
51+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// String+Extensions.swift
3+
// FinanceApp
4+
//
5+
// Created by Rodrigo Borges on 24/02/22.
6+
//
7+
8+
import Foundation
9+
10+
extension String {
11+
12+
static func activityDetails(with price: Float, and time: String) -> String {
13+
14+
return "$\(price)\(time)"
15+
}
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// UITableViewCell+Extensions.swift
3+
// FinanceApp
4+
//
5+
// Created by Rodrigo Borges on 24/02/22.
6+
//
7+
8+
import Foundation
9+
import UIKit
10+
11+
extension UITableViewCell {
12+
13+
class func classIdentifier() -> String {
14+
guard let className = String(describing: self).components(separatedBy: ".").last else {
15+
return ""
16+
}
17+
18+
return className
19+
}
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// ActivityDetails.swift
3+
// FinanceApp
4+
//
5+
// Created by Rodrigo Borges on 24/02/22.
6+
//
7+
8+
import Foundation
9+
10+
struct ActivityDetails: Decodable {
11+
12+
let name: String
13+
let price: Float
14+
let category: String
15+
let time: String
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// Contact.swift
3+
// FinanceApp
4+
//
5+
// Created by Rodrigo Borges on 24/02/22.
6+
//
7+
8+
import Foundation
9+
10+
struct Contact: Decodable {
11+
12+
let name: String
13+
let phone: String
14+
}

0 commit comments

Comments
 (0)