Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ccc08d8
Criação do projeto.
AccentureASilva May 6, 2019
c42532a
pod init.
AccentureASilva May 6, 2019
7542e75
add gitignore.
AccentureASilva May 6, 2019
9bef8cc
Add pods no projeto.
AccentureASilva May 6, 2019
ff86cdc
Arquitetura do projeto;
AccentureASilva May 6, 2019
b9dbe9e
Criação dos modelos.
AccentureASilva May 6, 2019
920f13d
Adicionando fontes para o projeto.
AccentureASilva May 6, 2019
f68f334
Add ícones no projeto.
AccentureASilva May 6, 2019
cabb85d
Criação do RouterAPI.
AccentureASilva May 7, 2019
555ae17
Montagem do esqueleto do módulo Form com Clean Swift.
AccentureASilva May 7, 2019
5efe633
Montagem do esqueleto do módulo Detail em Clean Swift.
AccentureASilva May 7, 2019
a1624d6
Add classes de estilo para Cores e Botões.
AccentureASilva May 7, 2019
1395f07
Ajustes.
AccentureASilva May 7, 2019
e919570
Criação Extensions.
AccentureASilva May 7, 2019
43d792b
Add icones no projeto.
AccentureASilva May 7, 2019
66c0eee
Add cells do Form.
AccentureASilva May 7, 2019
f7801d3
Add pod MBProgressHUD.
AccentureASilva May 7, 2019
525d450
Add alertMessage, showLoading e HideLoading.
AccentureASilva May 7, 2019
b61471e
Ajustes no checkForm.
AccentureASilva May 8, 2019
294fca8
Ajustes.
AccentureASilva May 8, 2019
41f4735
Ajustes.
AccentureASilva May 8, 2019
eb17a1a
Validações nos campos.
AccentureASilva May 8, 2019
1ccecfb
Criação da classe Validator para validações dos campos.
AccentureASilva May 8, 2019
4f2332e
Validação do form.
AccentureASilva May 8, 2019
03a4e63
Ajustes.
AccentureASilva May 8, 2019
fb91d00
Adicionando novas imagens.
AccentureASilva May 8, 2019
f884dd4
Inserindo section para Detail.
AccentureASilva May 8, 2019
22be7ec
FormSuccesVC.
AccentureASilva May 8, 2019
d421814
Criação FundNameTableViewCell.
AccentureASilva May 8, 2019
e07bb9b
Criação AboutTableViewCell.
AccentureASilva May 8, 2019
f30e27f
Add novas imagens.
AccentureASilva May 8, 2019
28d065a
Add novas imagens.
AccentureASilva May 8, 2019
a7c7759
Add RiskTableViewCell.
AccentureASilva May 8, 2019
5e383cd
Add MoreInfoTableViewCell.
AccentureASilva May 8, 2019
f5619ef
Add InfoTableViewCell.
AccentureASilva May 8, 2019
017e0d9
Add imagens.
AccentureASilva May 8, 2019
2bd8c31
Criação DownInfoTableViewCell.
AccentureASilva May 8, 2019
adb3440
Ajustes.
AccentureASilva May 8, 2019
f15153f
DetailRouter.
AccentureASilva May 8, 2019
3fe90c0
Ajustes.
AccentureASilva May 9, 2019
6bc73ff
Ajustes.
AccentureASilva May 9, 2019
8a25989
Ajustes.
AccentureASilva May 9, 2019
75f0896
Ajustes.
AccentureASilva May 9, 2019
334247f
Implementação das células para a tela de Investimento.
AccentureASilva May 9, 2019
aa18afb
Ajustes.
AccentureASilva May 9, 2019
908f988
Ajustes no layout.
AccentureASilva May 9, 2019
55250d1
Ajustes.
AccentureASilva May 9, 2019
8e5ac06
Testes Unitários.
AccentureASilva May 9, 2019
1b21f9e
README.
AccentureASilva May 9, 2019
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TesteiOS/Podfile.lock
TesteiOS/.DS_Store
TesteiOS/Pods/*
TesteiOS/TesteiOS.xcworkspace/*
TesteiOS/TesteiOS.xcworkspace/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added 20. Din [1926 - Ludwig Goller]/DINPro-Black.otf
Binary file not shown.
Binary file added 20. Din [1926 - Ludwig Goller]/DINPro-Bold.otf
Binary file not shown.
Binary file added 20. Din [1926 - Ludwig Goller]/DINPro-Light.otf
Binary file not shown.
Binary file not shown.
Binary file added 20. Din [1926 - Ludwig Goller]/DINPro-Regular.otf
Binary file not shown.
29 changes: 29 additions & 0 deletions TesteiOS/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'TesteiOS' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for TesteiOS
pod 'MBProgressHUD', '~> 1.1'
pod 'AlamofireObjectMapper', '~> 5.0'
pod 'Alamofire', '~> 4.5'
pod 'KeychainSwift', '~> 13.0'
pod 'MaterialComponents', '~> 70.0.0'

target 'TesteiOSTests' do
inherit! :search_paths
# Pods for testing
pod 'AlamofireObjectMapper', '~> 5.0'
pod 'Alamofire', '~> 4.5'
end

target 'TesteiOSUITests' do
inherit! :search_paths
# Pods for testing
pod 'AlamofireObjectMapper', '~> 5.0'
pod 'Alamofire', '~> 4.5'
end

end
10 changes: 10 additions & 0 deletions TesteiOS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TESTE SANTANDER README


ARQUITETURA: CLEAN SWIFT

- Instalar o cocoapods;
- Executar pod install pelo terminal, para a instalação das bibliotecas utilizadas no projeto.

- Candidato: Anderson Jesus Ferreira da Silva
- Empresa: Accenture
1,448 changes: 1,448 additions & 0 deletions TesteiOS/TesteiOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>TesteiOS.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>24</integer>
</dict>
<key>TesteiOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>25</integer>
</dict>
</dict>
</dict>
</plist>
46 changes: 46 additions & 0 deletions TesteiOS/TesteiOS/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// AppDelegate.swift
// TesteiOS
//
// Created by anderson.jesus.silva on 06/05/19.
// Copyright © 2019 anderson.jesus.silva. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// DetailInteractor.swift
// TesteiOS
//
// Created by anderson.jesus.silva on 07/05/19.
// Copyright © 2019 anderson.jesus.silva. All rights reserved.
//

import Foundation

protocol DetailInteractorInput: class {
func loadDetail()
}

protocol DetailInteractorOutput: class {
func resultDetail(sectionScreen:[SectionScreens])
func failure(msg:String)
}

class DetailInteractor: NSObject, DetailInteractorInput {

private(set) var presenter : DetailPresenter
private(set) var wireframe : DetailWireframe

weak var presentOutput: DetailInteractorOutput?

init(presenter:DetailPresenter, wireframe:DetailWireframe) {
self.presenter = presenter
self.wireframe = wireframe
}

private lazy var provider : DetailProvider = {
return DetailProvider.init()
}()

//MARK: DetailInteractorInput
func loadDetail() {
self.provider.getDetails { (baseClass, error) in
guard error == nil else {
self.presentOutput?.failure(msg: error!.localizedDescription)
return
}

if let baseClass = baseClass, let screen = baseClass.screen {

var sectionScreens:[SectionScreens] = [SectionScreens]()
var nameFund:FundName?
var what:WhatIs?
var riskScreen:RiskScreen?
var moreInfo:MoreInformation?

//FUND NAME
if let title = screen.title, let fundName = screen.fundName {
nameFund = FundName(title: title, name: fundName)
sectionScreens.append(SectionScreens(fundName: nameFund!, whatId: nil, riskScreen: nil, moreInformation: nil, info: nil, downInfo: nil, rows: 1))
}

//WHAT IS
if let whatIs = screen.whatIs, let definition = screen.definition {
what = WhatIs(title: whatIs, definition: definition)
sectionScreens.append(SectionScreens(fundName: nil, whatId: what!, riskScreen: nil, moreInformation: nil, info: nil, downInfo: nil, rows: 1))
}

//RISK SCREEN
if let titleRisk = screen.riskTitle, let risk = screen.risk {
riskScreen = RiskScreen(title: titleRisk, risk: risk)
sectionScreens.append(SectionScreens(fundName: nil, whatId: nil, riskScreen: riskScreen, moreInformation: nil, info: nil, downInfo: nil, rows: 1))
}

//MORE INFORMATION
if let titleMore = screen.infoTitle, let infoM = screen.moreInfo {
moreInfo = MoreInformation(title: titleMore, more: infoM)
sectionScreens.append(SectionScreens(fundName: nil, whatId: nil, riskScreen: nil, moreInformation: moreInfo, info: nil, downInfo: nil, rows: 1))
}

//INFO
if let info = screen.info {
sectionScreens.append(SectionScreens(fundName: nil, whatId: nil, riskScreen: nil, moreInformation: nil, info: info, downInfo: nil, rows: info.count))
}

//DOWNINFO
if let downInfo = screen.downInfo {
sectionScreens.append(SectionScreens(fundName: nil, whatId: nil, riskScreen: nil, moreInformation: nil, info: nil, downInfo: downInfo, rows: downInfo.count))
}


self.presentOutput?.resultDetail(sectionScreen: sectionScreens)
}
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// DetailPresenter.swift
// TesteiOS
//
// Created by anderson.jesus.silva on 07/05/19.
// Copyright © 2019 anderson.jesus.silva. All rights reserved.
//

import Foundation

protocol DetailPresenterProtocol: class {
func loadDetail(sectionScreen:[SectionScreens])
func failureView(msg:String)
}

class DetailPresenter: NSObject, DetailInteractorOutput {

weak var output: DetailPresenterProtocol?

//MARK: DetailInteractorOutput
func resultDetail(sectionScreen:[SectionScreens]) {
self.output?.loadDetail(sectionScreen: sectionScreen)
}

func failure(msg:String) {
self.output?.failureView(msg: msg)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// DetailProvider.swift
// TesteiOS
//
// Created by anderson.jesus.silva on 07/05/19.
// Copyright © 2019 anderson.jesus.silva. All rights reserved.
//

import Foundation
import Alamofire
import AlamofireObjectMapper
import ObjectMapper

class DetailProvider: NSObject {

func getDetails(completion:@escaping(_ detailBase:BaseClass?, _ error:Error?) -> Void) -> Void {

request(RouterAPI.detail)
.validate(statusCode: 200..<300)
.responseObject { (response:DataResponse<BaseClass>) in
switch response.result {
case .success(let base): completion(base, nil); break;
case .failure(let error): completion(nil, error); break;
}
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// DetailRouter.swift
// TesteiOS
//
// Created by anderson.jesus.silva on 08/05/19.
// Copyright © 2019 anderson.jesus.silva. All rights reserved.
//

import UIKit
import SafariServices

protocol DetailRouterProtocol:class {
func routerToSafari()
}

class DetailRouter:DetailRouterProtocol {

var VC:DetailViewController!

func routerToSafari() {

if let url = URL(string: "https://www.google.com") {
if #available(iOS 11.0, *) {
let config = SFSafariViewController.Configuration()
config.entersReaderIfAvailable = true

let view = SFSafariViewController(url: url, configuration: config)
self.VC.present(view, animated: true, completion: nil)
}else if #available(iOS 10.0, *){
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}else{
UIApplication.shared.openURL(url)
}
}
}

}
Loading