diff --git a/SantanderTesteiOS.xcodeproj/project.pbxproj b/SantanderTesteiOS.xcodeproj/project.pbxproj new file mode 100644 index 00000000..0a4589ed --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/project.pbxproj @@ -0,0 +1,991 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 7A46F66C215908300031F419 /* AddContactWorkerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A46F66B215908300031F419 /* AddContactWorkerTests.swift */; }; + 7A46F66F2159099F0031F419 /* AddContactPresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A46F66E2159099F0031F419 /* AddContactPresenterTests.swift */; }; + F50442FE215741F2009DBA7D /* InvestmentInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50442FD215741F2009DBA7D /* InvestmentInfoView.swift */; }; + F504430121574213009DBA7D /* InvestmentInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F504430021574213009DBA7D /* InvestmentInfoView.xib */; }; + F5044304215742A3009DBA7D /* InvestmentInfoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5044302215742A3009DBA7D /* InvestmentInfoTableViewCell.swift */; }; + F5044305215742A3009DBA7D /* InvestmentInfoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5044303215742A3009DBA7D /* InvestmentInfoTableViewCell.xib */; }; + F5044308215744A2009DBA7D /* FundInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5044307215744A2009DBA7D /* FundInfo.swift */; }; + F50FD7DF2156DD3C0094E15C /* SantanderLabelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD7DE2156DD3C0094E15C /* SantanderLabelView.swift */; }; + F50FD7E22156DD9A0094E15C /* UIViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD7E12156DD9A0094E15C /* UIViewExtension.swift */; }; + F50FD7E42156DE3A0094E15C /* SantanderLabelView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7E32156DE3A0094E15C /* SantanderLabelView.xib */; }; + F50FD7E9215706FC0094E15C /* LayoutVerticalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD7E8215706FB0094E15C /* LayoutVerticalViewController.swift */; }; + F50FD7F421571BAB0094E15C /* DINEngschriftStd.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7EB21571BAA0094E15C /* DINEngschriftStd.otf */; }; + F50FD7F521571BAB0094E15C /* DINMittelschriftStd.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7EC21571BAA0094E15C /* DINMittelschriftStd.otf */; }; + F50FD7F621571BAB0094E15C /* DINNeuzeitGroteskStd-BdCond.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7ED21571BAA0094E15C /* DINNeuzeitGroteskStd-BdCond.otf */; }; + F50FD7F721571BAB0094E15C /* DINPro-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7EE21571BAA0094E15C /* DINPro-Bold.otf */; }; + F50FD7F821571BAB0094E15C /* DINPro-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7EF21571BAB0094E15C /* DINPro-Medium.otf */; }; + F50FD7F921571BAB0094E15C /* DINPro-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7F021571BAB0094E15C /* DINPro-Black.otf */; }; + F50FD7FA21571BAB0094E15C /* DINNeuzeitGroteskStd-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7F121571BAB0094E15C /* DINNeuzeitGroteskStd-Light.otf */; }; + F50FD7FB21571BAB0094E15C /* DINPro-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7F221571BAB0094E15C /* DINPro-Light.otf */; }; + F50FD7FC21571BAB0094E15C /* DINPro-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = F50FD7F321571BAB0094E15C /* DINPro-Regular.otf */; }; + F50FD7FF215731FD0094E15C /* ScreenMoreInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD7FE215731FD0094E15C /* ScreenMoreInfo.swift */; }; + F50FD8012157324F0094E15C /* Fund.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD8002157324F0094E15C /* Fund.swift */; }; + F50FD807215734160094E15C /* InvestmentFundMoreInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD806215734160094E15C /* InvestmentFundMoreInfoView.swift */; }; + F50FD8092157343F0094E15C /* InvestmentFundMoreInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F50FD8082157343F0094E15C /* InvestmentFundMoreInfoView.xib */; }; + F50FD80B215735E10094E15C /* UITableViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD80A215735E10094E15C /* UITableViewExtension.swift */; }; + F50FD80E215736110094E15C /* InvestmentFundMoreInfoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50FD80C215736110094E15C /* InvestmentFundMoreInfoTableViewCell.swift */; }; + F50FD80F215736110094E15C /* InvestmentFundMoreInfoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F50FD80D215736110094E15C /* InvestmentFundMoreInfoTableViewCell.xib */; }; + F547874F2156B88700A9DEB9 /* HTTPDomain.swift in Sources */ = {isa = PBXBuildFile; fileRef = F547874E2156B88700A9DEB9 /* HTTPDomain.swift */; }; + F54787512156B8FA00A9DEB9 /* HTTPEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = F54787502156B8FA00A9DEB9 /* HTTPEnvironment.swift */; }; + F54787532156BC7B00A9DEB9 /* NSErrorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F54787522156BC7A00A9DEB9 /* NSErrorExtension.swift */; }; + F54787592156C1B000A9DEB9 /* Screen.swift in Sources */ = {isa = PBXBuildFile; fileRef = F54787582156C1B000A9DEB9 /* Screen.swift */; }; + F547875B2156C20500A9DEB9 /* ScreenModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F547875A2156C20500A9DEB9 /* ScreenModel.swift */; }; + F54787632156CFEE00A9DEB9 /* LayoutAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F54787622156CFEE00A9DEB9 /* LayoutAnimation.swift */; }; + F59F16C52156921100505A52 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16C42156921100505A52 /* AppDelegate.swift */; }; + F59F16CC2156921500505A52 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F59F16CB2156921500505A52 /* Assets.xcassets */; }; + F59F16CF2156921500505A52 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F59F16CD2156921500505A52 /* LaunchScreen.storyboard */; }; + F59F16E52156921500505A52 /* SantanderTesteiOSUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16E42156921500505A52 /* SantanderTesteiOSUITests.swift */; }; + F59F16F5215692B700505A52 /* InvestmentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16F4215692B700505A52 /* InvestmentViewController.swift */; }; + F59F16F92156930A00505A52 /* InvestmentInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16F82156930A00505A52 /* InvestmentInteractor.swift */; }; + F59F16FB2156933E00505A52 /* InvestmentWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16FA2156933E00505A52 /* InvestmentWorker.swift */; }; + F59F16FD2156934D00505A52 /* InvestmentPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16FC2156934D00505A52 /* InvestmentPresenter.swift */; }; + F59F16FF2156935A00505A52 /* InvestmentRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F16FE2156935A00505A52 /* InvestmentRouter.swift */; }; + F59F17012156936800505A52 /* InvestmentModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F17002156936800505A52 /* InvestmentModels.swift */; }; + F59F17032156951A00505A52 /* AppNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F17022156951A00505A52 /* AppNavigationController.swift */; }; + F59F17082156B6AF00505A52 /* HTTRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F17072156B6AF00505A52 /* HTTRequest.swift */; }; + F59F170B2156B7BF00505A52 /* HTTPRequestable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F59F170A2156B7BF00505A52 /* HTTPRequestable.swift */; }; + F5C024552158042C00A5991D /* SantanderButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C024542158042C00A5991D /* SantanderButtonView.swift */; }; + F5C024582158044000A5991D /* SantanderButtonView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5C024572158044000A5991D /* SantanderButtonView.xib */; }; + F5C0245A2158187800A5991D /* FundDownInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C024592158187800A5991D /* FundDownInfo.swift */; }; + F5C0245D21581EDF00A5991D /* InvestmentDownInfoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0245B21581EDF00A5991D /* InvestmentDownInfoTableViewCell.swift */; }; + F5C0245E21581EDF00A5991D /* InvestmentDownInfoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5C0245C21581EDF00A5991D /* InvestmentDownInfoTableViewCell.xib */; }; + F5C02460215821B900A5991D /* AddContactViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0245F215821B900A5991D /* AddContactViewController.swift */; }; + F5C02463215821EA00A5991D /* AddContactInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C02462215821EA00A5991D /* AddContactInteractor.swift */; }; + F5C0246521583A3000A5991D /* AddContactWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0246421583A3000A5991D /* AddContactWorker.swift */; }; + F5C0246721583A3D00A5991D /* AddContactPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0246621583A3D00A5991D /* AddContactPresenter.swift */; }; + F5C0246921583A4C00A5991D /* AddContactRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0246821583A4C00A5991D /* AddContactRouter.swift */; }; + F5C0246B21583A5A00A5991D /* AddContactModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0246A21583A5A00A5991D /* AddContactModels.swift */; }; + F5C0246F2158423D00A5991D /* Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0246E2158423D00A5991D /* Cell.swift */; }; + F5C02471215844B700A5991D /* CellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C02470215844B700A5991D /* CellViewModel.swift */; }; + F5C02473215847DD00A5991D /* AddContactCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C02472215847DD00A5991D /* AddContactCell.swift */; }; + F5C02475215862E400A5991D /* AddContactFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C02474215862E400A5991D /* AddContactFieldView.swift */; }; + F5C02478215862FF00A5991D /* AddContactFieldView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5C02477215862FF00A5991D /* AddContactFieldView.xib */; }; + F5C0247A2158741700A5991D /* UITextFieldExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C024792158741700A5991D /* UITextFieldExtension.swift */; }; + F5C0247E215886BE00A5991D /* InvestmentWorkerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0247D215886BE00A5991D /* InvestmentWorkerTests.swift */; }; + F5C0248121588FA300A5991D /* InvestmentPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0248021588FA300A5991D /* InvestmentPresenter.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + F59F16D62156921500505A52 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F59F16B92156921100505A52 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F59F16C02156921100505A52; + remoteInfo = SantanderTesteiOS; + }; + F59F16E12156921500505A52 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F59F16B92156921100505A52 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F59F16C02156921100505A52; + remoteInfo = SantanderTesteiOS; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 7A46F66B215908300031F419 /* AddContactWorkerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactWorkerTests.swift; sourceTree = ""; }; + 7A46F66E2159099F0031F419 /* AddContactPresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactPresenterTests.swift; sourceTree = ""; }; + F50442FD215741F2009DBA7D /* InvestmentInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentInfoView.swift; sourceTree = ""; }; + F504430021574213009DBA7D /* InvestmentInfoView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InvestmentInfoView.xib; sourceTree = ""; }; + F5044302215742A3009DBA7D /* InvestmentInfoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentInfoTableViewCell.swift; sourceTree = ""; }; + F5044303215742A3009DBA7D /* InvestmentInfoTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InvestmentInfoTableViewCell.xib; sourceTree = ""; }; + F5044307215744A2009DBA7D /* FundInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FundInfo.swift; sourceTree = ""; }; + F50FD7DE2156DD3C0094E15C /* SantanderLabelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SantanderLabelView.swift; sourceTree = ""; }; + F50FD7E12156DD9A0094E15C /* UIViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewExtension.swift; sourceTree = ""; }; + F50FD7E32156DE3A0094E15C /* SantanderLabelView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SantanderLabelView.xib; sourceTree = ""; }; + F50FD7E8215706FB0094E15C /* LayoutVerticalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutVerticalViewController.swift; sourceTree = ""; }; + F50FD7EB21571BAA0094E15C /* DINEngschriftStd.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = DINEngschriftStd.otf; sourceTree = ""; }; + F50FD7EC21571BAA0094E15C /* DINMittelschriftStd.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = DINMittelschriftStd.otf; sourceTree = ""; }; + F50FD7ED21571BAA0094E15C /* DINNeuzeitGroteskStd-BdCond.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINNeuzeitGroteskStd-BdCond.otf"; sourceTree = ""; }; + F50FD7EE21571BAA0094E15C /* DINPro-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINPro-Bold.otf"; sourceTree = ""; }; + F50FD7EF21571BAB0094E15C /* DINPro-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINPro-Medium.otf"; sourceTree = ""; }; + F50FD7F021571BAB0094E15C /* DINPro-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINPro-Black.otf"; sourceTree = ""; }; + F50FD7F121571BAB0094E15C /* DINNeuzeitGroteskStd-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINNeuzeitGroteskStd-Light.otf"; sourceTree = ""; }; + F50FD7F221571BAB0094E15C /* DINPro-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINPro-Light.otf"; sourceTree = ""; }; + F50FD7F321571BAB0094E15C /* DINPro-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DINPro-Regular.otf"; sourceTree = ""; }; + F50FD7FE215731FD0094E15C /* ScreenMoreInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenMoreInfo.swift; sourceTree = ""; }; + F50FD8002157324F0094E15C /* Fund.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fund.swift; sourceTree = ""; }; + F50FD806215734160094E15C /* InvestmentFundMoreInfoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InvestmentFundMoreInfoView.swift; sourceTree = ""; }; + F50FD8082157343F0094E15C /* InvestmentFundMoreInfoView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InvestmentFundMoreInfoView.xib; sourceTree = ""; }; + F50FD80A215735E10094E15C /* UITableViewExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableViewExtension.swift; sourceTree = ""; }; + F50FD80C215736110094E15C /* InvestmentFundMoreInfoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentFundMoreInfoTableViewCell.swift; sourceTree = ""; }; + F50FD80D215736110094E15C /* InvestmentFundMoreInfoTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InvestmentFundMoreInfoTableViewCell.xib; sourceTree = ""; }; + F547874E2156B88700A9DEB9 /* HTTPDomain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPDomain.swift; sourceTree = ""; }; + F54787502156B8FA00A9DEB9 /* HTTPEnvironment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPEnvironment.swift; sourceTree = ""; }; + F54787522156BC7A00A9DEB9 /* NSErrorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSErrorExtension.swift; sourceTree = ""; }; + F54787582156C1B000A9DEB9 /* Screen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Screen.swift; sourceTree = ""; }; + F547875A2156C20500A9DEB9 /* ScreenModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScreenModel.swift; sourceTree = ""; }; + F54787622156CFEE00A9DEB9 /* LayoutAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutAnimation.swift; sourceTree = ""; }; + F59F16C12156921100505A52 /* SantanderTesteiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SantanderTesteiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F59F16C42156921100505A52 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + F59F16CB2156921500505A52 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F59F16CE2156921500505A52 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + F59F16D02156921500505A52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F59F16D52156921500505A52 /* SantanderTesteiOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SantanderTesteiOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F59F16DB2156921500505A52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F59F16E02156921500505A52 /* SantanderTesteiOSUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SantanderTesteiOSUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F59F16E42156921500505A52 /* SantanderTesteiOSUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SantanderTesteiOSUITests.swift; sourceTree = ""; }; + F59F16E62156921500505A52 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F59F16F4215692B700505A52 /* InvestmentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentViewController.swift; sourceTree = ""; }; + F59F16F82156930A00505A52 /* InvestmentInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentInteractor.swift; sourceTree = ""; }; + F59F16FA2156933E00505A52 /* InvestmentWorker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentWorker.swift; sourceTree = ""; }; + F59F16FC2156934D00505A52 /* InvestmentPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentPresenter.swift; sourceTree = ""; }; + F59F16FE2156935A00505A52 /* InvestmentRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentRouter.swift; sourceTree = ""; }; + F59F17002156936800505A52 /* InvestmentModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentModels.swift; sourceTree = ""; }; + F59F17022156951A00505A52 /* AppNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppNavigationController.swift; sourceTree = ""; }; + F59F17072156B6AF00505A52 /* HTTRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTRequest.swift; sourceTree = ""; }; + F59F170A2156B7BF00505A52 /* HTTPRequestable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPRequestable.swift; sourceTree = ""; }; + F5C024542158042C00A5991D /* SantanderButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SantanderButtonView.swift; sourceTree = ""; }; + F5C024572158044000A5991D /* SantanderButtonView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SantanderButtonView.xib; sourceTree = ""; }; + F5C024592158187800A5991D /* FundDownInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FundDownInfo.swift; sourceTree = ""; }; + F5C0245B21581EDF00A5991D /* InvestmentDownInfoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentDownInfoTableViewCell.swift; sourceTree = ""; }; + F5C0245C21581EDF00A5991D /* InvestmentDownInfoTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InvestmentDownInfoTableViewCell.xib; sourceTree = ""; }; + F5C0245F215821B900A5991D /* AddContactViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactViewController.swift; sourceTree = ""; }; + F5C02462215821EA00A5991D /* AddContactInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactInteractor.swift; sourceTree = ""; }; + F5C0246421583A3000A5991D /* AddContactWorker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactWorker.swift; sourceTree = ""; }; + F5C0246621583A3D00A5991D /* AddContactPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactPresenter.swift; sourceTree = ""; }; + F5C0246821583A4C00A5991D /* AddContactRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactRouter.swift; sourceTree = ""; }; + F5C0246A21583A5A00A5991D /* AddContactModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactModels.swift; sourceTree = ""; }; + F5C0246E2158423D00A5991D /* Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cell.swift; sourceTree = ""; }; + F5C02470215844B700A5991D /* CellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellViewModel.swift; sourceTree = ""; }; + F5C02472215847DD00A5991D /* AddContactCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactCell.swift; sourceTree = ""; }; + F5C02474215862E400A5991D /* AddContactFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactFieldView.swift; sourceTree = ""; }; + F5C02477215862FF00A5991D /* AddContactFieldView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddContactFieldView.xib; sourceTree = ""; }; + F5C024792158741700A5991D /* UITextFieldExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextFieldExtension.swift; sourceTree = ""; }; + F5C0247D215886BE00A5991D /* InvestmentWorkerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentWorkerTests.swift; sourceTree = ""; }; + F5C0248021588FA300A5991D /* InvestmentPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvestmentPresenter.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F59F16BE2156921100505A52 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F59F16D22156921500505A52 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F59F16DD2156921500505A52 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7A46F66D215908340031F419 /* AddContact */ = { + isa = PBXGroup; + children = ( + 7A46F66B215908300031F419 /* AddContactWorkerTests.swift */, + 7A46F66E2159099F0031F419 /* AddContactPresenterTests.swift */, + ); + path = AddContact; + sourceTree = ""; + }; + F50442FC215741B8009DBA7D /* MoreInfo */ = { + isa = PBXGroup; + children = ( + F50FD806215734160094E15C /* InvestmentFundMoreInfoView.swift */, + F50FD8082157343F0094E15C /* InvestmentFundMoreInfoView.xib */, + F50FD8102157362F0094E15C /* Cells */, + ); + path = MoreInfo; + sourceTree = ""; + }; + F50442FF215741FE009DBA7D /* Info */ = { + isa = PBXGroup; + children = ( + F50442FD215741F2009DBA7D /* InvestmentInfoView.swift */, + F504430021574213009DBA7D /* InvestmentInfoView.xib */, + F5044306215742BC009DBA7D /* Cells */, + ); + path = Info; + sourceTree = ""; + }; + F5044306215742BC009DBA7D /* Cells */ = { + isa = PBXGroup; + children = ( + F5044302215742A3009DBA7D /* InvestmentInfoTableViewCell.swift */, + F5044303215742A3009DBA7D /* InvestmentInfoTableViewCell.xib */, + F5C0245B21581EDF00A5991D /* InvestmentDownInfoTableViewCell.swift */, + F5C0245C21581EDF00A5991D /* InvestmentDownInfoTableViewCell.xib */, + ); + path = Cells; + sourceTree = ""; + }; + F50FD7DD2156DCB70094E15C /* Views */ = { + isa = PBXGroup; + children = ( + F50FD7EA215716AC0094E15C /* LayoutVerticalViewController */, + F50FD7E02156DD620094E15C /* SantanderLabel */, + F5C024562158043100A5991D /* SantanderButton */, + ); + path = Views; + sourceTree = ""; + }; + F50FD7E02156DD620094E15C /* SantanderLabel */ = { + isa = PBXGroup; + children = ( + F50FD7DE2156DD3C0094E15C /* SantanderLabelView.swift */, + F50FD7E32156DE3A0094E15C /* SantanderLabelView.xib */, + ); + path = SantanderLabel; + sourceTree = ""; + }; + F50FD7EA215716AC0094E15C /* LayoutVerticalViewController */ = { + isa = PBXGroup; + children = ( + F50FD7E8215706FB0094E15C /* LayoutVerticalViewController.swift */, + F54787622156CFEE00A9DEB9 /* LayoutAnimation.swift */, + ); + path = LayoutVerticalViewController; + sourceTree = ""; + }; + F50FD7FD21571BB30094E15C /* Fonts */ = { + isa = PBXGroup; + children = ( + F50FD7EB21571BAA0094E15C /* DINEngschriftStd.otf */, + F50FD7EC21571BAA0094E15C /* DINMittelschriftStd.otf */, + F50FD7ED21571BAA0094E15C /* DINNeuzeitGroteskStd-BdCond.otf */, + F50FD7F121571BAB0094E15C /* DINNeuzeitGroteskStd-Light.otf */, + F50FD7F021571BAB0094E15C /* DINPro-Black.otf */, + F50FD7EE21571BAA0094E15C /* DINPro-Bold.otf */, + F50FD7F221571BAB0094E15C /* DINPro-Light.otf */, + F50FD7EF21571BAB0094E15C /* DINPro-Medium.otf */, + F50FD7F321571BAB0094E15C /* DINPro-Regular.otf */, + ); + path = Fonts; + sourceTree = ""; + }; + F50FD805215734160094E15C /* Views */ = { + isa = PBXGroup; + children = ( + F50442FC215741B8009DBA7D /* MoreInfo */, + F50442FF215741FE009DBA7D /* Info */, + ); + path = Views; + sourceTree = ""; + }; + F50FD8102157362F0094E15C /* Cells */ = { + isa = PBXGroup; + children = ( + F50FD80C215736110094E15C /* InvestmentFundMoreInfoTableViewCell.swift */, + F50FD80D215736110094E15C /* InvestmentFundMoreInfoTableViewCell.xib */, + ); + path = Cells; + sourceTree = ""; + }; + F54787542156BCA000A9DEB9 /* Commons */ = { + isa = PBXGroup; + children = ( + F50FD7DD2156DCB70094E15C /* Views */, + F59F17092156B6ED00505A52 /* Networking */, + F54787552156BCAC00A9DEB9 /* Extensions */, + ); + path = Commons; + sourceTree = ""; + }; + F54787552156BCAC00A9DEB9 /* Extensions */ = { + isa = PBXGroup; + children = ( + F54787522156BC7A00A9DEB9 /* NSErrorExtension.swift */, + F50FD7E12156DD9A0094E15C /* UIViewExtension.swift */, + F50FD80A215735E10094E15C /* UITableViewExtension.swift */, + F5C024792158741700A5991D /* UITextFieldExtension.swift */, + ); + path = Extensions; + sourceTree = ""; + }; + F59F16B82156921100505A52 = { + isa = PBXGroup; + children = ( + F59F16C32156921100505A52 /* SantanderTesteiOS */, + F59F16D82156921500505A52 /* SantanderTesteiOSTests */, + F59F16E32156921500505A52 /* SantanderTesteiOSUITests */, + F59F16C22156921100505A52 /* Products */, + ); + sourceTree = ""; + }; + F59F16C22156921100505A52 /* Products */ = { + isa = PBXGroup; + children = ( + F59F16C12156921100505A52 /* SantanderTesteiOS.app */, + F59F16D52156921500505A52 /* SantanderTesteiOSTests.xctest */, + F59F16E02156921500505A52 /* SantanderTesteiOSUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + F59F16C32156921100505A52 /* SantanderTesteiOS */ = { + isa = PBXGroup; + children = ( + F54787542156BCA000A9DEB9 /* Commons */, + F59F16F32156926500505A52 /* App */, + F59F17062156B0C700505A52 /* Models */, + F59F16F6215692BC00505A52 /* Scenes */, + F59F16F22156923E00505A52 /* Supporting Files */, + ); + path = SantanderTesteiOS; + sourceTree = ""; + }; + F59F16D82156921500505A52 /* SantanderTesteiOSTests */ = { + isa = PBXGroup; + children = ( + F5C0247F215886C400A5991D /* Investment */, + 7A46F66D215908340031F419 /* AddContact */, + F59F16DB2156921500505A52 /* Info.plist */, + ); + path = SantanderTesteiOSTests; + sourceTree = ""; + }; + F59F16E32156921500505A52 /* SantanderTesteiOSUITests */ = { + isa = PBXGroup; + children = ( + F59F16E42156921500505A52 /* SantanderTesteiOSUITests.swift */, + F59F16E62156921500505A52 /* Info.plist */, + ); + path = SantanderTesteiOSUITests; + sourceTree = ""; + }; + F59F16F22156923E00505A52 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F50FD7FD21571BB30094E15C /* Fonts */, + F59F16CB2156921500505A52 /* Assets.xcassets */, + F59F16CD2156921500505A52 /* LaunchScreen.storyboard */, + F59F16D02156921500505A52 /* Info.plist */, + ); + path = "Supporting Files"; + sourceTree = ""; + }; + F59F16F32156926500505A52 /* App */ = { + isa = PBXGroup; + children = ( + F59F16C42156921100505A52 /* AppDelegate.swift */, + F59F17022156951A00505A52 /* AppNavigationController.swift */, + ); + path = App; + sourceTree = ""; + }; + F59F16F6215692BC00505A52 /* Scenes */ = { + isa = PBXGroup; + children = ( + F59F16F7215692CB00505A52 /* Investment */, + F5C02461215821CA00A5991D /* AddContact */, + ); + path = Scenes; + sourceTree = ""; + }; + F59F16F7215692CB00505A52 /* Investment */ = { + isa = PBXGroup; + children = ( + F50FD805215734160094E15C /* Views */, + F59F16F4215692B700505A52 /* InvestmentViewController.swift */, + F59F16F82156930A00505A52 /* InvestmentInteractor.swift */, + F59F16FA2156933E00505A52 /* InvestmentWorker.swift */, + F59F16FC2156934D00505A52 /* InvestmentPresenter.swift */, + F59F16FE2156935A00505A52 /* InvestmentRouter.swift */, + F59F17002156936800505A52 /* InvestmentModels.swift */, + ); + path = Investment; + sourceTree = ""; + }; + F59F17062156B0C700505A52 /* Models */ = { + isa = PBXGroup; + children = ( + F547875A2156C20500A9DEB9 /* ScreenModel.swift */, + F54787582156C1B000A9DEB9 /* Screen.swift */, + F50FD7FE215731FD0094E15C /* ScreenMoreInfo.swift */, + F50FD8002157324F0094E15C /* Fund.swift */, + F5044307215744A2009DBA7D /* FundInfo.swift */, + F5C024592158187800A5991D /* FundDownInfo.swift */, + F5C02472215847DD00A5991D /* AddContactCell.swift */, + F5C0246E2158423D00A5991D /* Cell.swift */, + F5C02470215844B700A5991D /* CellViewModel.swift */, + ); + path = Models; + sourceTree = ""; + }; + F59F17092156B6ED00505A52 /* Networking */ = { + isa = PBXGroup; + children = ( + F59F17072156B6AF00505A52 /* HTTRequest.swift */, + F59F170A2156B7BF00505A52 /* HTTPRequestable.swift */, + F547874E2156B88700A9DEB9 /* HTTPDomain.swift */, + F54787502156B8FA00A9DEB9 /* HTTPEnvironment.swift */, + ); + path = Networking; + sourceTree = ""; + }; + F5C024562158043100A5991D /* SantanderButton */ = { + isa = PBXGroup; + children = ( + F5C024542158042C00A5991D /* SantanderButtonView.swift */, + F5C024572158044000A5991D /* SantanderButtonView.xib */, + ); + path = SantanderButton; + sourceTree = ""; + }; + F5C02461215821CA00A5991D /* AddContact */ = { + isa = PBXGroup; + children = ( + F5C02476215862F000A5991D /* Views */, + F5C0245F215821B900A5991D /* AddContactViewController.swift */, + F5C02462215821EA00A5991D /* AddContactInteractor.swift */, + F5C0246421583A3000A5991D /* AddContactWorker.swift */, + F5C0246621583A3D00A5991D /* AddContactPresenter.swift */, + F5C0246821583A4C00A5991D /* AddContactRouter.swift */, + F5C0246A21583A5A00A5991D /* AddContactModels.swift */, + ); + path = AddContact; + sourceTree = ""; + }; + F5C02476215862F000A5991D /* Views */ = { + isa = PBXGroup; + children = ( + F5C02474215862E400A5991D /* AddContactFieldView.swift */, + F5C02477215862FF00A5991D /* AddContactFieldView.xib */, + ); + path = Views; + sourceTree = ""; + }; + F5C0247F215886C400A5991D /* Investment */ = { + isa = PBXGroup; + children = ( + F5C0247D215886BE00A5991D /* InvestmentWorkerTests.swift */, + F5C0248021588FA300A5991D /* InvestmentPresenter.swift */, + ); + path = Investment; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F59F16C02156921100505A52 /* SantanderTesteiOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = F59F16E92156921500505A52 /* Build configuration list for PBXNativeTarget "SantanderTesteiOS" */; + buildPhases = ( + F59F16BD2156921100505A52 /* Sources */, + F59F16BE2156921100505A52 /* Frameworks */, + F59F16BF2156921100505A52 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SantanderTesteiOS; + productName = SantanderTesteiOS; + productReference = F59F16C12156921100505A52 /* SantanderTesteiOS.app */; + productType = "com.apple.product-type.application"; + }; + F59F16D42156921500505A52 /* SantanderTesteiOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F59F16EC2156921500505A52 /* Build configuration list for PBXNativeTarget "SantanderTesteiOSTests" */; + buildPhases = ( + F59F16D12156921500505A52 /* Sources */, + F59F16D22156921500505A52 /* Frameworks */, + F59F16D32156921500505A52 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F59F16D72156921500505A52 /* PBXTargetDependency */, + ); + name = SantanderTesteiOSTests; + productName = SantanderTesteiOSTests; + productReference = F59F16D52156921500505A52 /* SantanderTesteiOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + F59F16DF2156921500505A52 /* SantanderTesteiOSUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = F59F16EF2156921500505A52 /* Build configuration list for PBXNativeTarget "SantanderTesteiOSUITests" */; + buildPhases = ( + F59F16DC2156921500505A52 /* Sources */, + F59F16DD2156921500505A52 /* Frameworks */, + F59F16DE2156921500505A52 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F59F16E22156921500505A52 /* PBXTargetDependency */, + ); + name = SantanderTesteiOSUITests; + productName = SantanderTesteiOSUITests; + productReference = F59F16E02156921500505A52 /* SantanderTesteiOSUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F59F16B92156921100505A52 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0940; + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "Diego Costa"; + TargetAttributes = { + F59F16C02156921100505A52 = { + CreatedOnToolsVersion = 9.4.1; + }; + F59F16D42156921500505A52 = { + CreatedOnToolsVersion = 9.4.1; + TestTargetID = F59F16C02156921100505A52; + }; + F59F16DF2156921500505A52 = { + CreatedOnToolsVersion = 9.4.1; + TestTargetID = F59F16C02156921100505A52; + }; + }; + }; + buildConfigurationList = F59F16BC2156921100505A52 /* Build configuration list for PBXProject "SantanderTesteiOS" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F59F16B82156921100505A52; + productRefGroup = F59F16C22156921100505A52 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F59F16C02156921100505A52 /* SantanderTesteiOS */, + F59F16D42156921500505A52 /* SantanderTesteiOSTests */, + F59F16DF2156921500505A52 /* SantanderTesteiOSUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F59F16BF2156921100505A52 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F5C0245E21581EDF00A5991D /* InvestmentDownInfoTableViewCell.xib in Resources */, + F50FD80F215736110094E15C /* InvestmentFundMoreInfoTableViewCell.xib in Resources */, + F50FD7FC21571BAB0094E15C /* DINPro-Regular.otf in Resources */, + F50FD7F621571BAB0094E15C /* DINNeuzeitGroteskStd-BdCond.otf in Resources */, + F59F16CF2156921500505A52 /* LaunchScreen.storyboard in Resources */, + F50FD7F821571BAB0094E15C /* DINPro-Medium.otf in Resources */, + F50FD7E42156DE3A0094E15C /* SantanderLabelView.xib in Resources */, + F504430121574213009DBA7D /* InvestmentInfoView.xib in Resources */, + F50FD7F421571BAB0094E15C /* DINEngschriftStd.otf in Resources */, + F5C024582158044000A5991D /* SantanderButtonView.xib in Resources */, + F5C02478215862FF00A5991D /* AddContactFieldView.xib in Resources */, + F50FD7F921571BAB0094E15C /* DINPro-Black.otf in Resources */, + F50FD7FB21571BAB0094E15C /* DINPro-Light.otf in Resources */, + F50FD7F721571BAB0094E15C /* DINPro-Bold.otf in Resources */, + F50FD7FA21571BAB0094E15C /* DINNeuzeitGroteskStd-Light.otf in Resources */, + F5044305215742A3009DBA7D /* InvestmentInfoTableViewCell.xib in Resources */, + F50FD8092157343F0094E15C /* InvestmentFundMoreInfoView.xib in Resources */, + F59F16CC2156921500505A52 /* Assets.xcassets in Resources */, + F50FD7F521571BAB0094E15C /* DINMittelschriftStd.otf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F59F16D32156921500505A52 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F59F16DE2156921500505A52 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F59F16BD2156921100505A52 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F50FD80E215736110094E15C /* InvestmentFundMoreInfoTableViewCell.swift in Sources */, + F59F17082156B6AF00505A52 /* HTTRequest.swift in Sources */, + F547875B2156C20500A9DEB9 /* ScreenModel.swift in Sources */, + F59F16FB2156933E00505A52 /* InvestmentWorker.swift in Sources */, + F50FD80B215735E10094E15C /* UITableViewExtension.swift in Sources */, + F5C02463215821EA00A5991D /* AddContactInteractor.swift in Sources */, + F5C02460215821B900A5991D /* AddContactViewController.swift in Sources */, + F5C0246521583A3000A5991D /* AddContactWorker.swift in Sources */, + F59F16FF2156935A00505A52 /* InvestmentRouter.swift in Sources */, + F5C0247A2158741700A5991D /* UITextFieldExtension.swift in Sources */, + F59F16C52156921100505A52 /* AppDelegate.swift in Sources */, + F59F16FD2156934D00505A52 /* InvestmentPresenter.swift in Sources */, + F5C0245D21581EDF00A5991D /* InvestmentDownInfoTableViewCell.swift in Sources */, + F5C02471215844B700A5991D /* CellViewModel.swift in Sources */, + F50FD8012157324F0094E15C /* Fund.swift in Sources */, + F59F170B2156B7BF00505A52 /* HTTPRequestable.swift in Sources */, + F5C0246B21583A5A00A5991D /* AddContactModels.swift in Sources */, + F50FD7DF2156DD3C0094E15C /* SantanderLabelView.swift in Sources */, + F59F16F92156930A00505A52 /* InvestmentInteractor.swift in Sources */, + F50FD807215734160094E15C /* InvestmentFundMoreInfoView.swift in Sources */, + F5C02475215862E400A5991D /* AddContactFieldView.swift in Sources */, + F50FD7E22156DD9A0094E15C /* UIViewExtension.swift in Sources */, + F5C0245A2158187800A5991D /* FundDownInfo.swift in Sources */, + F5044304215742A3009DBA7D /* InvestmentInfoTableViewCell.swift in Sources */, + F50FD7E9215706FC0094E15C /* LayoutVerticalViewController.swift in Sources */, + F547874F2156B88700A9DEB9 /* HTTPDomain.swift in Sources */, + F54787512156B8FA00A9DEB9 /* HTTPEnvironment.swift in Sources */, + F5C0246921583A4C00A5991D /* AddContactRouter.swift in Sources */, + F54787592156C1B000A9DEB9 /* Screen.swift in Sources */, + F59F17032156951A00505A52 /* AppNavigationController.swift in Sources */, + F50FD7FF215731FD0094E15C /* ScreenMoreInfo.swift in Sources */, + F54787632156CFEE00A9DEB9 /* LayoutAnimation.swift in Sources */, + F59F17012156936800505A52 /* InvestmentModels.swift in Sources */, + F5C024552158042C00A5991D /* SantanderButtonView.swift in Sources */, + F5C0246F2158423D00A5991D /* Cell.swift in Sources */, + F54787532156BC7B00A9DEB9 /* NSErrorExtension.swift in Sources */, + F50442FE215741F2009DBA7D /* InvestmentInfoView.swift in Sources */, + F5C02473215847DD00A5991D /* AddContactCell.swift in Sources */, + F5C0246721583A3D00A5991D /* AddContactPresenter.swift in Sources */, + F5044308215744A2009DBA7D /* FundInfo.swift in Sources */, + F59F16F5215692B700505A52 /* InvestmentViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F59F16D12156921500505A52 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F5C0247E215886BE00A5991D /* InvestmentWorkerTests.swift in Sources */, + 7A46F66F2159099F0031F419 /* AddContactPresenterTests.swift in Sources */, + F5C0248121588FA300A5991D /* InvestmentPresenter.swift in Sources */, + 7A46F66C215908300031F419 /* AddContactWorkerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F59F16DC2156921500505A52 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F59F16E52156921500505A52 /* SantanderTesteiOSUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + F59F16D72156921500505A52 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F59F16C02156921100505A52 /* SantanderTesteiOS */; + targetProxy = F59F16D62156921500505A52 /* PBXContainerItemProxy */; + }; + F59F16E22156921500505A52 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F59F16C02156921100505A52 /* SantanderTesteiOS */; + targetProxy = F59F16E12156921500505A52 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + F59F16CD2156921500505A52 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + F59F16CE2156921500505A52 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + F59F16E72156921500505A52 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + F59F16E82156921500505A52 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F59F16EA2156921500505A52 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = RR9VAV7548; + INFOPLIST_FILE = "$(SRCROOT)/SantanderTesteiOS/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = br.com.diego.costa.SantanderTesteiOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F59F16EB2156921500505A52 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = RR9VAV7548; + INFOPLIST_FILE = "$(SRCROOT)/SantanderTesteiOS/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = br.com.diego.costa.SantanderTesteiOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + F59F16ED2156921500505A52 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = RR9VAV7548; + INFOPLIST_FILE = SantanderTesteiOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = br.com.diego.costa.SantanderTesteiOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SantanderTesteiOS.app/SantanderTesteiOS"; + }; + name = Debug; + }; + F59F16EE2156921500505A52 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = RR9VAV7548; + INFOPLIST_FILE = SantanderTesteiOSTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = br.com.diego.costa.SantanderTesteiOSTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SantanderTesteiOS.app/SantanderTesteiOS"; + }; + name = Release; + }; + F59F16F02156921500505A52 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = RR9VAV7548; + INFOPLIST_FILE = SantanderTesteiOSUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = br.com.diego.costa.SantanderTesteiOSUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = SantanderTesteiOS; + }; + name = Debug; + }; + F59F16F12156921500505A52 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = RR9VAV7548; + INFOPLIST_FILE = SantanderTesteiOSUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = br.com.diego.costa.SantanderTesteiOSUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = SantanderTesteiOS; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F59F16BC2156921100505A52 /* Build configuration list for PBXProject "SantanderTesteiOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F59F16E72156921500505A52 /* Debug */, + F59F16E82156921500505A52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F59F16E92156921500505A52 /* Build configuration list for PBXNativeTarget "SantanderTesteiOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F59F16EA2156921500505A52 /* Debug */, + F59F16EB2156921500505A52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F59F16EC2156921500505A52 /* Build configuration list for PBXNativeTarget "SantanderTesteiOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F59F16ED2156921500505A52 /* Debug */, + F59F16EE2156921500505A52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F59F16EF2156921500505A52 /* Build configuration list for PBXNativeTarget "SantanderTesteiOSUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F59F16F02156921500505A52 /* Debug */, + F59F16F12156921500505A52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = F59F16B92156921100505A52 /* Project object */; +} diff --git a/SantanderTesteiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SantanderTesteiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1f5cbbbe --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SantanderTesteiOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/SantanderTesteiOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/SantanderTesteiOS.xcodeproj/project.xcworkspace/xcuserdata/iterative.xcuserdatad/UserInterfaceState.xcuserstate b/SantanderTesteiOS.xcodeproj/project.xcworkspace/xcuserdata/iterative.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..5606301e Binary files /dev/null and b/SantanderTesteiOS.xcodeproj/project.xcworkspace/xcuserdata/iterative.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 00000000..45f9830a --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/SantanderTesteiOS.xcscheme b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/SantanderTesteiOS.xcscheme new file mode 100644 index 00000000..f914aebc --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/SantanderTesteiOS.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/SantanderTesteiOSTests.xcscheme b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/SantanderTesteiOSTests.xcscheme new file mode 100644 index 00000000..cc333def --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/SantanderTesteiOSTests.xcscheme @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/xcschememanagement.plist b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..85dfee80 --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/xcuserdata/diegocosta.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,37 @@ + + + + + SchemeUserState + + SantanderTesteiOS.xcscheme + + orderHint + 0 + + SantanderTesteiOSTests.xcscheme + + orderHint + 1 + + + SuppressBuildableAutocreation + + F59F16C02156921100505A52 + + primary + + + F59F16D42156921500505A52 + + primary + + + F59F16DF2156921500505A52 + + primary + + + + + diff --git a/SantanderTesteiOS.xcodeproj/xcuserdata/iterative.xcuserdatad/xcschemes/xcschememanagement.plist b/SantanderTesteiOS.xcodeproj/xcuserdata/iterative.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..fe8f6331 --- /dev/null +++ b/SantanderTesteiOS.xcodeproj/xcuserdata/iterative.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + SantanderTesteiOS.xcscheme + + orderHint + 0 + + + + diff --git a/SantanderTesteiOS/App/AppDelegate.swift b/SantanderTesteiOS/App/AppDelegate.swift new file mode 100644 index 00000000..a3b9e212 --- /dev/null +++ b/SantanderTesteiOS/App/AppDelegate.swift @@ -0,0 +1,51 @@ +// +// AppDelegate.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + + window = UIWindow(frame: UIScreen.main.bounds) + window?.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + window?.rootViewController = AppNavigationController(rootViewController: InvestmentViewController()) + window?.makeKeyAndVisible() + + 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:. + } + + +} + diff --git a/SantanderTesteiOS/App/AppNavigationController.swift b/SantanderTesteiOS/App/AppNavigationController.swift new file mode 100644 index 00000000..28cd71cb --- /dev/null +++ b/SantanderTesteiOS/App/AppNavigationController.swift @@ -0,0 +1,31 @@ +// +// AppNavigationController.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class AppNavigationController: UINavigationController, UINavigationControllerDelegate { + + + override func viewDidLoad() { + super.viewDidLoad() + self.delegate = self + self.navigationBar.tintColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1) + self.navigationBar.barTintColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + self.navigationBar.shadowImage = UIImage() + self.navigationBar.titleTextAttributes = [NSAttributedStringKey.font : UIFont.systemFont(ofSize: 20), + NSAttributedStringKey.foregroundColor : #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1)] + } + + func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) { + if viewController is InvestmentViewController { + viewController.navigationItem.title = "Investimento" + }else if viewController is AddContactViewController { + viewController.navigationItem.title = "Contato" + } + } +} diff --git a/SantanderTesteiOS/Commons/Extensions/NSErrorExtension.swift b/SantanderTesteiOS/Commons/Extensions/NSErrorExtension.swift new file mode 100644 index 00000000..7eb151ae --- /dev/null +++ b/SantanderTesteiOS/Commons/Extensions/NSErrorExtension.swift @@ -0,0 +1,16 @@ +// +// NSErrorExtension.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +extension NSError { + static var generic : NSError { + return NSError(domain: "Ocorreu um erro, por favor, tente novamente", code: -1, userInfo: nil) + } +} diff --git a/SantanderTesteiOS/Commons/Extensions/UITableViewExtension.swift b/SantanderTesteiOS/Commons/Extensions/UITableViewExtension.swift new file mode 100644 index 00000000..1fd13ec5 --- /dev/null +++ b/SantanderTesteiOS/Commons/Extensions/UITableViewExtension.swift @@ -0,0 +1,30 @@ +// +// UIViewExtension.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation +import UIKit + +extension UITableViewCell { + static var identifier : String { + return String(describing: self) + } +} + +extension UITableView { + + + func register(class name : T.Type) { + register(UINib(nibName: String(describing: name), bundle: Bundle(for: T.classForCoder())), forCellReuseIdentifier: String(describing: name)) + } + + func dequeue(cell : T.Type, indexPath : IndexPath)-> T { + return dequeueReusableCell(withIdentifier: String(describing: cell), for: indexPath) as! T + } +} + + diff --git a/SantanderTesteiOS/Commons/Extensions/UITextFieldExtension.swift b/SantanderTesteiOS/Commons/Extensions/UITextFieldExtension.swift new file mode 100644 index 00000000..2bdc3eda --- /dev/null +++ b/SantanderTesteiOS/Commons/Extensions/UITextFieldExtension.swift @@ -0,0 +1,57 @@ +// +// UITextFieldExtension.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation +import UIKit + +extension UITextField { + + func setLine(color : UIColor = UIColor.groupTableViewBackground) { + borderStyle = .none + layer.backgroundColor = UIColor.white.cgColor + + layer.masksToBounds = false + layer.shadowColor = color.cgColor + layer.shadowOffset = CGSize(width: 0.0, height: 1.0) + layer.shadowOpacity = 1.0 + layer.shadowRadius = 0.0 + } + +} + +private var textFieldAssociationKey = "textFieldAssociationKey" +extension UITextField { + private(set) public var textFieldDelegate: UITextFieldDelegate? { + get { return objc_getAssociatedObject(self, &textFieldAssociationKey) as? UITextFieldDelegate } + set { objc_setAssociatedObject(self, &textFieldAssociationKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) } + } + + func setMask(mask : String, range : NSRange, string : String)-> Bool { + + if !mask.contains("#") { fatalError("Please use # to mask") } + + let currentText = (text! as NSString).replacingCharacters(in: range, with: string) as NSString + let currentMask = (mask as NSString) as NSString + + if currentText.length > currentMask.length { + return false + } + + let charactersMask = Array(mask) + + if charactersMask[range.location] != "#", range.length == 0 { + if charactersMask[range.location + 1] == " " { + text?.append(charactersMask[range.location]) + text?.append(charactersMask[range.location + 1]) + }else { + text?.append(charactersMask[range.location]) + } + } + return true + } +} diff --git a/SantanderTesteiOS/Commons/Extensions/UIViewExtension.swift b/SantanderTesteiOS/Commons/Extensions/UIViewExtension.swift new file mode 100644 index 00000000..c8ee3664 --- /dev/null +++ b/SantanderTesteiOS/Commons/Extensions/UIViewExtension.swift @@ -0,0 +1,27 @@ +// +// UIViewExtension.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +extension UIView { + + func xib() { + let bundle = Bundle(for: type(of: self)) + let nibName = type(of: self).description().components(separatedBy: ".").last! + let view = UINib(nibName: nibName, bundle: bundle).instantiate(withOwner: self, options: nil).first as! UIView + switch bounds { + case .zero: + frame = view.bounds + default: + view.frame = bounds + } + view.autoresizingMask = [.flexibleWidth, .flexibleHeight] + addSubview(view) + view.layoutIfNeeded() + } +} diff --git a/SantanderTesteiOS/Commons/Networking/HTTPDomain.swift b/SantanderTesteiOS/Commons/Networking/HTTPDomain.swift new file mode 100644 index 00000000..32b3d7e1 --- /dev/null +++ b/SantanderTesteiOS/Commons/Networking/HTTPDomain.swift @@ -0,0 +1,21 @@ +// +// HTTPDomain.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +protocol HTTPDomain { + var environment : HTTPEnvironment { get } +} + +extension HTTPDomain { + + var environment : HTTPEnvironment { + return .dev + } +} diff --git a/SantanderTesteiOS/Commons/Networking/HTTPEnvironment.swift b/SantanderTesteiOS/Commons/Networking/HTTPEnvironment.swift new file mode 100644 index 00000000..f1e1531f --- /dev/null +++ b/SantanderTesteiOS/Commons/Networking/HTTPEnvironment.swift @@ -0,0 +1,21 @@ +// +// HTTPEnvironment.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +enum HTTPEnvironment { + case dev + + public var host : String { + switch self { + case .dev: + return "https://floating-mountain-50292.herokuapp.com/" + } + } +} diff --git a/SantanderTesteiOS/Commons/Networking/HTTPRequestable.swift b/SantanderTesteiOS/Commons/Networking/HTTPRequestable.swift new file mode 100644 index 00000000..62585c26 --- /dev/null +++ b/SantanderTesteiOS/Commons/Networking/HTTPRequestable.swift @@ -0,0 +1,25 @@ +// +// HTTPRequestable.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + +protocol HTTPRequestable : HTTPDomain { + + var path : String { get } + + var url : URL { get } + + var params : [String : Any] { get } +} + +extension HTTPRequestable { + + var headers : [String : String] { + return ["Content-Type" : "application/json", "Accept" : "application/json"] + } +} diff --git a/SantanderTesteiOS/Commons/Networking/HTTRequest.swift b/SantanderTesteiOS/Commons/Networking/HTTRequest.swift new file mode 100644 index 00000000..431ad9a1 --- /dev/null +++ b/SantanderTesteiOS/Commons/Networking/HTTRequest.swift @@ -0,0 +1,70 @@ +// +// HTTNetworking.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +struct HTTRequest { + + typealias HTTPNewtorkingSuccess = (T?)-> Swift.Void + typealias HTTPNewtorkingFailure = (NSError)-> Swift.Void + typealias HTTPNetworkingDataTask = (Data?, URLResponse?, Error?)-> Swift.Void + + var requestable : HTTPRequestable + + func get(success : @escaping HTTPNewtorkingSuccess, failure : @escaping HTTPNewtorkingFailure) { + var request = URLRequest(url: requestable.url) + request.httpMethod = "GET" + request.allHTTPHeaderFields = requestable.headers + + let session = URLSession.shared.dataTask(with: request) { data, response, error in + self.responseHandler(success: success, failure: failure)(data, response, error) + } + session.resume() + } + + func post(success : @escaping HTTPNewtorkingSuccess, failure : @escaping HTTPNewtorkingFailure) { + + var request = URLRequest(url: requestable.url) + request.httpMethod = "POST" + request.httpBody = try? JSONSerialization.data(withJSONObject: requestable.params, options: .prettyPrinted) + request.allHTTPHeaderFields = requestable.headers + + let session = URLSession.shared.dataTask(with: request) { (data, response, error) in + self.responseHandler(success: success, failure: failure)(data, response, error) + } + session.resume() + } + + private func responseHandler(success : @escaping HTTPNewtorkingSuccess, failure : @escaping HTTPNewtorkingFailure)-> HTTPNetworkingDataTask { + return { data, response, error in + + if error != nil { + DispatchQueue.main.async { + failure(error! as NSError) + return + } + } + + do { + let decoder = JSONDecoder() + let json = try data.map { + return try decoder.decode(T.self, from: $0) + } + DispatchQueue.main.async { + success(json) + } + }catch let error { + DispatchQueue.main.async { + print(error) + failure(error as NSError) + } + } + } + } +} diff --git a/SantanderTesteiOS/Commons/Views/LayoutVerticalViewController/LayoutAnimation.swift b/SantanderTesteiOS/Commons/Views/LayoutVerticalViewController/LayoutAnimation.swift new file mode 100644 index 00000000..cf78fda8 --- /dev/null +++ b/SantanderTesteiOS/Commons/Views/LayoutVerticalViewController/LayoutAnimation.swift @@ -0,0 +1,63 @@ +// +// SantanderLabelView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation +import UIKit + + +struct Animation { + let duration : TimeInterval + let closure : (UIView)-> Swift.Void +} + +extension Animation { + static func animate(duration : TimeInterval = 0.3)-> Animation { + return Animation(duration: duration, closure: {$0.layoutIfNeeded()}) + } + + static func fadeIn(duration : TimeInterval = 0.3)-> Animation { + return Animation(duration: duration, closure: { $0.alpha = 1 }) + } + + static func move(to origin : CGPoint, duration : TimeInterval = 0.3)-> Animation { + return Animation(duration: duration, closure: { $0.frame.origin = origin }) + } + + static func resize(to size : CGSize, duration : TimeInterval = 0.3)-> Animation { + return Animation(duration: duration, closure: { $0.bounds.size = size }) + } +} + +extension UIView { + + func animate(_ animations : [Animation]) { + guard !animations.isEmpty else { + return + } + + var animations = animations + let animation = animations.removeFirst() + + UIView.animate(withDuration: animation.duration, animations: { + animation.closure(self) + }, completion: { _ in + self.animate(animations) + }) + } + + func animate(inParallel animations : [Animation]) { + guard !animations.isEmpty else { + return + } + animations.forEach { animation in + UIView.animate(withDuration: animation.duration, animations: { + animation.closure(self) + }) + } + } +} diff --git a/SantanderTesteiOS/Commons/Views/LayoutVerticalViewController/LayoutVerticalViewController.swift b/SantanderTesteiOS/Commons/Views/LayoutVerticalViewController/LayoutVerticalViewController.swift new file mode 100644 index 00000000..e39cc6d8 --- /dev/null +++ b/SantanderTesteiOS/Commons/Views/LayoutVerticalViewController/LayoutVerticalViewController.swift @@ -0,0 +1,189 @@ +// +// SantanderLabelView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + + +import UIKit +import Foundation + +protocol LayoutVerticalViewProtocol { + + func insert(view : UIView, above : UIView) + + func insert(view : UIView, below : UIView) + + func insert(view : UIView, at : Int) +} + +extension LayoutVerticalViewProtocol { + + var spaceView : (UIColor, CGFloat)-> UIView { + return { + let spaceView = UIView() + spaceView.translatesAutoresizingMaskIntoConstraints = false + spaceView.backgroundColor = $0 + spaceView.frame.size.height = $1 + return spaceView + } + } + + var lineView : (UIColor, CGFloat)-> UIView { + return { + let lineView = UIView() + lineView.translatesAutoresizingMaskIntoConstraints = false + lineView.backgroundColor = $0 + lineView.frame.size.height = $1 + return lineView + } + } +} + +class LayoutVerticalViewController: UIViewController, LayoutVerticalViewProtocol { + private var scrollView : UIScrollView = UIScrollView() + private var stackView : UIStackView = UIStackView() + private var footerStackView : UIStackView = UIStackView() + + + var spacing : CGFloat = 0 + + var contentInsets : UIEdgeInsets = UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16) { + didSet{ + self.updateViewConstraints() + } + } + + var showsVerticalIndicator : Bool = false { + didSet { scrollView.showsVerticalScrollIndicator = showsVerticalIndicator } + } + + var showHorizontalIndicator : Bool = false { + didSet { scrollView.showsHorizontalScrollIndicator = showHorizontalIndicator } + } + + var subviews : [UIView] { + return [] + } + + var footerViews : [UIView] { + return [] + } + + override func loadView() { + super.loadView() + self.view.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + self.prepareLayout() + } + + private func prepareLayout() { + scrollView.translatesAutoresizingMaskIntoConstraints = false + scrollView.showsVerticalScrollIndicator = showsVerticalIndicator + scrollView.showsHorizontalScrollIndicator = showHorizontalIndicator + + stackView.translatesAutoresizingMaskIntoConstraints = false + stackView.alignment = .fill + stackView.axis = .vertical + stackView.spacing = spacing + stackView.distribution = .fill + stackView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + + footerStackView.translatesAutoresizingMaskIntoConstraints = false + footerStackView.alignment = .fill + footerStackView.axis = .horizontal + footerStackView.spacing = 1 + footerStackView.distribution = .fillEqually + footerStackView.autoresizingMask = [.flexibleWidth, .flexibleHeight] + + view.addSubview(scrollView) + view.addSubview(footerStackView) + scrollView.addSubview(stackView) + } + + override func viewDidLoad() { + super.viewDidLoad() + self.subviews.forEach { + addHeight(view: $0) + stackView.addArrangedSubview($0) + } + self.footerViews.forEach { + addHeight(view: $0) + footerStackView.addArrangedSubview($0) + } + } + + override func viewWillLayoutSubviews() { + super.viewWillLayoutSubviews() + self.stackView.arrangedSubviews.forEach { + self.updateHeight(view: $0, newValue: $0.frame.height) + } + } + + override func updateViewConstraints() { + NSLayoutConstraint.activate([ + scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant : contentInsets.left), + scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant : -contentInsets.right), + scrollView.topAnchor.constraint(equalTo: view.topAnchor, constant : contentInsets.top), + ]) + + NSLayoutConstraint.activate([ + stackView.topAnchor.constraint(equalTo: scrollView.topAnchor), + stackView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor), + stackView.trailingAnchor.constraint(equalTo:scrollView.trailingAnchor), + stackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor), + stackView.widthAnchor.constraint(equalTo: scrollView.widthAnchor) + ]) + + NSLayoutConstraint.activate([ + footerStackView.topAnchor.constraint(equalTo: scrollView.bottomAnchor, constant : 16), + footerStackView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + footerStackView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + footerStackView.bottomAnchor.constraint(equalTo: view.bottomAnchor) + ]) + + super.updateViewConstraints() + } + + func insert(view: UIView, above: UIView) { + guard let index = index(view: above), index > 0 else { + return + } + stackView.insertArrangedSubview(view, at: index - 1) + addHeight(view: view) + } + + func insert(view: UIView, below: UIView) { + guard let index = index(view: below) else { + return + } + stackView.insertArrangedSubview(view, at: index + 1) + addHeight(view: view) + } + + func insert(view: UIView, at: Int) { + stackView.insertArrangedSubview(view, at: at) + addHeight(view: view) + } + + private func index(view : UIView)-> Int? { + guard let index = stackView.arrangedSubviews.index(of: view) else { + return nil + } + return index + } + + private func addHeight(view : UIView, value : CGFloat? = nil) { + let constant = value ?? view.bounds.height + let constraint = view.heightAnchor.constraint(equalToConstant: constant) + constraint.identifier = "height" + constraint.isActive = true + } + + private func updateHeight(view : UIView, newValue : CGFloat? = nil) { + let constant = newValue ?? view.bounds.height + let constraint = view.constraints.filter({$0.identifier == "height"}).first + constraint?.constant = constant + } +} diff --git a/SantanderTesteiOS/Commons/Views/SantanderButton/SantanderButtonView.swift b/SantanderTesteiOS/Commons/Views/SantanderButton/SantanderButtonView.swift new file mode 100644 index 00000000..c7cf95ac --- /dev/null +++ b/SantanderTesteiOS/Commons/Views/SantanderButton/SantanderButtonView.swift @@ -0,0 +1,75 @@ +// +// SantanderButtonView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +enum SantanderButtonMode { + case enabled(UIColor) + case disabled(UIColor) +} + +class SantanderButtonView: UIView { + @IBOutlet private weak var button : UIButton! + @IBOutlet private weak var leftConstraint : NSLayoutConstraint! + @IBOutlet private weak var rightConstraint : NSLayoutConstraint! + @IBOutlet private weak var topConstraint : NSLayoutConstraint! + @IBOutlet private weak var bottomConstraint : NSLayoutConstraint! + + var contentEdges : UIEdgeInsets = .zero + + var title : String? + var mode : SantanderButtonMode = .disabled(#colorLiteral(red: 0.89276582, green: 0.1277235746, blue: 0, alpha: 0.4949383803)) + + var action : (()-> Swift.Void)? + + init(title : String?, mode : SantanderButtonMode) { + self.title = title + self.mode = mode + super.init(frame: .zero) + self.xib() + self.prepareLayout() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.xib() + } + + override func awakeFromNib() { + super.awakeFromNib() + self.prepareLayout() + } + + private func prepareLayout() { + leftConstraint.constant = contentEdges.left + rightConstraint.constant = contentEdges.right + topConstraint.constant = contentEdges.top + bottomConstraint.constant = contentEdges.bottom + + switch mode { + case .enabled(let color): + self.button.backgroundColor = color + self.button.alpha = 1.0 + self.button.isEnabled = true + self.button.setTitle(self.title, for: .normal) + case .disabled(let color): + self.button.backgroundColor = color + self.button.alpha = 0.5 + self.button.isEnabled = false + self.button.setTitle(self.title, for: .disabled) + } + } + + func set(corner radius : CGFloat) { + self.button.layer.cornerRadius = radius + } + + @IBAction private func buttonAction(_ sender : Any) { + self.action?() + } +} diff --git a/SantanderTesteiOS/Commons/Views/SantanderButton/SantanderButtonView.xib b/SantanderTesteiOS/Commons/Views/SantanderButton/SantanderButtonView.xib new file mode 100644 index 00000000..c077f229 --- /dev/null +++ b/SantanderTesteiOS/Commons/Views/SantanderButton/SantanderButtonView.xib @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + DINPro-Medium + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Commons/Views/SantanderLabel/SantanderLabelView.swift b/SantanderTesteiOS/Commons/Views/SantanderLabel/SantanderLabelView.swift new file mode 100644 index 00000000..a7423b4b --- /dev/null +++ b/SantanderTesteiOS/Commons/Views/SantanderLabel/SantanderLabelView.swift @@ -0,0 +1,56 @@ +// +// SantanderLabelView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + + +class SantanderLabelView: UIView { + @IBOutlet private weak var titleLabel : UILabel! + + @IBInspectable var fontSize : CGFloat = 16 + @IBInspectable var textColor : UIColor = UIColor.black + @IBInspectable var littleSpace : CGFloat = 16 + + + init(fontSize : CGFloat, textColor : UIColor) { + self.fontSize = fontSize + self.textColor = textColor + super.init(frame: .zero) + self.xib() + self.prepareLayout() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.xib() + } + + override func awakeFromNib() { + super.awakeFromNib() + self.prepareLayout() + } + + private func prepareLayout() { + self.titleLabel.font = titleLabel.font.withSize(fontSize) + self.titleLabel.textColor = textColor + } + + func set(text : String? = "") { + self.titleLabel.text = text + self.frame.size.height = titleLabel.intrinsicContentSize.height + littleSpace + self.invalidateIntrinsicContentSize() + } + + func set(textColor : UIColor = #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)) { + self.titleLabel.textColor = textColor + } + + func set(alignment : NSTextAlignment) { + self.titleLabel.textAlignment = alignment + } +} diff --git a/SantanderTesteiOS/Commons/Views/SantanderLabel/SantanderLabelView.xib b/SantanderTesteiOS/Commons/Views/SantanderLabel/SantanderLabelView.xib new file mode 100644 index 00000000..bad6dc8a --- /dev/null +++ b/SantanderTesteiOS/Commons/Views/SantanderLabel/SantanderLabelView.xib @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + DINPro-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Models/AddContactCell.swift b/SantanderTesteiOS/Models/AddContactCell.swift new file mode 100644 index 00000000..ad6bfd0a --- /dev/null +++ b/SantanderTesteiOS/Models/AddContactCell.swift @@ -0,0 +1,14 @@ +// +// AddContactCell.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +struct AddContactCell : Codable { + var cells : [Cell] +} diff --git a/SantanderTesteiOS/Models/Cell.swift b/SantanderTesteiOS/Models/Cell.swift new file mode 100644 index 00000000..8591b28b --- /dev/null +++ b/SantanderTesteiOS/Models/Cell.swift @@ -0,0 +1,28 @@ +// +// Cell.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + +struct Cell : Codable, Equatable { + var id : Int? + var type : Int? + var message : String? + var typeField : Int? + var hidden : Bool? + var topSpacing : Double? + var show : Int? + var required : Bool? + + + static func ==(lhs : Cell, rhs : Cell) -> Bool { + return lhs.id == rhs.id && lhs.type == rhs.type + } + static func <(lhs : Cell, rhs : Cell) -> Bool { + return lhs.id ?? 0 < rhs.id ?? 0 && lhs.type ?? 0 < rhs.type ?? 0 + } +} diff --git a/SantanderTesteiOS/Models/CellViewModel.swift b/SantanderTesteiOS/Models/CellViewModel.swift new file mode 100644 index 00000000..0e7b7c0d --- /dev/null +++ b/SantanderTesteiOS/Models/CellViewModel.swift @@ -0,0 +1,54 @@ +// +// CellViewModel.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + +enum CellType : Int { + case unknown = 0 + case field = 1 + case text = 2 + case image = 3 + case checkbox = 4 + case send = 5 +} + +enum TypeField : Int { + case unknown = 0 + case text = 1 + case telNumber = 2 + case email = 3 +} + +struct CellViewModel { + var id : Int = 0 + var type : CellType = .field + var message : String = "" + var typeField : TypeField = .text + var isHidden : Bool = false + var topSpacing : Double = 8.0 + var show : Int = 0 + var isRequired : Bool = false + + var cell : Cell + + init(cell : Cell) { + self.cell = cell + self.transformToViewModel() + } + + private mutating func transformToViewModel() { + id = cell.id ?? 0 + type = CellType(rawValue: cell.type ?? -1) ?? .unknown + message = cell.message ?? "" + typeField = TypeField(rawValue: cell.typeField ?? 0) ?? .unknown + isHidden = cell.hidden ?? false + topSpacing = cell.topSpacing ?? 0.0 + show = cell.show ?? 0 + isRequired = cell.required ?? false + } +} diff --git a/SantanderTesteiOS/Models/Fund.swift b/SantanderTesteiOS/Models/Fund.swift new file mode 100644 index 00000000..ee0ade91 --- /dev/null +++ b/SantanderTesteiOS/Models/Fund.swift @@ -0,0 +1,17 @@ +// +// Fund.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + + +struct Fund : Codable { + var title : String? + var fund : Double = 0.0 + var CDI : Double = 0.0 +} diff --git a/SantanderTesteiOS/Models/FundDownInfo.swift b/SantanderTesteiOS/Models/FundDownInfo.swift new file mode 100644 index 00000000..e3da8a71 --- /dev/null +++ b/SantanderTesteiOS/Models/FundDownInfo.swift @@ -0,0 +1,15 @@ +// +// FundDownInfo.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +struct FundDownInfo : Codable, Fundable { + var name : String? + var data : String? +} diff --git a/SantanderTesteiOS/Models/FundInfo.swift b/SantanderTesteiOS/Models/FundInfo.swift new file mode 100644 index 00000000..76691433 --- /dev/null +++ b/SantanderTesteiOS/Models/FundInfo.swift @@ -0,0 +1,19 @@ +// +// FundInfo.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + +protocol Fundable { + var name : String? { get set } + var data : String? { get set } +} + +struct FundInfo : Codable, Fundable { + var name: String? + var data: String? +} diff --git a/SantanderTesteiOS/Models/Screen.swift b/SantanderTesteiOS/Models/Screen.swift new file mode 100644 index 00000000..ad9b9cef --- /dev/null +++ b/SantanderTesteiOS/Models/Screen.swift @@ -0,0 +1,56 @@ +// +// ScreenInfo.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + +struct Screen : Codable { + var title : String? + var fundName : String? + var whatIs : String? + var definition : String? + var riskTitle : String? + var risk : Int = 0 + var infoTitle : String? + var moreInfo : ScreenMoreInfo? + var infos : [FundInfo] = [] + var downInfos : [FundDownInfo] = [] + var allFunds : [Fundable] = [] + + private enum CodingKeys : String, CodingKey { + case title = "title" + case fundName = "fundName" + case whatIs = "whatIs" + case definition = "definition" + case riskTitle = "riskTitle" + case risk = "risk" + case infoTitle = "infoTitle" + case moreInfo = "moreInfo" + case infos = "info" + case downInfos = "downInfo" + } + + init() {} + + init(from decoder : Decoder)throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + title = try? container.decode(String.self, forKey: .title) + fundName = try? container.decode(String.self, forKey: .fundName) + whatIs = try? container.decode(String.self, forKey: .whatIs) + definition = try? container.decode(String.self, forKey: .riskTitle) + riskTitle = try? container.decode(String.self, forKey: .riskTitle) + risk = try container.decode(Int.self, forKey: .risk) + infoTitle = try? container.decode(String.self, forKey: .infoTitle) + moreInfo = try? container.decode(ScreenMoreInfo.self, forKey: .moreInfo) + infos = try container.decode([FundInfo].self, forKey: .infos) + downInfos = try container.decode([FundDownInfo].self, forKey: .downInfos) + + infos.forEach { allFunds.append($0) } + downInfos.forEach { allFunds.append($0) } + } +} diff --git a/SantanderTesteiOS/Models/ScreenModel.swift b/SantanderTesteiOS/Models/ScreenModel.swift new file mode 100644 index 00000000..12138b01 --- /dev/null +++ b/SantanderTesteiOS/Models/ScreenModel.swift @@ -0,0 +1,14 @@ +// +// ScreenModel.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + + +struct ScreenModel : Codable { + var screen : Screen +} diff --git a/SantanderTesteiOS/Models/ScreenMoreInfo.swift b/SantanderTesteiOS/Models/ScreenMoreInfo.swift new file mode 100644 index 00000000..476b5d27 --- /dev/null +++ b/SantanderTesteiOS/Models/ScreenMoreInfo.swift @@ -0,0 +1,34 @@ +// +// ScreenInfo.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import Foundation + + + +struct ScreenMoreInfo : Codable { + var month : Fund? + var year : Fund? + var twelveMonths : Fund? + + private enum CodingKeys : String, CodingKey { + case month = "month" + case year = "year" + case twelveMonths = "12months" + } + + init(from decoder : Decoder)throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.month = try? container.decode(Fund.self, forKey: .month) + self.year = try? container.decode(Fund.self, forKey: .year) + self.twelveMonths = try? container.decode(Fund.self, forKey: .twelveMonths) + + self.month?.title = "No Mês" + self.year?.title = "No Ano" + self.twelveMonths?.title = "12 meses" + } +} diff --git a/SantanderTesteiOS/Scenes/AddContact/AddContactInteractor.swift b/SantanderTesteiOS/Scenes/AddContact/AddContactInteractor.swift new file mode 100644 index 00000000..4c430482 --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/AddContactInteractor.swift @@ -0,0 +1,31 @@ +// +// AddContactInteractor.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class AddContactInteractor: NSObject { + + var presenter : AddContactPresenter? + private var worker : AddContactWorker? + + + override init() { + super.init() + self.presenter = AddContactPresenter() + self.worker = AddContactWorker() + } + + func doLoadCells() { + worker?.fetchCells(completion: { cells in + let response = AddContactModels.Cells.Response(cells: cells) + self.presenter?.cellsPresentation(response: response) + }, failure: { error in + + }) + } +} diff --git a/SantanderTesteiOS/Scenes/AddContact/AddContactModels.swift b/SantanderTesteiOS/Scenes/AddContact/AddContactModels.swift new file mode 100644 index 00000000..dfe4d85d --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/AddContactModels.swift @@ -0,0 +1,23 @@ +// +// AddContactModels.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +enum AddContactModels { + + enum Cells { + struct Request { + } + struct Response { + var cells : [Cell] + } + struct ViewModel { + var viewModel : [CellViewModel] + } + } +} diff --git a/SantanderTesteiOS/Scenes/AddContact/AddContactPresenter.swift b/SantanderTesteiOS/Scenes/AddContact/AddContactPresenter.swift new file mode 100644 index 00000000..a5658ad9 --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/AddContactPresenter.swift @@ -0,0 +1,28 @@ +// +// AddContactPresenter.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +protocol CellPresentation { + func cellsPresentation(response : AddContactModels.Cells.Response) +} + +class AddContactPresenter : CellPresentation { + + weak var viewController : AddContactDisplayCells? + + func cellsPresentation(response: AddContactModels.Cells.Response) { + var result : [CellViewModel] = [] + for cell in response.cells { + result.append(CellViewModel(cell: cell)) + } + let viewModel = AddContactModels.Cells.ViewModel(viewModel: result) + viewController?.displayCell(viewModel: viewModel) + } + +} diff --git a/SantanderTesteiOS/Scenes/AddContact/AddContactRouter.swift b/SantanderTesteiOS/Scenes/AddContact/AddContactRouter.swift new file mode 100644 index 00000000..cf4c2b36 --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/AddContactRouter.swift @@ -0,0 +1,13 @@ +// +// AddContactRouter.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class AddContactRouter: NSObject { + +} diff --git a/SantanderTesteiOS/Scenes/AddContact/AddContactViewController.swift b/SantanderTesteiOS/Scenes/AddContact/AddContactViewController.swift new file mode 100644 index 00000000..0591a3b3 --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/AddContactViewController.swift @@ -0,0 +1,64 @@ +// +// AddContactViewController.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +protocol AddContactDisplayCells : class { + func displayCell(viewModel : AddContactModels.Cells.ViewModel) +} + +class AddContactViewController: LayoutVerticalViewController, AddContactDisplayCells { + + private var interactor : AddContactInteractor? + + private var space : UIView { + return spaceView(UIColor.white, 16) + } + + init() { + super.init(nibName: nil, bundle: nil) + self.interactor = AddContactInteractor() + self.interactor?.presenter?.viewController = self + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + self.contentInsets = UIEdgeInsets(top: 44, left: 44, bottom: 44, right: 44) + self.doLoadCells() + } + + private func doLoadCells() { + interactor?.doLoadCells() + } + + func displayCell(viewModel: AddContactModels.Cells.ViewModel) { + + for (index, viewModel) in viewModel.viewModel.enumerated() { + switch viewModel.type { + case .text: + let textView : SantanderLabelView = SantanderLabelView(fontSize: 20, textColor: #colorLiteral(red: 0.4352941176, green: 0.4431372549, blue: 0.4745098039, alpha: 1)) + textView.set(text: viewModel.message) + textView.set(alignment: .left) + insert(view: textView, at: index) + case .field: + let field : AddContactFieldView = AddContactFieldView(viewModel: viewModel) + insert(view: field, at: index) + case .send: + let buttonView : SantanderButtonView = SantanderButtonView(title: viewModel.message, mode: .enabled(#colorLiteral(red: 0.89276582, green: 0.1277235746, blue: 0, alpha: 1))) + buttonView.set(corner: 24) + insert(view: buttonView, at: index-1) + default: + break + } + } + } +} diff --git a/SantanderTesteiOS/Scenes/AddContact/AddContactWorker.swift b/SantanderTesteiOS/Scenes/AddContact/AddContactWorker.swift new file mode 100644 index 00000000..86180a94 --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/AddContactWorker.swift @@ -0,0 +1,47 @@ +// +// AddContactWorker.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +typealias AddContactWorkerCellsHandler = ([Cell]) -> Swift.Void +typealias AddContactWorkerCellsFailure = (NSError)-> Swift.Void + + +class AddContactWorker: NSObject { + + func fetchCells(completion : @escaping AddContactWorkerCellsHandler, failure : @escaping AddContactWorkerCellsFailure) { + let requestable = AddContactWorkerRequestable(request: AddContactModels.Cells.Request()) + let request : HTTRequest = HTTRequest(requestable: requestable) + request.get(success: { response in + guard let cell = response else { + failure(NSError.generic) + return + } + completion(cell.cells) + }, failure: { error in + failure(error) + }) + } +} + +struct AddContactWorkerRequestable : HTTPRequestable { + + var request : AddContactModels.Cells.Request + + var url: URL { + return URL(string: environment.host + path)! + } + + var path: String { + return "cells.json" + } + + var params: [String : Any] { + return [:] + } +} diff --git a/SantanderTesteiOS/Scenes/AddContact/Views/AddContactFieldView.swift b/SantanderTesteiOS/Scenes/AddContact/Views/AddContactFieldView.swift new file mode 100644 index 00000000..b365121a --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/Views/AddContactFieldView.swift @@ -0,0 +1,61 @@ +// +// AddContactCellView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class AddContactFieldView: UIView { + @IBOutlet private weak var placeholderLabel : UILabel! + @IBOutlet private weak var textField : UITextField! + + private var viewModel : CellViewModel! + + + init(viewModel : CellViewModel) { + self.viewModel = viewModel + super.init(frame: .zero) + self.xib() + self.prepareLayout() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.xib() + } + + override func awakeFromNib() { + super.awakeFromNib() + self.prepareLayout() + } + + func set(viewModel : CellViewModel) { + self.viewModel = viewModel + self.prepareLayout() + } + + private func prepareLayout() { + self.placeholderLabel.text = viewModel.message + self.textField.delegate = self + self.textField.setLine() + + switch viewModel.typeField { + case .email: + self.textField.keyboardType = .emailAddress + case .telNumber: + self.textField.keyboardType = .numberPad + default: + self.textField.keyboardType = .default + } + } +} + +extension AddContactFieldView : UITextFieldDelegate { + func textFieldShouldReturn(_ textField: UITextField) -> Bool { + textField.endEditing(true) + return true + } +} diff --git a/SantanderTesteiOS/Scenes/AddContact/Views/AddContactFieldView.xib b/SantanderTesteiOS/Scenes/AddContact/Views/AddContactFieldView.xib new file mode 100644 index 00000000..c54d27ad --- /dev/null +++ b/SantanderTesteiOS/Scenes/AddContact/Views/AddContactFieldView.xib @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + DINPro-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Scenes/Investment/InvestmentInteractor.swift b/SantanderTesteiOS/Scenes/Investment/InvestmentInteractor.swift new file mode 100644 index 00000000..49aa6839 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/InvestmentInteractor.swift @@ -0,0 +1,30 @@ +// +// InvestmentInteractor.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + + +class InvestmentInteractor { + + var presenter : InvestmentPresenter? + private var worker : InvestmentWorker? + + init() { + self.presenter = InvestmentPresenter() + self.worker = InvestmentWorker() + } + + func doLoadScreenInfo() { + worker?.fetchScreenInfo(completion: { screen in + let response = InvestmentModels.Screen.Response(screenModel: screen) + self.presenter?.screenPresentation(response: response) + }, failure: { error in + + }) + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/InvestmentModels.swift b/SantanderTesteiOS/Scenes/Investment/InvestmentModels.swift new file mode 100644 index 00000000..0909fe2f --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/InvestmentModels.swift @@ -0,0 +1,24 @@ +// +// InvestmentModels.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +enum InvestmentModels { + + enum Screen { + struct Request { + } + struct Response { + var screenModel : ScreenModel + } + struct ViewModel { + var screenModel : ScreenModel + } + } + +} diff --git a/SantanderTesteiOS/Scenes/Investment/InvestmentPresenter.swift b/SantanderTesteiOS/Scenes/Investment/InvestmentPresenter.swift new file mode 100644 index 00000000..90d0f754 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/InvestmentPresenter.swift @@ -0,0 +1,23 @@ +// +// InvestmentPresenter.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +protocol ScreenPresentation { + func screenPresentation(response : InvestmentModels.Screen.Response) +} + +class InvestmentPresenter: ScreenPresentation { + + weak var viewController : InvestmentDisplayScreen? + + func screenPresentation(response : InvestmentModels.Screen.Response) { + let viewModel = InvestmentModels.Screen.ViewModel(screenModel: response.screenModel) + viewController?.showViewModel(viewModel: viewModel) + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/InvestmentRouter.swift b/SantanderTesteiOS/Scenes/Investment/InvestmentRouter.swift new file mode 100644 index 00000000..20bd8737 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/InvestmentRouter.swift @@ -0,0 +1,23 @@ +// +// InvestmentRouter.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +protocol InvestmentRouterLogic { + func routerToAddContact() +} + +class InvestmentRouter : InvestmentRouterLogic { + + weak var viewController : InvestmentViewController? + + func routerToAddContact() { + self.viewController?.navigationController?.pushViewController(AddContactViewController(), animated: true) + } + +} diff --git a/SantanderTesteiOS/Scenes/Investment/InvestmentViewController.swift b/SantanderTesteiOS/Scenes/Investment/InvestmentViewController.swift new file mode 100644 index 00000000..346369e3 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/InvestmentViewController.swift @@ -0,0 +1,90 @@ +// +// InvestmentViewController.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +protocol InvestmentDisplayScreen : class { + func showViewModel(viewModel : InvestmentModels.Screen.ViewModel) +} + +class InvestmentViewController: LayoutVerticalViewController, InvestmentDisplayScreen { + private var titleView : SantanderLabelView = SantanderLabelView(fontSize: 16, textColor : #colorLiteral(red: 0.4941176471, green: 0.4941176471, blue: 0.4941176471, alpha: 1)) + private var fundView : SantanderLabelView = SantanderLabelView(fontSize: 32, textColor: #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1)) + private var whatIsView : SantanderLabelView = SantanderLabelView(fontSize: 20, textColor : #colorLiteral(red: 0.4941176471, green: 0.4941176471, blue: 0.4941176471, alpha: 1)) + private var definitionView : SantanderLabelView = SantanderLabelView(fontSize: 16, textColor : #colorLiteral(red: 0.4941176471, green: 0.4941176471, blue: 0.4941176471, alpha: 1)) + private var riskTitleView : SantanderLabelView = SantanderLabelView(fontSize: 20, textColor : #colorLiteral(red: 0.4941176471, green: 0.4941176471, blue: 0.4941176471, alpha: 1)) + private var infoTitleView : SantanderLabelView = SantanderLabelView(fontSize: 20, textColor: #colorLiteral(red: 0.4941176471, green: 0.4941176471, blue: 0.4941176471, alpha: 1)) + + private var moreInfoView : InvestmentFundMoreInfoView = InvestmentFundMoreInfoView() + private var infoView : InvestmentInfoView = InvestmentInfoView() + + private var makeInvestmentAction : SantanderButtonView = SantanderButtonView(title: "Investir", mode: .enabled(#colorLiteral(red: 0.89276582, green: 0.1277235746, blue: 0, alpha: 1))) + private var investmentAction : SantanderButtonView = SantanderButtonView(title: "Investimento", mode: .enabled(#colorLiteral(red: 0.89276582, green: 0.1277235746, blue: 0, alpha: 1))) + private var contactAction : SantanderButtonView = SantanderButtonView(title: "Contato", mode: .enabled(#colorLiteral(red: 0.89276582, green: 0.1277235746, blue: 0, alpha: 1))) + + private var line : UIView { + return self.lineView(UIColor.groupTableViewBackground, 1) + } + + private var interactor : InvestmentInteractor? + private var router : InvestmentRouter? + + override var subviews: [UIView] { + return [titleView, fundView, line, whatIsView, definitionView, riskTitleView, infoTitleView, moreInfoView, line, infoView, makeInvestmentAction] + } + + override var footerViews: [UIView] { + return [investmentAction, contactAction] + } + + init() { + super.init(nibName: nil, bundle: nil) + self.interactor = InvestmentInteractor() + self.router = InvestmentRouter() + self.interactor?.presenter?.viewController = self + self.router?.viewController = self + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + self.doLoadScreen() + self.setupInterface() + } + + private func doLoadScreen() { + self.interactor?.doLoadScreenInfo() + } + + private func setupInterface() { + makeInvestmentAction.contentEdges = UIEdgeInsets(top: 16, left: 24, bottom: 16, right: 24) + makeInvestmentAction.set(corner: 28) + + contactAction.action = { [weak self] in + self?.router?.routerToAddContact() + } + } + + func showViewModel(viewModel: InvestmentModels.Screen.ViewModel) { + titleView.set(text: viewModel.screenModel.screen.title) + fundView.set(text: viewModel.screenModel.screen.fundName) + whatIsView.set(text: viewModel.screenModel.screen.whatIs) + definitionView.set(text: viewModel.screenModel.screen.definition) + riskTitleView.set(text: viewModel.screenModel.screen.riskTitle) + infoTitleView.set(text: viewModel.screenModel.screen.infoTitle) + + moreInfoView.set(fund: viewModel.screenModel.screen.moreInfo?.month) + moreInfoView.set(fund: viewModel.screenModel.screen.moreInfo?.year) + moreInfoView.set(fund: viewModel.screenModel.screen.moreInfo?.twelveMonths) + + infoView.set(allFunds: viewModel.screenModel.screen.allFunds) + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/InvestmentWorker.swift b/SantanderTesteiOS/Scenes/Investment/InvestmentWorker.swift new file mode 100644 index 00000000..ebdf8dd1 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/InvestmentWorker.swift @@ -0,0 +1,46 @@ +// +// InvestmentWorker.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +typealias InvestmentWorkerScreensHandler = (ScreenModel) -> Swift.Void +typealias InvestmentWorkerScreenFailure = (NSError)-> Swift.Void + +class InvestmentWorker { + + func fetchScreenInfo(completion : @escaping InvestmentWorkerScreensHandler, failure : @escaping InvestmentWorkerScreenFailure) { + let requestable = InvestmentWorkerRequestable(request: InvestmentModels.Screen.Request()) + let request : HTTRequest = HTTRequest(requestable: requestable) + request.get(success: { response in + guard let screen = response else { + failure(NSError.generic) + return + } + completion(screen) + }, failure: { error in + failure(error) + }) + } +} + +struct InvestmentWorkerRequestable : HTTPRequestable { + + var request : InvestmentModels.Screen.Request + + var url: URL { + return URL(string: environment.host + path)! + } + + var path: String { + return "fund.json" + } + + var params: [String : Any] { + return [:] + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentDownInfoTableViewCell.swift b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentDownInfoTableViewCell.swift new file mode 100644 index 00000000..b25057be --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentDownInfoTableViewCell.swift @@ -0,0 +1,32 @@ +// +// InvestmentDownInfoTableViewCell.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class InvestmentDownInfoTableViewCell: UITableViewCell { + @IBOutlet private weak var nameLabel : UILabel! + + private var fundable : Fundable! + + + override func awakeFromNib() { + super.awakeFromNib() + self.selectionStyle = .none + } + + func set(fundable : Fundable) { + self.fundable = fundable + self.setupInterface() + } + + private func setupInterface() { + self.nameLabel.text = self.fundable.name + } + + +} diff --git a/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentDownInfoTableViewCell.xib b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentDownInfoTableViewCell.xib new file mode 100644 index 00000000..5bc0bf67 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentDownInfoTableViewCell.xib @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + DINPro-Medium + + + DINPro-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentInfoTableViewCell.swift b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentInfoTableViewCell.swift new file mode 100644 index 00000000..d537b7a1 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentInfoTableViewCell.swift @@ -0,0 +1,33 @@ +// +// InvestmentInfoTableViewCell.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class InvestmentInfoTableViewCell: UITableViewCell { + + @IBOutlet private weak var nameLabel : UILabel! + @IBOutlet private weak var dataLabel : UILabel! + + private var fundable : Fundable! + + + override func awakeFromNib() { + super.awakeFromNib() + self.selectionStyle = .none + } + + func set(fundable : Fundable) { + self.fundable = fundable + self.setupInterface() + } + + private func setupInterface() { + self.nameLabel.text = self.fundable.name + self.dataLabel.text = self.fundable.data + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentInfoTableViewCell.xib b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentInfoTableViewCell.xib new file mode 100644 index 00000000..5ec638c6 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/Info/Cells/InvestmentInfoTableViewCell.xib @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + DINPro-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Scenes/Investment/Views/Info/InvestmentInfoView.swift b/SantanderTesteiOS/Scenes/Investment/Views/Info/InvestmentInfoView.swift new file mode 100644 index 00000000..2698da26 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/Info/InvestmentInfoView.swift @@ -0,0 +1,77 @@ +// +// InvestmentInfoView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class InvestmentInfoView: UIView { + @IBOutlet private weak var tableView : UITableView! + + private var allFunds : [Fundable] = [] + + + init() { + super.init(frame: .zero) + self.xib() + self.prepareLayout() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.xib() + } + + override func awakeFromNib() { + super.awakeFromNib() + self.prepareLayout() + } + + private func prepareLayout() { + tableView.delegate = self + tableView.dataSource = self + tableView.isScrollEnabled = false + tableView.rowHeight = UITableViewAutomaticDimension + tableView.estimatedRowHeight = 44 + tableView.separatorStyle = .none + tableView.tableFooterView = UIView() + tableView.register(class: InvestmentInfoTableViewCell.self) + tableView.register(class: InvestmentDownInfoTableViewCell.self) + } + + func set(allFunds : [Fundable]) { + self.allFunds = allFunds + self.tableView.reloadData() + + self.layoutIfNeeded() + self.frame.size.height = tableView.contentSize.height + self.invalidateIntrinsicContentSize() + } +} + +extension InvestmentInfoView : UITableViewDataSource, UITableViewDelegate { + + func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return allFunds.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + switch allFunds[indexPath.item] { + case is FundInfo: + let cell = tableView.dequeue(cell: InvestmentInfoTableViewCell.self, indexPath: indexPath) + cell.set(fundable: allFunds[indexPath.item]) + return cell + default: + let cell = tableView.dequeue(cell: InvestmentDownInfoTableViewCell.self, indexPath: indexPath) + cell.set(fundable: allFunds[indexPath.item]) + return cell + } + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/Views/Info/InvestmentInfoView.xib b/SantanderTesteiOS/Scenes/Investment/Views/Info/InvestmentInfoView.xib new file mode 100644 index 00000000..2858edf9 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/Info/InvestmentInfoView.xib @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/Cells/InvestmentFundMoreInfoTableViewCell.swift b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/Cells/InvestmentFundMoreInfoTableViewCell.swift new file mode 100644 index 00000000..4cf703f8 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/Cells/InvestmentFundMoreInfoTableViewCell.swift @@ -0,0 +1,34 @@ +// +// InvestmentFundMoreInfoTableViewCell.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class InvestmentFundMoreInfoTableViewCell: UITableViewCell { + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var fundLabel: UILabel! + @IBOutlet private weak var CDILabel: UILabel! + + var fund : Fund! + + + override func awakeFromNib() { + super.awakeFromNib() + self.selectionStyle = .none + } + + func set(fund : Fund) { + self.fund = fund + self.setupInterface() + } + + private func setupInterface() { + self.titleLabel.text = fund.title + self.fundLabel.text = "\(fund.fund)%" + self.CDILabel.text = "\(fund.CDI)%" + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/Cells/InvestmentFundMoreInfoTableViewCell.xib b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/Cells/InvestmentFundMoreInfoTableViewCell.xib new file mode 100644 index 00000000..7f0e1d88 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/Cells/InvestmentFundMoreInfoTableViewCell.xib @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + DINPro-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/InvestmentFundMoreInfoView.swift b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/InvestmentFundMoreInfoView.swift new file mode 100644 index 00000000..7e97c320 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/InvestmentFundMoreInfoView.swift @@ -0,0 +1,70 @@ +// +// InvestmentFundMoreInfoView.swift +// SantanderTesteiOS +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import UIKit + +class InvestmentFundMoreInfoView: UIView { + @IBOutlet private weak var tableView : UITableView! + + private var funds : [Fund] = [] + + private var title : String = "" + + init() { + super.init(frame: .zero) + self.xib() + self.prepareLayout() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + self.xib() + } + + override func awakeFromNib() { + super.awakeFromNib() + self.prepareLayout() + } + + private func prepareLayout() { + tableView.delegate = self + tableView .dataSource = self + tableView.separatorStyle = .none + tableView.tableFooterView = UIView() + tableView.isScrollEnabled = false + tableView.register(class: InvestmentFundMoreInfoTableViewCell.self) + } + + func set(fund : Fund?) { + guard let fund = fund else { + return + } + self.funds.append(fund) + self.tableView.reloadData() + } +} + +extension InvestmentFundMoreInfoView : UITableViewDataSource, UITableViewDelegate { + + + func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return funds.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeue(cell: InvestmentFundMoreInfoTableViewCell.self, indexPath: indexPath) + + cell.set(fund: funds[indexPath.item]) + + return cell + } +} diff --git a/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/InvestmentFundMoreInfoView.xib b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/InvestmentFundMoreInfoView.xib new file mode 100644 index 00000000..a7313d88 --- /dev/null +++ b/SantanderTesteiOS/Scenes/Investment/Views/MoreInfo/InvestmentFundMoreInfoView.xib @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + DINPro-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json b/SantanderTesteiOS/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d8db8d65 --- /dev/null +++ b/SantanderTesteiOS/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SantanderTesteiOS/Supporting Files/Assets.xcassets/Contents.json b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Contents.json b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Contents.json new file mode 100644 index 00000000..2b58798a --- /dev/null +++ b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Seta baixar.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Seta baixar@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Seta baixar@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar.png b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar.png new file mode 100644 index 00000000..4da26871 Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar.png differ diff --git a/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar@2x.png b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar@2x.png new file mode 100644 index 00000000..03332568 Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar@2x.png differ diff --git a/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar@3x.png b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar@3x.png new file mode 100644 index 00000000..7e6c881a Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Assets.xcassets/Seta baixar.imageset/Seta baixar@3x.png differ diff --git a/SantanderTesteiOS/Supporting Files/Base.lproj/LaunchScreen.storyboard b/SantanderTesteiOS/Supporting Files/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f83f6fd5 --- /dev/null +++ b/SantanderTesteiOS/Supporting Files/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINEngschriftStd.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINEngschriftStd.otf new file mode 100755 index 00000000..ae85f8ee Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINEngschriftStd.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINMittelschriftStd.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINMittelschriftStd.otf new file mode 100755 index 00000000..9a6e0d4f Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINMittelschriftStd.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINNeuzeitGroteskStd-BdCond.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINNeuzeitGroteskStd-BdCond.otf new file mode 100755 index 00000000..1da42b06 Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINNeuzeitGroteskStd-BdCond.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINNeuzeitGroteskStd-Light.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINNeuzeitGroteskStd-Light.otf new file mode 100755 index 00000000..0cda2e5b Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINNeuzeitGroteskStd-Light.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Black.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Black.otf new file mode 100755 index 00000000..2092a7bb Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Black.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Bold.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Bold.otf new file mode 100755 index 00000000..7c839536 Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Bold.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Light.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Light.otf new file mode 100755 index 00000000..8a7f085a Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Light.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Medium.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Medium.otf new file mode 100755 index 00000000..b4608d06 Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Medium.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Regular.otf b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Regular.otf new file mode 100755 index 00000000..84d57abb Binary files /dev/null and b/SantanderTesteiOS/Supporting Files/Fonts/DINPro-Regular.otf differ diff --git a/SantanderTesteiOS/Supporting Files/Info.plist b/SantanderTesteiOS/Supporting Files/Info.plist new file mode 100644 index 00000000..bf89ec8a --- /dev/null +++ b/SantanderTesteiOS/Supporting Files/Info.plist @@ -0,0 +1,72 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + akamaihd.net + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + facebook.com + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + fbcdn.net + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/SantanderTesteiOSTests/AddContact/AddContactPresenterTests.swift b/SantanderTesteiOSTests/AddContact/AddContactPresenterTests.swift new file mode 100644 index 00000000..3d638a3f --- /dev/null +++ b/SantanderTesteiOSTests/AddContact/AddContactPresenterTests.swift @@ -0,0 +1,45 @@ +// +// AddContactPresenterTests.swift +// SantanderTesteiOSTests +// +// Created by Iterative on 24/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import XCTest +@testable import SantanderTesteiOS + + +class AddContactPresenterTests: XCTestCase { + var presenter : AddContactPresenter! + + override func setUp() { + super.setUp() + self.presenter = AddContactPresenter() + } + + + func testResponseWithViewModel() { + let worker : AddContactWorker = AddContactWorker() + var cells : [Cell]! + + let addContactWorkerExpectation = expectation(description: "Wait for addContact worker fetchCells to return") + + worker.fetchCells(completion: { response in + cells = response + addContactWorkerExpectation.fulfill() + }, failure: { fail in + + }) + + waitForExpectations(timeout: 2.0) + + let response = AddContactModels.Cells.Response(cells: cells) + + XCTAssertNotNil(response) + + XCTAssertEqual(cells, response.cells) + + XCTAssertEqual(cells.first, response.cells.first) + } +} diff --git a/SantanderTesteiOSTests/AddContact/AddContactWorkerTests.swift b/SantanderTesteiOSTests/AddContact/AddContactWorkerTests.swift new file mode 100644 index 00000000..1c4e9174 --- /dev/null +++ b/SantanderTesteiOSTests/AddContact/AddContactWorkerTests.swift @@ -0,0 +1,42 @@ +// +// AddContactWorkerTests.swift +// SantanderTesteiOSTests +// +// Created by Iterative on 24/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import XCTest +@testable import SantanderTesteiOS + +class AddContactWorkerTests: XCTestCase { + + var worker : AddContactWorker! + + override func setUp() { + super.setUp() + self.worker = AddContactWorker() + } + + func testScreenSuccessRequest() { + + var cells : [Cell]! + + let addContactWorkerExpectation = expectation(description: "Wait for addContact worker fetchCells to return") + + self.worker.fetchCells(completion: { response in + cells = response + addContactWorkerExpectation.fulfill() + }, failure: { fail in + + }) + + waitForExpectations(timeout: 2.0) + + //Then + + XCTAssertNotNil(cells, "AllFunds loaded") + + XCTAssert(cells.count > 0, "Did loaded cells") + } +} diff --git a/SantanderTesteiOSTests/Info.plist b/SantanderTesteiOSTests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/SantanderTesteiOSTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/SantanderTesteiOSTests/Investment/InvestmentPresenter.swift b/SantanderTesteiOSTests/Investment/InvestmentPresenter.swift new file mode 100644 index 00000000..f7c223e2 --- /dev/null +++ b/SantanderTesteiOSTests/Investment/InvestmentPresenter.swift @@ -0,0 +1,33 @@ +// +// InvestmentPresenter.swift +// SantanderTesteiOSTests +// +// Created by Diego Costa on 24/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import XCTest +@testable import SantanderTesteiOS + + +class InvestmentPresenter: XCTestCase { + + var presenter : InvestmentPresenter? + + var viewController : InvestmentViewController? + + override func setUp() { + super.setUp() + self.viewController = InvestmentViewController() + self.presenter = InvestmentPresenter() + } + + + func testPresenterLoaded() { + XCTAssertNotNil(presenter, "Presenter loaded success") + } + + func testViewModelFromPresenter() { + + } +} diff --git a/SantanderTesteiOSTests/Investment/InvestmentWorkerTests.swift b/SantanderTesteiOSTests/Investment/InvestmentWorkerTests.swift new file mode 100644 index 00000000..61232823 --- /dev/null +++ b/SantanderTesteiOSTests/Investment/InvestmentWorkerTests.swift @@ -0,0 +1,67 @@ +// +// InvestmentWorkerTests.swift +// SantanderTesteiOSTests +// +// Created by Diego Costa on 23/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import XCTest +@testable import SantanderTesteiOS + +class InvestmentWorkerTests: XCTestCase { + + var worker : InvestmentWorker! + + + override func setUp() { + super.setUp() + self.worker = InvestmentWorker() + } + + func testScreenSuccessRequest() { + var mockScreen = Screen() + mockScreen.title = "Fundos de investimento" + + var screen : Screen! + var allFunds : [Fundable]! + + let investmentWorkerExpectation = expectation(description: "Wait for investment worker fetchScreenInfo() to return") + + self.worker.fetchScreenInfo(completion: { response in + screen = response.screen + allFunds = response.screen.allFunds + investmentWorkerExpectation.fulfill() + }, failure: { error in + + }) + + waitForExpectations(timeout: 2.0) + + //Then + + XCTAssertNotNil(allFunds, "AllFunds loaded") + + XCTAssertNotNil(screen, "ScreenInfo loaded") + + XCTAssertEqual(allFunds.count, screen.allFunds.count) + + XCTAssertEqual(mockScreen.title, screen.title) + } + + func testScreenFailureRequest() { + + let investmentWorkerExpectation = expectation(description: "Wait for investment worker fetchScreenInfo() to return") + + self.worker.fetchScreenInfo(completion: { response in + investmentWorkerExpectation.fulfill() + }, failure: { fail in + + XCTAssertNotNil(fail, "Ocorreu um erro") + + investmentWorkerExpectation.fulfill() + }) + + waitForExpectations(timeout: 2.0) + } +} diff --git a/SantanderTesteiOSUITests/Info.plist b/SantanderTesteiOSUITests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/SantanderTesteiOSUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/SantanderTesteiOSUITests/SantanderTesteiOSUITests.swift b/SantanderTesteiOSUITests/SantanderTesteiOSUITests.swift new file mode 100644 index 00000000..a1be06fe --- /dev/null +++ b/SantanderTesteiOSUITests/SantanderTesteiOSUITests.swift @@ -0,0 +1,36 @@ +// +// SantanderTesteiOSUITests.swift +// SantanderTesteiOSUITests +// +// Created by Diego Costa on 22/09/18. +// Copyright © 2018 Diego Costa. All rights reserved. +// + +import XCTest + +class SantanderTesteiOSUITests: XCTestCase { + + override func setUp() { + super.setUp() + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +}