├── .gitignore ├── JRTViper ├── JRTViper.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── JRTViper │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── ContactEntity.h │ ├── ContactEntity.m │ ├── ContactInteractor.h │ ├── ContactInteractor.m │ ├── ContactPresenter.h │ ├── ContactPresenter.m │ ├── ContactRouter.h │ ├── ContactRouter.m │ ├── ContactViewController.h │ ├── ContactViewController.m │ ├── ContactViewController.xib │ ├── ContactsPresenter.h │ ├── ContactsPresenter.m │ ├── ContactsRouter.h │ ├── ContactsRouter.m │ ├── ContactsViewController.h │ ├── ContactsViewController.m │ ├── ContactsViewController.xib │ ├── EmptyInteractor.h │ ├── EmptyInteractor.m │ ├── EmptyPresenter.h │ ├── EmptyPresenter.m │ ├── EmptyRouter.h │ ├── EmptyRouter.m │ ├── EmptyViewController.h │ ├── EmptyViewController.m │ ├── EmptyViewController.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Index │ │ ├── Entity │ │ │ ├── JRTIndexEntity.h │ │ │ └── JRTIndexEntity.m │ │ ├── Interactor │ │ │ ├── JRTIndexInteractor.h │ │ │ └── JRTIndexInteractor.m │ │ ├── Presenter │ │ │ ├── JRTIndexPresenter.h │ │ │ └── JRTIndexPresenter.m │ │ ├── Router │ │ │ ├── JRTIndexRouter.h │ │ │ └── JRTIndexRouter.m │ │ └── View │ │ │ ├── JRTIndexViewController.h │ │ │ ├── JRTIndexViewController.m │ │ │ └── JRTIndexViewController.xib │ ├── Info.plist │ ├── ItemEntity.h │ ├── ItemEntity.m │ ├── ItemInteractor.h │ ├── ItemInteractor.m │ ├── ItemPresenter.h │ ├── ItemPresenter.m │ ├── ItemRouter.h │ ├── ItemRouter.m │ ├── ItemViewController.h │ ├── ItemViewController.m │ ├── ItemViewController.xib │ ├── JRTMainRouter.h │ ├── JRTMainRouter.m │ ├── PodFiles │ │ ├── JRTViper.h │ │ ├── JRTViperEntityClass.h │ │ ├── JRTViperEntityClass.m │ │ ├── JRTViperEntityProtocol.h │ │ ├── JRTViperInteractorClass.h │ │ ├── JRTViperInteractorClass.m │ │ ├── JRTViperInteractorProtocol.h │ │ ├── JRTViperPresenterClass.h │ │ ├── JRTViperPresenterClass.m │ │ ├── JRTViperPresenterProtocol.h │ │ ├── JRTViperRouterClass.h │ │ ├── JRTViperRouterClass.m │ │ ├── JRTViperRouterProtocol.h │ │ ├── JRTViperTabBarController.h │ │ ├── JRTViperTabBarController.m │ │ ├── JRTViperTableViewControllerClass.h │ │ ├── JRTViperTableViewControllerClass.m │ │ ├── JRTViperViewControllerClass.h │ │ ├── JRTViperViewControllerClass.m │ │ └── JRTViperViewProtocol.h │ └── main.m └── JRTViperTests │ ├── Info.plist │ └── JRTViperTests.m ├── JRTViperPattern.podspec ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Xcode ### 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.xcuserstate 18 | 19 | 20 | ### Objective-C ### 21 | # Xcode 22 | # 23 | build/ 24 | *.pbxuser 25 | !default.pbxuser 26 | *.mode1v3 27 | !default.mode1v3 28 | *.mode2v3 29 | !default.mode2v3 30 | *.perspectivev3 31 | !default.perspectivev3 32 | xcuserdata 33 | *.xccheckout 34 | *.moved-aside 35 | DerivedData 36 | *.hmap 37 | *.ipa 38 | *.xcuserstate 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 45 | # 46 | Pods/ 47 | 48 | 49 | ### OSX ### 50 | .DS_Store 51 | .AppleDouble 52 | .LSOverride 53 | 54 | # Icon must end with two \r 55 | Icon 56 | 57 | # Thumbnails 58 | ._* 59 | 60 | # Files that might appear in the root of a volume 61 | .DocumentRevisions-V100 62 | .fseventsd 63 | .Spotlight-V100 64 | .TemporaryItems 65 | .Trashes 66 | .VolumeIcon.icns 67 | 68 | # Directories potentially created on remote AFP share 69 | .AppleDB 70 | .AppleDesktop 71 | Network Trash Folder 72 | Temporary Items 73 | .apdisk -------------------------------------------------------------------------------- /JRTViper/JRTViper.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3152233B1B6AC28400FC23F4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152233A1B6AC28400FC23F4 /* main.m */; }; 11 | 3152233E1B6AC28400FC23F4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152233D1B6AC28400FC23F4 /* AppDelegate.m */; }; 12 | 315223461B6AC28400FC23F4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 315223451B6AC28400FC23F4 /* Images.xcassets */; }; 13 | 315223491B6AC28400FC23F4 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 315223471B6AC28400FC23F4 /* LaunchScreen.xib */; }; 14 | 315223551B6AC28400FC23F4 /* JRTViperTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223541B6AC28400FC23F4 /* JRTViperTests.m */; }; 15 | 315223731B6AC3E200FC23F4 /* JRTViperEntityClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223611B6AC3E200FC23F4 /* JRTViperEntityClass.m */; }; 16 | 315223741B6AC3E200FC23F4 /* JRTViperInteractorClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223641B6AC3E200FC23F4 /* JRTViperInteractorClass.m */; }; 17 | 315223751B6AC3E200FC23F4 /* JRTViperPresenterClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223671B6AC3E200FC23F4 /* JRTViperPresenterClass.m */; }; 18 | 315223761B6AC3E200FC23F4 /* JRTViperRouterClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152236A1B6AC3E200FC23F4 /* JRTViperRouterClass.m */; }; 19 | 315223771B6AC3E200FC23F4 /* JRTViperTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152236D1B6AC3E200FC23F4 /* JRTViperTabBarController.m */; }; 20 | 315223781B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152236F1B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.m */; }; 21 | 315223791B6AC3E200FC23F4 /* JRTViperViewControllerClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223711B6AC3E200FC23F4 /* JRTViperViewControllerClass.m */; }; 22 | 3152237C1B6AC87C00FC23F4 /* JRTMainRouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152237B1B6AC87C00FC23F4 /* JRTMainRouter.m */; }; 23 | 315223A61B6ACEED00FC23F4 /* JRTIndexEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223981B6ACEED00FC23F4 /* JRTIndexEntity.m */; }; 24 | 315223A71B6ACEED00FC23F4 /* JRTIndexInteractor.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152239B1B6ACEED00FC23F4 /* JRTIndexInteractor.m */; }; 25 | 315223A81B6ACEED00FC23F4 /* JRTIndexPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3152239E1B6ACEED00FC23F4 /* JRTIndexPresenter.m */; }; 26 | 315223A91B6ACEED00FC23F4 /* JRTIndexRouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223A11B6ACEED00FC23F4 /* JRTIndexRouter.m */; }; 27 | 315223AA1B6ACEED00FC23F4 /* JRTIndexViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223A41B6ACEED00FC23F4 /* JRTIndexViewController.m */; }; 28 | 315223AB1B6ACEED00FC23F4 /* JRTIndexViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 315223A51B6ACEED00FC23F4 /* JRTIndexViewController.xib */; }; 29 | 315223B61B6AD3B700FC23F4 /* EmptyRouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223B51B6AD3B700FC23F4 /* EmptyRouter.m */; }; 30 | 315223BA1B6AD3EF00FC23F4 /* EmptyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223B81B6AD3EF00FC23F4 /* EmptyViewController.m */; }; 31 | 315223BB1B6AD3EF00FC23F4 /* EmptyViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 315223B91B6AD3EF00FC23F4 /* EmptyViewController.xib */; }; 32 | 315223BE1B6AD43F00FC23F4 /* EmptyPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223BD1B6AD43F00FC23F4 /* EmptyPresenter.m */; }; 33 | 315223C11B6AD5F700FC23F4 /* EmptyInteractor.m in Sources */ = {isa = PBXBuildFile; fileRef = 315223C01B6AD5F700FC23F4 /* EmptyInteractor.m */; }; 34 | 319CB49F1B84EA00004674EE /* ItemRouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB49E1B84EA00004674EE /* ItemRouter.m */; }; 35 | 319CB4A21B84EA90004674EE /* ItemEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4A11B84EA90004674EE /* ItemEntity.m */; }; 36 | 319CB4A51B84EB2E004674EE /* ItemPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4A41B84EB2E004674EE /* ItemPresenter.m */; }; 37 | 319CB4A81B84EB84004674EE /* ItemInteractor.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4A71B84EB84004674EE /* ItemInteractor.m */; }; 38 | 319CB4AC1B84EBC2004674EE /* ItemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4AA1B84EBC2004674EE /* ItemViewController.m */; }; 39 | 319CB4AD1B84EBC2004674EE /* ItemViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319CB4AB1B84EBC2004674EE /* ItemViewController.xib */; }; 40 | 319CB4B61B8517DE004674EE /* ContactEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4B51B8517DE004674EE /* ContactEntity.m */; }; 41 | 319CB4B91B8524D8004674EE /* ContactsRouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4B81B8524D8004674EE /* ContactsRouter.m */; }; 42 | 319CB4BC1B8524F8004674EE /* ContactsPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4BB1B8524F8004674EE /* ContactsPresenter.m */; }; 43 | 319CB4BF1B85251B004674EE /* ContactInteractor.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4BE1B85251B004674EE /* ContactInteractor.m */; }; 44 | 319CB4C31B85253F004674EE /* ContactsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4C11B85253F004674EE /* ContactsViewController.m */; }; 45 | 319CB4C41B85253F004674EE /* ContactsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319CB4C21B85253F004674EE /* ContactsViewController.xib */; }; 46 | 319CB4C71B8535DD004674EE /* ContactRouter.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4C61B8535DD004674EE /* ContactRouter.m */; }; 47 | 319CB4CA1B8537DB004674EE /* ContactPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4C91B8537DB004674EE /* ContactPresenter.m */; }; 48 | 319CB4CE1B853914004674EE /* ContactViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 319CB4CC1B853914004674EE /* ContactViewController.m */; }; 49 | 319CB4CF1B853914004674EE /* ContactViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 319CB4CD1B853914004674EE /* ContactViewController.xib */; }; 50 | /* End PBXBuildFile section */ 51 | 52 | /* Begin PBXContainerItemProxy section */ 53 | 3152234F1B6AC28400FC23F4 /* PBXContainerItemProxy */ = { 54 | isa = PBXContainerItemProxy; 55 | containerPortal = 3152232D1B6AC28400FC23F4 /* Project object */; 56 | proxyType = 1; 57 | remoteGlobalIDString = 315223341B6AC28400FC23F4; 58 | remoteInfo = JRTViper; 59 | }; 60 | /* End PBXContainerItemProxy section */ 61 | 62 | /* Begin PBXFileReference section */ 63 | 315223351B6AC28400FC23F4 /* JRTViper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JRTViper.app; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 315223391B6AC28400FC23F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65 | 3152233A1B6AC28400FC23F4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 66 | 3152233C1B6AC28400FC23F4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 67 | 3152233D1B6AC28400FC23F4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 68 | 315223451B6AC28400FC23F4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 69 | 315223481B6AC28400FC23F4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 70 | 3152234E1B6AC28400FC23F4 /* JRTViperTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JRTViperTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 315223531B6AC28400FC23F4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 72 | 315223541B6AC28400FC23F4 /* JRTViperTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JRTViperTests.m; sourceTree = ""; }; 73 | 3152235F1B6AC3E200FC23F4 /* JRTViper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViper.h; sourceTree = ""; }; 74 | 315223601B6AC3E200FC23F4 /* JRTViperEntityClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperEntityClass.h; sourceTree = ""; }; 75 | 315223611B6AC3E200FC23F4 /* JRTViperEntityClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperEntityClass.m; sourceTree = ""; }; 76 | 315223621B6AC3E200FC23F4 /* JRTViperEntityProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperEntityProtocol.h; sourceTree = ""; }; 77 | 315223631B6AC3E200FC23F4 /* JRTViperInteractorClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperInteractorClass.h; sourceTree = ""; }; 78 | 315223641B6AC3E200FC23F4 /* JRTViperInteractorClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperInteractorClass.m; sourceTree = ""; }; 79 | 315223651B6AC3E200FC23F4 /* JRTViperInteractorProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperInteractorProtocol.h; sourceTree = ""; }; 80 | 315223661B6AC3E200FC23F4 /* JRTViperPresenterClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperPresenterClass.h; sourceTree = ""; }; 81 | 315223671B6AC3E200FC23F4 /* JRTViperPresenterClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperPresenterClass.m; sourceTree = ""; }; 82 | 315223681B6AC3E200FC23F4 /* JRTViperPresenterProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperPresenterProtocol.h; sourceTree = ""; }; 83 | 315223691B6AC3E200FC23F4 /* JRTViperRouterClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperRouterClass.h; sourceTree = ""; }; 84 | 3152236A1B6AC3E200FC23F4 /* JRTViperRouterClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperRouterClass.m; sourceTree = ""; }; 85 | 3152236B1B6AC3E200FC23F4 /* JRTViperRouterProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperRouterProtocol.h; sourceTree = ""; }; 86 | 3152236C1B6AC3E200FC23F4 /* JRTViperTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperTabBarController.h; sourceTree = ""; }; 87 | 3152236D1B6AC3E200FC23F4 /* JRTViperTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperTabBarController.m; sourceTree = ""; }; 88 | 3152236E1B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperTableViewControllerClass.h; sourceTree = ""; }; 89 | 3152236F1B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperTableViewControllerClass.m; sourceTree = ""; }; 90 | 315223701B6AC3E200FC23F4 /* JRTViperViewControllerClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperViewControllerClass.h; sourceTree = ""; }; 91 | 315223711B6AC3E200FC23F4 /* JRTViperViewControllerClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTViperViewControllerClass.m; sourceTree = ""; }; 92 | 315223721B6AC3E200FC23F4 /* JRTViperViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTViperViewProtocol.h; sourceTree = ""; }; 93 | 3152237A1B6AC87C00FC23F4 /* JRTMainRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTMainRouter.h; sourceTree = ""; }; 94 | 3152237B1B6AC87C00FC23F4 /* JRTMainRouter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTMainRouter.m; sourceTree = ""; }; 95 | 315223971B6ACEED00FC23F4 /* JRTIndexEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTIndexEntity.h; sourceTree = ""; }; 96 | 315223981B6ACEED00FC23F4 /* JRTIndexEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTIndexEntity.m; sourceTree = ""; }; 97 | 3152239A1B6ACEED00FC23F4 /* JRTIndexInteractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTIndexInteractor.h; sourceTree = ""; }; 98 | 3152239B1B6ACEED00FC23F4 /* JRTIndexInteractor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTIndexInteractor.m; sourceTree = ""; }; 99 | 3152239D1B6ACEED00FC23F4 /* JRTIndexPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTIndexPresenter.h; sourceTree = ""; }; 100 | 3152239E1B6ACEED00FC23F4 /* JRTIndexPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTIndexPresenter.m; sourceTree = ""; }; 101 | 315223A01B6ACEED00FC23F4 /* JRTIndexRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTIndexRouter.h; sourceTree = ""; }; 102 | 315223A11B6ACEED00FC23F4 /* JRTIndexRouter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTIndexRouter.m; sourceTree = ""; }; 103 | 315223A31B6ACEED00FC23F4 /* JRTIndexViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRTIndexViewController.h; sourceTree = ""; }; 104 | 315223A41B6ACEED00FC23F4 /* JRTIndexViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRTIndexViewController.m; sourceTree = ""; }; 105 | 315223A51B6ACEED00FC23F4 /* JRTIndexViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = JRTIndexViewController.xib; sourceTree = ""; }; 106 | 315223B41B6AD3B700FC23F4 /* EmptyRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyRouter.h; sourceTree = ""; }; 107 | 315223B51B6AD3B700FC23F4 /* EmptyRouter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmptyRouter.m; sourceTree = ""; }; 108 | 315223B71B6AD3EF00FC23F4 /* EmptyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyViewController.h; sourceTree = ""; }; 109 | 315223B81B6AD3EF00FC23F4 /* EmptyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmptyViewController.m; sourceTree = ""; }; 110 | 315223B91B6AD3EF00FC23F4 /* EmptyViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EmptyViewController.xib; sourceTree = ""; }; 111 | 315223BC1B6AD43F00FC23F4 /* EmptyPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyPresenter.h; sourceTree = ""; }; 112 | 315223BD1B6AD43F00FC23F4 /* EmptyPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmptyPresenter.m; sourceTree = ""; }; 113 | 315223BF1B6AD5F700FC23F4 /* EmptyInteractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyInteractor.h; sourceTree = ""; }; 114 | 315223C01B6AD5F700FC23F4 /* EmptyInteractor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmptyInteractor.m; sourceTree = ""; }; 115 | 319CB49D1B84EA00004674EE /* ItemRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemRouter.h; sourceTree = ""; }; 116 | 319CB49E1B84EA00004674EE /* ItemRouter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemRouter.m; sourceTree = ""; }; 117 | 319CB4A01B84EA90004674EE /* ItemEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemEntity.h; sourceTree = ""; }; 118 | 319CB4A11B84EA90004674EE /* ItemEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemEntity.m; sourceTree = ""; }; 119 | 319CB4A31B84EB2E004674EE /* ItemPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemPresenter.h; sourceTree = ""; }; 120 | 319CB4A41B84EB2E004674EE /* ItemPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemPresenter.m; sourceTree = ""; }; 121 | 319CB4A61B84EB84004674EE /* ItemInteractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemInteractor.h; sourceTree = ""; }; 122 | 319CB4A71B84EB84004674EE /* ItemInteractor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemInteractor.m; sourceTree = ""; }; 123 | 319CB4A91B84EBC2004674EE /* ItemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemViewController.h; sourceTree = ""; }; 124 | 319CB4AA1B84EBC2004674EE /* ItemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemViewController.m; sourceTree = ""; }; 125 | 319CB4AB1B84EBC2004674EE /* ItemViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ItemViewController.xib; sourceTree = ""; }; 126 | 319CB4B41B8517DE004674EE /* ContactEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactEntity.h; sourceTree = ""; }; 127 | 319CB4B51B8517DE004674EE /* ContactEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactEntity.m; sourceTree = ""; }; 128 | 319CB4B71B8524D8004674EE /* ContactsRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsRouter.h; sourceTree = ""; }; 129 | 319CB4B81B8524D8004674EE /* ContactsRouter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactsRouter.m; sourceTree = ""; }; 130 | 319CB4BA1B8524F8004674EE /* ContactsPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsPresenter.h; sourceTree = ""; }; 131 | 319CB4BB1B8524F8004674EE /* ContactsPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactsPresenter.m; sourceTree = ""; }; 132 | 319CB4BD1B85251B004674EE /* ContactInteractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactInteractor.h; sourceTree = ""; }; 133 | 319CB4BE1B85251B004674EE /* ContactInteractor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactInteractor.m; sourceTree = ""; }; 134 | 319CB4C01B85253F004674EE /* ContactsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactsViewController.h; sourceTree = ""; }; 135 | 319CB4C11B85253F004674EE /* ContactsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactsViewController.m; sourceTree = ""; }; 136 | 319CB4C21B85253F004674EE /* ContactsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactsViewController.xib; sourceTree = ""; }; 137 | 319CB4C51B8535DD004674EE /* ContactRouter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactRouter.h; sourceTree = ""; }; 138 | 319CB4C61B8535DD004674EE /* ContactRouter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactRouter.m; sourceTree = ""; }; 139 | 319CB4C81B8537DB004674EE /* ContactPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactPresenter.h; sourceTree = ""; }; 140 | 319CB4C91B8537DB004674EE /* ContactPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactPresenter.m; sourceTree = ""; }; 141 | 319CB4CB1B853914004674EE /* ContactViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactViewController.h; sourceTree = ""; }; 142 | 319CB4CC1B853914004674EE /* ContactViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactViewController.m; sourceTree = ""; }; 143 | 319CB4CD1B853914004674EE /* ContactViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactViewController.xib; sourceTree = ""; }; 144 | /* End PBXFileReference section */ 145 | 146 | /* Begin PBXFrameworksBuildPhase section */ 147 | 315223321B6AC28400FC23F4 /* Frameworks */ = { 148 | isa = PBXFrameworksBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | 3152234B1B6AC28400FC23F4 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | /* End PBXFrameworksBuildPhase section */ 162 | 163 | /* Begin PBXGroup section */ 164 | 3152232C1B6AC28400FC23F4 = { 165 | isa = PBXGroup; 166 | children = ( 167 | 315223371B6AC28400FC23F4 /* JRTViper */, 168 | 315223511B6AC28400FC23F4 /* JRTViperTests */, 169 | 315223361B6AC28400FC23F4 /* Products */, 170 | ); 171 | sourceTree = ""; 172 | }; 173 | 315223361B6AC28400FC23F4 /* Products */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 315223351B6AC28400FC23F4 /* JRTViper.app */, 177 | 3152234E1B6AC28400FC23F4 /* JRTViperTests.xctest */, 178 | ); 179 | name = Products; 180 | sourceTree = ""; 181 | }; 182 | 315223371B6AC28400FC23F4 /* JRTViper */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 315223951B6ACEED00FC23F4 /* Index */, 186 | 3152237D1B6AC91100FC23F4 /* Examples */, 187 | 3152235E1B6AC3E200FC23F4 /* PodFiles */, 188 | 3152237A1B6AC87C00FC23F4 /* JRTMainRouter.h */, 189 | 3152237B1B6AC87C00FC23F4 /* JRTMainRouter.m */, 190 | 3152233C1B6AC28400FC23F4 /* AppDelegate.h */, 191 | 3152233D1B6AC28400FC23F4 /* AppDelegate.m */, 192 | 315223451B6AC28400FC23F4 /* Images.xcassets */, 193 | 315223471B6AC28400FC23F4 /* LaunchScreen.xib */, 194 | 315223381B6AC28400FC23F4 /* Supporting Files */, 195 | ); 196 | path = JRTViper; 197 | sourceTree = ""; 198 | }; 199 | 315223381B6AC28400FC23F4 /* Supporting Files */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | 315223391B6AC28400FC23F4 /* Info.plist */, 203 | 3152233A1B6AC28400FC23F4 /* main.m */, 204 | ); 205 | name = "Supporting Files"; 206 | sourceTree = ""; 207 | }; 208 | 315223511B6AC28400FC23F4 /* JRTViperTests */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 315223541B6AC28400FC23F4 /* JRTViperTests.m */, 212 | 315223521B6AC28400FC23F4 /* Supporting Files */, 213 | ); 214 | path = JRTViperTests; 215 | sourceTree = ""; 216 | }; 217 | 315223521B6AC28400FC23F4 /* Supporting Files */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 315223531B6AC28400FC23F4 /* Info.plist */, 221 | ); 222 | name = "Supporting Files"; 223 | sourceTree = ""; 224 | }; 225 | 3152235E1B6AC3E200FC23F4 /* PodFiles */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 3152235F1B6AC3E200FC23F4 /* JRTViper.h */, 229 | 315223601B6AC3E200FC23F4 /* JRTViperEntityClass.h */, 230 | 315223611B6AC3E200FC23F4 /* JRTViperEntityClass.m */, 231 | 315223621B6AC3E200FC23F4 /* JRTViperEntityProtocol.h */, 232 | 315223631B6AC3E200FC23F4 /* JRTViperInteractorClass.h */, 233 | 315223641B6AC3E200FC23F4 /* JRTViperInteractorClass.m */, 234 | 315223651B6AC3E200FC23F4 /* JRTViperInteractorProtocol.h */, 235 | 315223661B6AC3E200FC23F4 /* JRTViperPresenterClass.h */, 236 | 315223671B6AC3E200FC23F4 /* JRTViperPresenterClass.m */, 237 | 315223681B6AC3E200FC23F4 /* JRTViperPresenterProtocol.h */, 238 | 315223691B6AC3E200FC23F4 /* JRTViperRouterClass.h */, 239 | 3152236A1B6AC3E200FC23F4 /* JRTViperRouterClass.m */, 240 | 3152236B1B6AC3E200FC23F4 /* JRTViperRouterProtocol.h */, 241 | 3152236C1B6AC3E200FC23F4 /* JRTViperTabBarController.h */, 242 | 3152236D1B6AC3E200FC23F4 /* JRTViperTabBarController.m */, 243 | 3152236E1B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.h */, 244 | 3152236F1B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.m */, 245 | 315223701B6AC3E200FC23F4 /* JRTViperViewControllerClass.h */, 246 | 315223711B6AC3E200FC23F4 /* JRTViperViewControllerClass.m */, 247 | 315223721B6AC3E200FC23F4 /* JRTViperViewProtocol.h */, 248 | ); 249 | path = PodFiles; 250 | sourceTree = ""; 251 | }; 252 | 3152237D1B6AC91100FC23F4 /* Examples */ = { 253 | isa = PBXGroup; 254 | children = ( 255 | 319CB4AE1B84FB4E004674EE /* Contacts MasterDetail */, 256 | 315223AE1B6AD2FD00FC23F4 /* Empty */, 257 | 315223AC1B6AD13C00FC23F4 /* Item */, 258 | ); 259 | name = Examples; 260 | sourceTree = ""; 261 | }; 262 | 315223951B6ACEED00FC23F4 /* Index */ = { 263 | isa = PBXGroup; 264 | children = ( 265 | 315223961B6ACEED00FC23F4 /* Entity */, 266 | 315223991B6ACEED00FC23F4 /* Interactor */, 267 | 3152239C1B6ACEED00FC23F4 /* Presenter */, 268 | 3152239F1B6ACEED00FC23F4 /* Router */, 269 | 315223A21B6ACEED00FC23F4 /* View */, 270 | ); 271 | path = Index; 272 | sourceTree = ""; 273 | }; 274 | 315223961B6ACEED00FC23F4 /* Entity */ = { 275 | isa = PBXGroup; 276 | children = ( 277 | 315223971B6ACEED00FC23F4 /* JRTIndexEntity.h */, 278 | 315223981B6ACEED00FC23F4 /* JRTIndexEntity.m */, 279 | ); 280 | path = Entity; 281 | sourceTree = ""; 282 | }; 283 | 315223991B6ACEED00FC23F4 /* Interactor */ = { 284 | isa = PBXGroup; 285 | children = ( 286 | 3152239A1B6ACEED00FC23F4 /* JRTIndexInteractor.h */, 287 | 3152239B1B6ACEED00FC23F4 /* JRTIndexInteractor.m */, 288 | ); 289 | path = Interactor; 290 | sourceTree = ""; 291 | }; 292 | 3152239C1B6ACEED00FC23F4 /* Presenter */ = { 293 | isa = PBXGroup; 294 | children = ( 295 | 3152239D1B6ACEED00FC23F4 /* JRTIndexPresenter.h */, 296 | 3152239E1B6ACEED00FC23F4 /* JRTIndexPresenter.m */, 297 | ); 298 | path = Presenter; 299 | sourceTree = ""; 300 | }; 301 | 3152239F1B6ACEED00FC23F4 /* Router */ = { 302 | isa = PBXGroup; 303 | children = ( 304 | 315223A01B6ACEED00FC23F4 /* JRTIndexRouter.h */, 305 | 315223A11B6ACEED00FC23F4 /* JRTIndexRouter.m */, 306 | ); 307 | path = Router; 308 | sourceTree = ""; 309 | }; 310 | 315223A21B6ACEED00FC23F4 /* View */ = { 311 | isa = PBXGroup; 312 | children = ( 313 | 315223A31B6ACEED00FC23F4 /* JRTIndexViewController.h */, 314 | 315223A41B6ACEED00FC23F4 /* JRTIndexViewController.m */, 315 | 315223A51B6ACEED00FC23F4 /* JRTIndexViewController.xib */, 316 | ); 317 | path = View; 318 | sourceTree = ""; 319 | }; 320 | 315223AC1B6AD13C00FC23F4 /* Item */ = { 321 | isa = PBXGroup; 322 | children = ( 323 | 319CB49C1B84E99D004674EE /* Router */, 324 | 319CB49B1B84E992004674EE /* Entity */, 325 | 319CB49A1B84E98A004674EE /* Presenter */, 326 | 319CB4991B84E94C004674EE /* Interactor */, 327 | 315223AD1B6AD2CF00FC23F4 /* View */, 328 | ); 329 | name = Item; 330 | sourceTree = ""; 331 | }; 332 | 315223AD1B6AD2CF00FC23F4 /* View */ = { 333 | isa = PBXGroup; 334 | children = ( 335 | 319CB4A91B84EBC2004674EE /* ItemViewController.h */, 336 | 319CB4AA1B84EBC2004674EE /* ItemViewController.m */, 337 | 319CB4AB1B84EBC2004674EE /* ItemViewController.xib */, 338 | ); 339 | name = View; 340 | sourceTree = ""; 341 | }; 342 | 315223AE1B6AD2FD00FC23F4 /* Empty */ = { 343 | isa = PBXGroup; 344 | children = ( 345 | 315223B31B6AD39400FC23F4 /* Router */, 346 | 315223B21B6AD38700FC23F4 /* Entity */, 347 | 315223B11B6AD32000FC23F4 /* Presenter */, 348 | 315223B01B6AD31700FC23F4 /* Interactor */, 349 | 315223AF1B6AD30F00FC23F4 /* View */, 350 | ); 351 | name = Empty; 352 | sourceTree = ""; 353 | }; 354 | 315223AF1B6AD30F00FC23F4 /* View */ = { 355 | isa = PBXGroup; 356 | children = ( 357 | 315223B71B6AD3EF00FC23F4 /* EmptyViewController.h */, 358 | 315223B81B6AD3EF00FC23F4 /* EmptyViewController.m */, 359 | 315223B91B6AD3EF00FC23F4 /* EmptyViewController.xib */, 360 | ); 361 | name = View; 362 | sourceTree = ""; 363 | }; 364 | 315223B01B6AD31700FC23F4 /* Interactor */ = { 365 | isa = PBXGroup; 366 | children = ( 367 | 315223BF1B6AD5F700FC23F4 /* EmptyInteractor.h */, 368 | 315223C01B6AD5F700FC23F4 /* EmptyInteractor.m */, 369 | ); 370 | name = Interactor; 371 | sourceTree = ""; 372 | }; 373 | 315223B11B6AD32000FC23F4 /* Presenter */ = { 374 | isa = PBXGroup; 375 | children = ( 376 | 315223BC1B6AD43F00FC23F4 /* EmptyPresenter.h */, 377 | 315223BD1B6AD43F00FC23F4 /* EmptyPresenter.m */, 378 | ); 379 | name = Presenter; 380 | sourceTree = ""; 381 | }; 382 | 315223B21B6AD38700FC23F4 /* Entity */ = { 383 | isa = PBXGroup; 384 | children = ( 385 | ); 386 | name = Entity; 387 | sourceTree = ""; 388 | }; 389 | 315223B31B6AD39400FC23F4 /* Router */ = { 390 | isa = PBXGroup; 391 | children = ( 392 | 315223B41B6AD3B700FC23F4 /* EmptyRouter.h */, 393 | 315223B51B6AD3B700FC23F4 /* EmptyRouter.m */, 394 | ); 395 | name = Router; 396 | sourceTree = ""; 397 | }; 398 | 319CB4991B84E94C004674EE /* Interactor */ = { 399 | isa = PBXGroup; 400 | children = ( 401 | 319CB4A61B84EB84004674EE /* ItemInteractor.h */, 402 | 319CB4A71B84EB84004674EE /* ItemInteractor.m */, 403 | ); 404 | name = Interactor; 405 | sourceTree = ""; 406 | }; 407 | 319CB49A1B84E98A004674EE /* Presenter */ = { 408 | isa = PBXGroup; 409 | children = ( 410 | 319CB4A31B84EB2E004674EE /* ItemPresenter.h */, 411 | 319CB4A41B84EB2E004674EE /* ItemPresenter.m */, 412 | ); 413 | name = Presenter; 414 | sourceTree = ""; 415 | }; 416 | 319CB49B1B84E992004674EE /* Entity */ = { 417 | isa = PBXGroup; 418 | children = ( 419 | 319CB4A01B84EA90004674EE /* ItemEntity.h */, 420 | 319CB4A11B84EA90004674EE /* ItemEntity.m */, 421 | ); 422 | name = Entity; 423 | sourceTree = ""; 424 | }; 425 | 319CB49C1B84E99D004674EE /* Router */ = { 426 | isa = PBXGroup; 427 | children = ( 428 | 319CB49D1B84EA00004674EE /* ItemRouter.h */, 429 | 319CB49E1B84EA00004674EE /* ItemRouter.m */, 430 | ); 431 | name = Router; 432 | sourceTree = ""; 433 | }; 434 | 319CB4AE1B84FB4E004674EE /* Contacts MasterDetail */ = { 435 | isa = PBXGroup; 436 | children = ( 437 | 319CB4B31B851782004674EE /* Router */, 438 | 319CB4B21B851776004674EE /* Entity */, 439 | 319CB4B11B85176A004674EE /* Presenter */, 440 | 319CB4B01B851755004674EE /* Interactor */, 441 | 319CB4AF1B84FC96004674EE /* View */, 442 | ); 443 | name = "Contacts MasterDetail"; 444 | sourceTree = ""; 445 | }; 446 | 319CB4AF1B84FC96004674EE /* View */ = { 447 | isa = PBXGroup; 448 | children = ( 449 | 319CB4C01B85253F004674EE /* ContactsViewController.h */, 450 | 319CB4C11B85253F004674EE /* ContactsViewController.m */, 451 | 319CB4C21B85253F004674EE /* ContactsViewController.xib */, 452 | 319CB4CB1B853914004674EE /* ContactViewController.h */, 453 | 319CB4CC1B853914004674EE /* ContactViewController.m */, 454 | 319CB4CD1B853914004674EE /* ContactViewController.xib */, 455 | ); 456 | name = View; 457 | sourceTree = ""; 458 | }; 459 | 319CB4B01B851755004674EE /* Interactor */ = { 460 | isa = PBXGroup; 461 | children = ( 462 | 319CB4BD1B85251B004674EE /* ContactInteractor.h */, 463 | 319CB4BE1B85251B004674EE /* ContactInteractor.m */, 464 | ); 465 | name = Interactor; 466 | sourceTree = ""; 467 | }; 468 | 319CB4B11B85176A004674EE /* Presenter */ = { 469 | isa = PBXGroup; 470 | children = ( 471 | 319CB4BA1B8524F8004674EE /* ContactsPresenter.h */, 472 | 319CB4BB1B8524F8004674EE /* ContactsPresenter.m */, 473 | 319CB4C81B8537DB004674EE /* ContactPresenter.h */, 474 | 319CB4C91B8537DB004674EE /* ContactPresenter.m */, 475 | ); 476 | name = Presenter; 477 | sourceTree = ""; 478 | }; 479 | 319CB4B21B851776004674EE /* Entity */ = { 480 | isa = PBXGroup; 481 | children = ( 482 | 319CB4B41B8517DE004674EE /* ContactEntity.h */, 483 | 319CB4B51B8517DE004674EE /* ContactEntity.m */, 484 | ); 485 | name = Entity; 486 | sourceTree = ""; 487 | }; 488 | 319CB4B31B851782004674EE /* Router */ = { 489 | isa = PBXGroup; 490 | children = ( 491 | 319CB4B71B8524D8004674EE /* ContactsRouter.h */, 492 | 319CB4B81B8524D8004674EE /* ContactsRouter.m */, 493 | 319CB4C51B8535DD004674EE /* ContactRouter.h */, 494 | 319CB4C61B8535DD004674EE /* ContactRouter.m */, 495 | ); 496 | name = Router; 497 | sourceTree = ""; 498 | }; 499 | /* End PBXGroup section */ 500 | 501 | /* Begin PBXNativeTarget section */ 502 | 315223341B6AC28400FC23F4 /* JRTViper */ = { 503 | isa = PBXNativeTarget; 504 | buildConfigurationList = 315223581B6AC28400FC23F4 /* Build configuration list for PBXNativeTarget "JRTViper" */; 505 | buildPhases = ( 506 | 315223311B6AC28400FC23F4 /* Sources */, 507 | 315223321B6AC28400FC23F4 /* Frameworks */, 508 | 315223331B6AC28400FC23F4 /* Resources */, 509 | ); 510 | buildRules = ( 511 | ); 512 | dependencies = ( 513 | ); 514 | name = JRTViper; 515 | productName = JRTViper; 516 | productReference = 315223351B6AC28400FC23F4 /* JRTViper.app */; 517 | productType = "com.apple.product-type.application"; 518 | }; 519 | 3152234D1B6AC28400FC23F4 /* JRTViperTests */ = { 520 | isa = PBXNativeTarget; 521 | buildConfigurationList = 3152235B1B6AC28400FC23F4 /* Build configuration list for PBXNativeTarget "JRTViperTests" */; 522 | buildPhases = ( 523 | 3152234A1B6AC28400FC23F4 /* Sources */, 524 | 3152234B1B6AC28400FC23F4 /* Frameworks */, 525 | 3152234C1B6AC28400FC23F4 /* Resources */, 526 | ); 527 | buildRules = ( 528 | ); 529 | dependencies = ( 530 | 315223501B6AC28400FC23F4 /* PBXTargetDependency */, 531 | ); 532 | name = JRTViperTests; 533 | productName = JRTViperTests; 534 | productReference = 3152234E1B6AC28400FC23F4 /* JRTViperTests.xctest */; 535 | productType = "com.apple.product-type.bundle.unit-test"; 536 | }; 537 | /* End PBXNativeTarget section */ 538 | 539 | /* Begin PBXProject section */ 540 | 3152232D1B6AC28400FC23F4 /* Project object */ = { 541 | isa = PBXProject; 542 | attributes = { 543 | LastUpgradeCheck = 0640; 544 | ORGANIZATIONNAME = "Juan Garcia"; 545 | TargetAttributes = { 546 | 315223341B6AC28400FC23F4 = { 547 | CreatedOnToolsVersion = 6.4; 548 | }; 549 | 3152234D1B6AC28400FC23F4 = { 550 | CreatedOnToolsVersion = 6.4; 551 | TestTargetID = 315223341B6AC28400FC23F4; 552 | }; 553 | }; 554 | }; 555 | buildConfigurationList = 315223301B6AC28400FC23F4 /* Build configuration list for PBXProject "JRTViper" */; 556 | compatibilityVersion = "Xcode 3.2"; 557 | developmentRegion = English; 558 | hasScannedForEncodings = 0; 559 | knownRegions = ( 560 | en, 561 | Base, 562 | ); 563 | mainGroup = 3152232C1B6AC28400FC23F4; 564 | productRefGroup = 315223361B6AC28400FC23F4 /* Products */; 565 | projectDirPath = ""; 566 | projectRoot = ""; 567 | targets = ( 568 | 315223341B6AC28400FC23F4 /* JRTViper */, 569 | 3152234D1B6AC28400FC23F4 /* JRTViperTests */, 570 | ); 571 | }; 572 | /* End PBXProject section */ 573 | 574 | /* Begin PBXResourcesBuildPhase section */ 575 | 315223331B6AC28400FC23F4 /* Resources */ = { 576 | isa = PBXResourcesBuildPhase; 577 | buildActionMask = 2147483647; 578 | files = ( 579 | 315223491B6AC28400FC23F4 /* LaunchScreen.xib in Resources */, 580 | 319CB4C41B85253F004674EE /* ContactsViewController.xib in Resources */, 581 | 315223461B6AC28400FC23F4 /* Images.xcassets in Resources */, 582 | 319CB4AD1B84EBC2004674EE /* ItemViewController.xib in Resources */, 583 | 315223BB1B6AD3EF00FC23F4 /* EmptyViewController.xib in Resources */, 584 | 315223AB1B6ACEED00FC23F4 /* JRTIndexViewController.xib in Resources */, 585 | 319CB4CF1B853914004674EE /* ContactViewController.xib in Resources */, 586 | ); 587 | runOnlyForDeploymentPostprocessing = 0; 588 | }; 589 | 3152234C1B6AC28400FC23F4 /* Resources */ = { 590 | isa = PBXResourcesBuildPhase; 591 | buildActionMask = 2147483647; 592 | files = ( 593 | ); 594 | runOnlyForDeploymentPostprocessing = 0; 595 | }; 596 | /* End PBXResourcesBuildPhase section */ 597 | 598 | /* Begin PBXSourcesBuildPhase section */ 599 | 315223311B6AC28400FC23F4 /* Sources */ = { 600 | isa = PBXSourcesBuildPhase; 601 | buildActionMask = 2147483647; 602 | files = ( 603 | 315223731B6AC3E200FC23F4 /* JRTViperEntityClass.m in Sources */, 604 | 319CB4B91B8524D8004674EE /* ContactsRouter.m in Sources */, 605 | 315223781B6AC3E200FC23F4 /* JRTViperTableViewControllerClass.m in Sources */, 606 | 315223791B6AC3E200FC23F4 /* JRTViperViewControllerClass.m in Sources */, 607 | 315223761B6AC3E200FC23F4 /* JRTViperRouterClass.m in Sources */, 608 | 315223BE1B6AD43F00FC23F4 /* EmptyPresenter.m in Sources */, 609 | 319CB4BC1B8524F8004674EE /* ContactsPresenter.m in Sources */, 610 | 315223A91B6ACEED00FC23F4 /* JRTIndexRouter.m in Sources */, 611 | 315223A61B6ACEED00FC23F4 /* JRTIndexEntity.m in Sources */, 612 | 315223C11B6AD5F700FC23F4 /* EmptyInteractor.m in Sources */, 613 | 3152237C1B6AC87C00FC23F4 /* JRTMainRouter.m in Sources */, 614 | 315223A81B6ACEED00FC23F4 /* JRTIndexPresenter.m in Sources */, 615 | 315223B61B6AD3B700FC23F4 /* EmptyRouter.m in Sources */, 616 | 319CB4C71B8535DD004674EE /* ContactRouter.m in Sources */, 617 | 319CB49F1B84EA00004674EE /* ItemRouter.m in Sources */, 618 | 319CB4A21B84EA90004674EE /* ItemEntity.m in Sources */, 619 | 319CB4AC1B84EBC2004674EE /* ItemViewController.m in Sources */, 620 | 319CB4B61B8517DE004674EE /* ContactEntity.m in Sources */, 621 | 319CB4BF1B85251B004674EE /* ContactInteractor.m in Sources */, 622 | 315223A71B6ACEED00FC23F4 /* JRTIndexInteractor.m in Sources */, 623 | 315223771B6AC3E200FC23F4 /* JRTViperTabBarController.m in Sources */, 624 | 319CB4C31B85253F004674EE /* ContactsViewController.m in Sources */, 625 | 3152233E1B6AC28400FC23F4 /* AppDelegate.m in Sources */, 626 | 315223751B6AC3E200FC23F4 /* JRTViperPresenterClass.m in Sources */, 627 | 319CB4A51B84EB2E004674EE /* ItemPresenter.m in Sources */, 628 | 3152233B1B6AC28400FC23F4 /* main.m in Sources */, 629 | 319CB4CA1B8537DB004674EE /* ContactPresenter.m in Sources */, 630 | 319CB4A81B84EB84004674EE /* ItemInteractor.m in Sources */, 631 | 315223BA1B6AD3EF00FC23F4 /* EmptyViewController.m in Sources */, 632 | 319CB4CE1B853914004674EE /* ContactViewController.m in Sources */, 633 | 315223AA1B6ACEED00FC23F4 /* JRTIndexViewController.m in Sources */, 634 | 315223741B6AC3E200FC23F4 /* JRTViperInteractorClass.m in Sources */, 635 | ); 636 | runOnlyForDeploymentPostprocessing = 0; 637 | }; 638 | 3152234A1B6AC28400FC23F4 /* Sources */ = { 639 | isa = PBXSourcesBuildPhase; 640 | buildActionMask = 2147483647; 641 | files = ( 642 | 315223551B6AC28400FC23F4 /* JRTViperTests.m in Sources */, 643 | ); 644 | runOnlyForDeploymentPostprocessing = 0; 645 | }; 646 | /* End PBXSourcesBuildPhase section */ 647 | 648 | /* Begin PBXTargetDependency section */ 649 | 315223501B6AC28400FC23F4 /* PBXTargetDependency */ = { 650 | isa = PBXTargetDependency; 651 | target = 315223341B6AC28400FC23F4 /* JRTViper */; 652 | targetProxy = 3152234F1B6AC28400FC23F4 /* PBXContainerItemProxy */; 653 | }; 654 | /* End PBXTargetDependency section */ 655 | 656 | /* Begin PBXVariantGroup section */ 657 | 315223471B6AC28400FC23F4 /* LaunchScreen.xib */ = { 658 | isa = PBXVariantGroup; 659 | children = ( 660 | 315223481B6AC28400FC23F4 /* Base */, 661 | ); 662 | name = LaunchScreen.xib; 663 | sourceTree = ""; 664 | }; 665 | /* End PBXVariantGroup section */ 666 | 667 | /* Begin XCBuildConfiguration section */ 668 | 315223561B6AC28400FC23F4 /* Debug */ = { 669 | isa = XCBuildConfiguration; 670 | buildSettings = { 671 | ALWAYS_SEARCH_USER_PATHS = NO; 672 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 673 | CLANG_CXX_LIBRARY = "libc++"; 674 | CLANG_ENABLE_MODULES = YES; 675 | CLANG_ENABLE_OBJC_ARC = YES; 676 | CLANG_WARN_BOOL_CONVERSION = YES; 677 | CLANG_WARN_CONSTANT_CONVERSION = YES; 678 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 679 | CLANG_WARN_EMPTY_BODY = YES; 680 | CLANG_WARN_ENUM_CONVERSION = YES; 681 | CLANG_WARN_INT_CONVERSION = YES; 682 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 683 | CLANG_WARN_UNREACHABLE_CODE = YES; 684 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 685 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 686 | COPY_PHASE_STRIP = NO; 687 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 688 | ENABLE_STRICT_OBJC_MSGSEND = YES; 689 | GCC_C_LANGUAGE_STANDARD = gnu99; 690 | GCC_DYNAMIC_NO_PIC = NO; 691 | GCC_NO_COMMON_BLOCKS = YES; 692 | GCC_OPTIMIZATION_LEVEL = 0; 693 | GCC_PREPROCESSOR_DEFINITIONS = ( 694 | "DEBUG=1", 695 | "$(inherited)", 696 | ); 697 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 698 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 699 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 700 | GCC_WARN_UNDECLARED_SELECTOR = YES; 701 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 702 | GCC_WARN_UNUSED_FUNCTION = YES; 703 | GCC_WARN_UNUSED_VARIABLE = YES; 704 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 705 | MTL_ENABLE_DEBUG_INFO = YES; 706 | ONLY_ACTIVE_ARCH = YES; 707 | SDKROOT = iphoneos; 708 | }; 709 | name = Debug; 710 | }; 711 | 315223571B6AC28400FC23F4 /* Release */ = { 712 | isa = XCBuildConfiguration; 713 | buildSettings = { 714 | ALWAYS_SEARCH_USER_PATHS = NO; 715 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 716 | CLANG_CXX_LIBRARY = "libc++"; 717 | CLANG_ENABLE_MODULES = YES; 718 | CLANG_ENABLE_OBJC_ARC = YES; 719 | CLANG_WARN_BOOL_CONVERSION = YES; 720 | CLANG_WARN_CONSTANT_CONVERSION = YES; 721 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 722 | CLANG_WARN_EMPTY_BODY = YES; 723 | CLANG_WARN_ENUM_CONVERSION = YES; 724 | CLANG_WARN_INT_CONVERSION = YES; 725 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 726 | CLANG_WARN_UNREACHABLE_CODE = YES; 727 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 728 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 729 | COPY_PHASE_STRIP = NO; 730 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 731 | ENABLE_NS_ASSERTIONS = NO; 732 | ENABLE_STRICT_OBJC_MSGSEND = YES; 733 | GCC_C_LANGUAGE_STANDARD = gnu99; 734 | GCC_NO_COMMON_BLOCKS = YES; 735 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 736 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 737 | GCC_WARN_UNDECLARED_SELECTOR = YES; 738 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 739 | GCC_WARN_UNUSED_FUNCTION = YES; 740 | GCC_WARN_UNUSED_VARIABLE = YES; 741 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 742 | MTL_ENABLE_DEBUG_INFO = NO; 743 | SDKROOT = iphoneos; 744 | VALIDATE_PRODUCT = YES; 745 | }; 746 | name = Release; 747 | }; 748 | 315223591B6AC28400FC23F4 /* Debug */ = { 749 | isa = XCBuildConfiguration; 750 | buildSettings = { 751 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 752 | INFOPLIST_FILE = JRTViper/Info.plist; 753 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 754 | PRODUCT_NAME = "$(TARGET_NAME)"; 755 | }; 756 | name = Debug; 757 | }; 758 | 3152235A1B6AC28400FC23F4 /* Release */ = { 759 | isa = XCBuildConfiguration; 760 | buildSettings = { 761 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 762 | INFOPLIST_FILE = JRTViper/Info.plist; 763 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 764 | PRODUCT_NAME = "$(TARGET_NAME)"; 765 | }; 766 | name = Release; 767 | }; 768 | 3152235C1B6AC28400FC23F4 /* Debug */ = { 769 | isa = XCBuildConfiguration; 770 | buildSettings = { 771 | BUNDLE_LOADER = "$(TEST_HOST)"; 772 | FRAMEWORK_SEARCH_PATHS = ( 773 | "$(SDKROOT)/Developer/Library/Frameworks", 774 | "$(inherited)", 775 | ); 776 | GCC_PREPROCESSOR_DEFINITIONS = ( 777 | "DEBUG=1", 778 | "$(inherited)", 779 | ); 780 | INFOPLIST_FILE = JRTViperTests/Info.plist; 781 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 782 | PRODUCT_NAME = "$(TARGET_NAME)"; 783 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JRTViper.app/JRTViper"; 784 | }; 785 | name = Debug; 786 | }; 787 | 3152235D1B6AC28400FC23F4 /* Release */ = { 788 | isa = XCBuildConfiguration; 789 | buildSettings = { 790 | BUNDLE_LOADER = "$(TEST_HOST)"; 791 | FRAMEWORK_SEARCH_PATHS = ( 792 | "$(SDKROOT)/Developer/Library/Frameworks", 793 | "$(inherited)", 794 | ); 795 | INFOPLIST_FILE = JRTViperTests/Info.plist; 796 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 797 | PRODUCT_NAME = "$(TARGET_NAME)"; 798 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JRTViper.app/JRTViper"; 799 | }; 800 | name = Release; 801 | }; 802 | /* End XCBuildConfiguration section */ 803 | 804 | /* Begin XCConfigurationList section */ 805 | 315223301B6AC28400FC23F4 /* Build configuration list for PBXProject "JRTViper" */ = { 806 | isa = XCConfigurationList; 807 | buildConfigurations = ( 808 | 315223561B6AC28400FC23F4 /* Debug */, 809 | 315223571B6AC28400FC23F4 /* Release */, 810 | ); 811 | defaultConfigurationIsVisible = 0; 812 | defaultConfigurationName = Release; 813 | }; 814 | 315223581B6AC28400FC23F4 /* Build configuration list for PBXNativeTarget "JRTViper" */ = { 815 | isa = XCConfigurationList; 816 | buildConfigurations = ( 817 | 315223591B6AC28400FC23F4 /* Debug */, 818 | 3152235A1B6AC28400FC23F4 /* Release */, 819 | ); 820 | defaultConfigurationIsVisible = 0; 821 | defaultConfigurationName = Release; 822 | }; 823 | 3152235B1B6AC28400FC23F4 /* Build configuration list for PBXNativeTarget "JRTViperTests" */ = { 824 | isa = XCConfigurationList; 825 | buildConfigurations = ( 826 | 3152235C1B6AC28400FC23F4 /* Debug */, 827 | 3152235D1B6AC28400FC23F4 /* Release */, 828 | ); 829 | defaultConfigurationIsVisible = 0; 830 | defaultConfigurationName = Release; 831 | }; 832 | /* End XCConfigurationList section */ 833 | }; 834 | rootObject = 3152232D1B6AC28400FC23F4 /* Project object */; 835 | } 836 | -------------------------------------------------------------------------------- /JRTViper/JRTViper.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTMainRouter.h" 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | @property (nonatomic, strong) JRTMainRouter *mainRouter; 16 | 17 | 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | -(UIWindow *)window 19 | { 20 | if (!_window) _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 21 | return _window; 22 | } 23 | 24 | -(JRTMainRouter *)mainRouter 25 | { 26 | if (!_mainRouter) _mainRouter = [JRTMainRouter new]; 27 | return _mainRouter; 28 | } 29 | 30 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 31 | // Override point for customization after application launch. 32 | self.window.rootViewController = [self.mainRouter rootViewController]; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application { 38 | // 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. 39 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 40 | } 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application { 43 | // 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. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | - (void)applicationWillEnterForeground:(UIApplication *)application { 48 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 49 | } 50 | 51 | - (void)applicationDidBecomeActive:(UIApplication *)application { 52 | // 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. 53 | } 54 | 55 | - (void)applicationWillTerminate:(UIApplication *)application { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactEntity.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactEntity.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperEntityClass.h" 11 | @interface ContactEntity : JRTViperEntityClass; 12 | @property (nonatomic ) NSInteger uid; 13 | @property (nonatomic, strong) NSString *name; 14 | @property (nonatomic, strong) NSString *email; 15 | @property (nonatomic, strong) NSString *phone; 16 | @property (nonatomic, strong) NSString *address; 17 | @end 18 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactEntity.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactEntity.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactEntity.h" 10 | 11 | @implementation ContactEntity 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactInteractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactInteractor.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperInteractorClass.h" 11 | #import "ContactEntity.h" 12 | @interface ContactInteractor : JRTViperInteractorClass 13 | - (NSArray *)contactList; 14 | - (ContactEntity *)readContactWithUid:(NSInteger)uid; 15 | @end 16 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactInteractor.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactInteractor.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactInteractor.h" 10 | 11 | @implementation ContactInteractor 12 | 13 | - (NSArray *)contactList 14 | { 15 | // Usually entities are obtained from a content provider, 16 | // but this example is only about viper 17 | 18 | NSMutableArray *list = [NSMutableArray new]; 19 | for (int i = 0; i < 100; i++) 20 | { 21 | ContactEntity *entity = [ContactEntity new]; 22 | entity.uid = i; 23 | entity.name = [NSString stringWithFormat:@"Jhon%i",i]; 24 | entity.email = [NSString stringWithFormat:@"jhon%i@mail.com",i]; 25 | entity.phone = [NSString stringWithFormat:@"9999 999%i",i]; 26 | entity.address = [NSString stringWithFormat:@"address #%i",i]; 27 | [list addObject:entity]; 28 | } 29 | return [NSArray arrayWithArray:list]; 30 | } 31 | 32 | - (ContactEntity *)readContactWithUid:(NSInteger)uid 33 | { 34 | // Usually entities are obtained from a content provider, 35 | // but this example is only about viper 36 | 37 | ContactEntity *entity = [ContactEntity new]; 38 | entity.uid = uid; 39 | entity.name = [NSString stringWithFormat:@"Jhon%li",(long)uid]; 40 | entity.email = [NSString stringWithFormat:@"jhon%li@mail.com",(long)uid]; 41 | entity.phone = [NSString stringWithFormat:@"9999 999%li",(long)uid]; 42 | entity.address = [NSString stringWithFormat:@"address #%li",(long)uid]; 43 | return entity; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactPresenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactPresenter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperPresenterClass.h" 11 | @interface ContactPresenter : JRTViperPresenterClass 12 | @property (nonatomic, strong) NSNumber *contactUid; 13 | 14 | - (NSString *)uid; 15 | - (NSString *)name; 16 | - (NSString *)email; 17 | - (NSString *)phone; 18 | - (NSString *)address; 19 | @end 20 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactPresenter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactPresenter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactPresenter.h" 10 | #import "ContactEntity.h" 11 | #import "ContactInteractor.h" 12 | 13 | @interface ContactPresenter () 14 | @property (nonatomic, readonly) ContactInteractor *contactInteractor; 15 | @property (nonatomic, strong ) ContactEntity *contactEntity; 16 | @end 17 | 18 | @implementation ContactPresenter 19 | 20 | - (ContactInteractor *)contactInteractor 21 | { 22 | return (ContactInteractor *)self.interactor; 23 | } 24 | 25 | - (ContactEntity *)contactEntity 26 | { 27 | if (!_contactEntity) 28 | { 29 | _contactEntity = [self.contactInteractor readContactWithUid:self.contactUid.integerValue]; 30 | } 31 | return _contactEntity; 32 | } 33 | 34 | #pragma mark - Public 35 | 36 | - (NSString *)uid 37 | { 38 | return [NSString stringWithFormat:@"%li", (long)self.contactEntity.uid]; 39 | } 40 | 41 | - (NSString *)name 42 | { 43 | return [self.contactEntity.name capitalizedString]; 44 | } 45 | 46 | - (NSString *)email 47 | { 48 | return self.contactEntity.email; 49 | } 50 | 51 | - (NSString *)phone 52 | { 53 | return self.contactEntity.phone; 54 | } 55 | 56 | - (NSString *)address 57 | { 58 | return self.contactEntity.address; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactRouter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperRouterClass.h" 11 | @interface ContactRouter : JRTViperRouterClass 12 | //- (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated withContactUid:(NSInteger)contactUid; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactRouter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactRouter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactRouter.h" 10 | #import "ContactPresenter.h" 11 | 12 | @interface ContactRouter () 13 | @end 14 | 15 | @implementation ContactRouter 16 | 17 | 18 | //- (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated withContactUid:(NSInteger)contactUid 19 | //{ 20 | // UIViewController * viewController = (UIViewController *) [self viewController]; 21 | // ((ContactPresenter *)(viewController.presenter)).contactUid = contactUid; 22 | // [navigationController pushViewController: viewController animated:animated]; 23 | //} 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactViewController.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperViewControllerClass.h" 11 | @interface ContactViewController : JRTViperViewControllerClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactViewController.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactViewController.h" 10 | #import "ContactPresenter.h" 11 | 12 | @interface ContactViewController () 13 | @property (weak, nonatomic ) IBOutlet UILabel *uidLabel; 14 | @property (weak, nonatomic ) IBOutlet UILabel *nameLabel; 15 | @property (weak, nonatomic ) IBOutlet UILabel *emailLabel; 16 | @property (weak, nonatomic ) IBOutlet UILabel *phoneLabel; 17 | @property (weak, nonatomic ) IBOutlet UILabel *addressLabel; 18 | @property (nonatomic, readonly) ContactPresenter *contactPresenter; 19 | @end 20 | 21 | @implementation ContactViewController 22 | 23 | - (ContactPresenter *)contactPresenter 24 | { 25 | return (ContactPresenter *)self.presenter; 26 | } 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | self.title = [NSString stringWithFormat:@"Contact %li", (long)self.contactPresenter.contactUid]; 32 | self.uidLabel.text = [self.contactPresenter uid]; 33 | self.nameLabel.text = [self.contactPresenter name]; 34 | self.emailLabel.text = [self.contactPresenter email]; 35 | self.phoneLabel.text = [self.contactPresenter phone]; 36 | self.addressLabel.text = [self.contactPresenter address]; 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 34 | 40 | 46 | 52 | 58 | 64 | 70 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsPresenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactsPresenter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperPresenterClass.h" 11 | @interface ContactsPresenter : JRTViperPresenterClass 12 | - (NSInteger)numberOfContacts; 13 | - (NSString *)nameOfContactAtIndex:(NSInteger)index; 14 | - (void)showContactAtIndex:(NSInteger)index; 15 | @end 16 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsPresenter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactsPresenter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactsPresenter.h" 10 | #import "ContactEntity.h" 11 | #import "ContactInteractor.h" 12 | #import "ContactRouter.h" 13 | 14 | @interface ContactsPresenter () 15 | @property (nonatomic, readonly) ContactInteractor *contactInteractor; 16 | @property (nonatomic, strong)NSArray *contacts; 17 | @end 18 | 19 | @implementation ContactsPresenter 20 | 21 | 22 | #pragma mark - Custom Interactor 23 | 24 | // If the name of the interactor class does not conform to standard 25 | 26 | @synthesize interactor = _interactor; 27 | 28 | -(id)interactor 29 | { 30 | if (!_interactor) 31 | { 32 | _interactor = [ContactInteractor new]; 33 | } 34 | return _interactor; 35 | } 36 | 37 | #pragma mark - Getters 38 | 39 | - (ContactInteractor *)contactInteractor 40 | { 41 | return (ContactInteractor *)self.interactor; 42 | } 43 | 44 | - (NSArray *)contacts 45 | { 46 | if (!_contacts) 47 | { 48 | _contacts = [self.contactInteractor contactList]; 49 | } 50 | return _contacts; 51 | } 52 | 53 | #pragma mark - Publics 54 | 55 | - (NSInteger)numberOfContacts 56 | { 57 | return [self.contacts count]; 58 | } 59 | 60 | - (NSString *)nameOfContactAtIndex:(NSInteger)index 61 | { 62 | ContactEntity *contact = [self.contacts objectAtIndex:index]; 63 | return contact.name; 64 | } 65 | 66 | -(void)showContactAtIndex:(NSInteger)index 67 | { 68 | ContactRouter *nextRouter = [ContactRouter new]; 69 | [nextRouter pushInNavigationController:((UIViewController*)self.viewController).navigationController animated:YES andPresenterPerformSelector:NSSelectorFromString(@"setContactUid:") withObject:@(index)]; 70 | } 71 | 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactsRouter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperRouterClass.h" 11 | @interface ContactsRouter : JRTViperRouterClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsRouter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactsRouter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactsRouter.h" 10 | 11 | @implementation ContactsRouter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContactsViewController.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperTableViewControllerClass.h" 11 | @interface ContactsViewController : JRTViperTableViewControllerClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContactsViewController.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ContactsViewController.h" 10 | #import "ContactsPresenter.h" 11 | 12 | @interface ContactsViewController () 13 | @property (nonatomic, readonly) ContactsPresenter *contactsPresenter; 14 | @end 15 | 16 | @implementation ContactsViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.title = @"Contacts"; 21 | } 22 | 23 | #pragma mark - Getters 24 | 25 | -(ContactsPresenter *)contactsPresenter 26 | { 27 | return (ContactsPresenter *)self.presenter; 28 | } 29 | 30 | #pragma mark - Table view data source 31 | 32 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 33 | { 34 | return 1; 35 | } 36 | 37 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 38 | { 39 | return [self.contactsPresenter numberOfContacts]; 40 | } 41 | 42 | 43 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 44 | { 45 | static NSString *simpleTableIdentifier = @"contactCell"; 46 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 47 | if (cell == nil) 48 | { 49 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; 50 | } 51 | cell.textLabel.text = [self.contactsPresenter nameOfContactAtIndex:indexPath.row]; 52 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 53 | return cell; 54 | } 55 | 56 | #pragma mark - Table view delegate 57 | 58 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 59 | { 60 | [self.contactsPresenter showContactAtIndex:indexPath.row]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ContactsViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyInteractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyInteractor.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperInteractorClass.h" 11 | @interface EmptyInteractor : JRTViperInteractorClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyInteractor.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyInteractor.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "EmptyInteractor.h" 10 | 11 | @implementation EmptyInteractor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyPresenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyPresenter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperPresenterClass.h" 11 | @interface EmptyPresenter : JRTViperPresenterClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyPresenter.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyPresenter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "EmptyPresenter.h" 10 | 11 | @implementation EmptyPresenter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyRouter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperRouterClass.h" 11 | @interface EmptyRouter : JRTViperRouterClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyRouter.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyRouter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "EmptyRouter.h" 10 | 11 | @implementation EmptyRouter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyViewController.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperViewControllerClass.h" 11 | @interface EmptyViewController : JRTViperViewControllerClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyViewController.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "EmptyViewController.h" 10 | 11 | @interface EmptyViewController () 12 | 13 | @end 14 | 15 | @implementation EmptyViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view from its nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/EmptyViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Entity/JRTIndexEntity.h: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexEntity.h 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | 11 | extern NSString * const kSectionTitleKey; 12 | extern NSString * const kModulesKey; 13 | extern NSString * const kModuleNameKey; 14 | extern NSString * const kModuleRouterNameKey; 15 | 16 | @interface JRTIndexEntity : NSObject 17 | @property (nonatomic, strong) NSArray *root; 18 | @end 19 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Entity/JRTIndexEntity.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexEntity.m 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "JRTIndexEntity.h" 10 | 11 | #import "EmptyRouter.h" 12 | #import "ItemRouter.h" 13 | #import "ContactsRouter.h" 14 | 15 | NSString * const kSectionTitleKey = @"SectionTitle"; 16 | NSString * const kModulesKey = @"Modules"; 17 | NSString * const kModuleNameKey = @"ModuleName"; 18 | NSString * const kModuleRouterNameKey = @"ModuleRouter"; 19 | 20 | @implementation JRTIndexEntity 21 | -(NSArray *)root 22 | { 23 | if (!_root) 24 | { 25 | _root = @[ 26 | @{ 27 | kSectionTitleKey : @"Base", 28 | kModulesKey : @[ 29 | @{ 30 | kModuleNameKey : @"Empty", 31 | kModuleRouterNameKey : NSStringFromClass([EmptyRouter class]) 32 | }, 33 | @{ 34 | kModuleNameKey : @"Item", 35 | kModuleRouterNameKey : NSStringFromClass([ItemRouter class]) 36 | }, 37 | @{ 38 | kModuleNameKey : @"Contact (Master - Detail)", 39 | kModuleRouterNameKey : NSStringFromClass([ContactsRouter class]) 40 | } 41 | 42 | ] 43 | } 44 | 45 | ]; 46 | } 47 | return _root; 48 | } 49 | 50 | 51 | //-(NSArray *)root 52 | //{ 53 | // if (!_root) 54 | // { 55 | // _root = @[ 56 | // @{ 57 | // kSectionTitleKey : @"Views", 58 | // kModulesKey : @[ 59 | // @{ 60 | // kModuleNameKey : @"Form", 61 | // kModuleRouterNameKey : NSStringFromClass([JRTFormRouter class]) 62 | // } 63 | // 64 | // ] 65 | // }, 66 | // @{ 67 | // kSectionTitleKey : @"Integrations", 68 | // kModulesKey : @[ 69 | // @{ 70 | // kModuleNameKey : @"Contacts", 71 | // kModuleRouterNameKey : NSStringFromClass([JRTContactsRouter class]) 72 | // } 73 | // 74 | // ] 75 | // }, 76 | // @{ 77 | // kSectionTitleKey : @"Utilities", 78 | // kModulesKey : @[ 79 | // @{ 80 | // kModuleNameKey : @"Alert", 81 | // kModuleRouterNameKey : NSStringFromClass([JRTAlertRouter class]) 82 | // } 83 | // 84 | // ] 85 | // } 86 | // ]; 87 | // } 88 | // return _root; 89 | //} 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Interactor/JRTIndexInteractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexInteractor.h 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | #import "JRTViperInteractorClass.h" 11 | @class JRTIndexEntity; 12 | 13 | @interface JRTIndexInteractor : JRTViperInteractorClass 14 | - (JRTIndexEntity *)newIndexEntity; 15 | @end 16 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Interactor/JRTIndexInteractor.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexInteractor.m 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "JRTIndexInteractor.h" 10 | #import "JRTIndexEntity.h" 11 | 12 | @interface JRTIndexInteractor () 13 | 14 | @end 15 | 16 | @implementation JRTIndexInteractor 17 | 18 | - (JRTIndexEntity *)newIndexEntity 19 | { 20 | return [JRTIndexEntity new]; 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Presenter/JRTIndexPresenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexPresenter.h 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | #import "JRTViperPresenterClass.h" 11 | 12 | @interface JRTIndexPresenter : JRTViperPresenterClass 13 | - (NSInteger)numberOfSectionsInTableView; 14 | - (NSInteger)numberOfRowsInSection:(NSInteger)index; 15 | - (NSString *)titleForHeaderInSection:(NSInteger)index; 16 | - (NSString *)demoNameForIndexPath:(NSIndexPath *)indexPath; 17 | - (void)showDemorAtIndexPath:(NSIndexPath *)indexPath; 18 | @end 19 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Presenter/JRTIndexPresenter.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexPresenter.m 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "JRTIndexPresenter.h" 10 | #import "JRTIndexInteractor.h" 11 | #import "JRTIndexEntity.h" 12 | #import "JRTIndexViewController.h" 13 | 14 | @interface JRTIndexPresenter() 15 | @property (nonatomic, readonly) JRTIndexInteractor *indexInteractor; 16 | @property (nonatomic, readonly) JRTIndexViewController *indexTableViewController; 17 | @property (nonatomic, strong ) JRTIndexEntity *entity; 18 | 19 | @end 20 | 21 | @implementation JRTIndexPresenter 22 | 23 | - (void)loadFromInteractor 24 | { 25 | self.entity = [self.indexInteractor newIndexEntity]; 26 | } 27 | 28 | #pragma mark - Getters 29 | 30 | - (JRTIndexEntity *)entity 31 | { 32 | if (!_entity) 33 | { 34 | _entity = [self.indexInteractor newIndexEntity]; 35 | } 36 | return _entity; 37 | } 38 | 39 | -(JRTIndexInteractor *)indexInteractor 40 | { 41 | return (JRTIndexInteractor *) self.interactor; 42 | } 43 | 44 | -(JRTIndexViewController *)indexTableViewController 45 | { 46 | return (JRTIndexViewController *)self.viewController; 47 | } 48 | 49 | #pragma mark - PublicsMethods 50 | 51 | - (NSInteger)numberOfSectionsInTableView 52 | { 53 | return [self.entity.root count]; 54 | } 55 | 56 | - (NSInteger)numberOfRowsInSection:(NSInteger)index 57 | { 58 | NSDictionary * section = [self sectionForIndex:index]; 59 | NSArray * routers = [self demosOfSection:section]; 60 | return [routers count]; 61 | } 62 | 63 | -(NSString *)titleForHeaderInSection:(NSInteger)index 64 | { 65 | NSDictionary * section = [self sectionForIndex:index]; 66 | return [self titleOfSection:section]; 67 | } 68 | 69 | -(NSString *)demoNameForIndexPath:(NSIndexPath *)indexPath 70 | { 71 | NSDictionary *demo = [self demoForIndexPath:indexPath]; 72 | return [demo objectForKey:kModuleNameKey]; 73 | } 74 | 75 | -(NSString *)demoRouterNameForIndexPath:(NSIndexPath *)indexPath 76 | { 77 | NSDictionary *demo = [self demoForIndexPath:indexPath]; 78 | return [demo objectForKey:kModuleRouterNameKey]; 79 | } 80 | 81 | - (void)showDemorAtIndexPath:(NSIndexPath *)indexPath 82 | { 83 | NSString * routerName = [self demoRouterNameForIndexPath:indexPath]; 84 | id nextRouter = [[NSClassFromString(routerName) alloc] init]; 85 | [nextRouter pushInNavigationController:self.indexTableViewController.navigationController animated:YES]; 86 | } 87 | 88 | #pragma mark - Helpers 89 | 90 | - (NSDictionary *)sectionForIndex:(NSInteger)index 91 | { 92 | NSDictionary * section; 93 | id sectionObject = [self.entity.root objectAtIndex:index]; 94 | if ([sectionObject isKindOfClass:[NSDictionary class]]) 95 | { 96 | section = sectionObject; 97 | } 98 | else 99 | { 100 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"%@", self.class] 101 | reason:[NSString stringWithFormat:@"%@, %@ must contain objects of type NSDictionary in root property",NSStringFromSelector(_cmd), self.entity.class] 102 | userInfo:nil]; 103 | } 104 | return section; 105 | } 106 | 107 | - (NSArray *)demosOfSection:(NSDictionary *)section 108 | { 109 | NSArray * routers; 110 | id routersObject = [section objectForKey:kModulesKey]; 111 | if ([routersObject isKindOfClass:[NSArray class]]) 112 | { 113 | routers = routersObject; 114 | } 115 | else 116 | { 117 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"%@", self.class] 118 | reason:[NSString stringWithFormat:@"%@, kRoutersKey value must be a NSArray within each NSDictionary in “root” property of %@", NSStringFromSelector(_cmd), self.entity.class] 119 | userInfo:nil]; 120 | } 121 | return routers; 122 | } 123 | 124 | - (NSDictionary *)demoForIndexPath:(NSIndexPath *)indexPath 125 | { 126 | NSDictionary *demo; 127 | NSDictionary * section = [self sectionForIndex:indexPath.section]; 128 | NSArray * demos = [self demosOfSection:section]; 129 | id demoObject = [demos objectAtIndex:indexPath.row]; 130 | if ([demoObject isKindOfClass:[NSDictionary class]]) 131 | { 132 | demo = demoObject; 133 | } 134 | else 135 | { 136 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"%@", self.class] 137 | reason:[NSString stringWithFormat:@"%@, demos of section must contain objects of type NSDictionary in Array", NSStringFromSelector(_cmd)] 138 | userInfo:nil]; 139 | } 140 | 141 | return demo; 142 | } 143 | 144 | - (NSString *)titleOfSection:(NSDictionary *)section 145 | { 146 | NSString * title; 147 | id titleObject = [section objectForKey:kSectionTitleKey]; 148 | if ([titleObject isKindOfClass:[NSString class]]) 149 | { 150 | title = titleObject; 151 | } 152 | else 153 | { 154 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"%@", self.class] 155 | reason:[NSString stringWithFormat:@"%@, kTitleKey value must be a NSString within each NSDictionary in “root” property of %@", NSStringFromSelector(_cmd), self.entity.class] 156 | userInfo:nil]; 157 | } 158 | return title; 159 | } 160 | 161 | @end 162 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Router/JRTIndexRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexInteractor.h 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | #import "JRTViperRouterClass.h" 11 | @interface JRTIndexRouter : JRTViperRouterClass; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/Router/JRTIndexRouter.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexInteractor.m 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "JRTIndexRouter.h" 10 | 11 | @implementation JRTIndexRouter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/View/JRTIndexViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexTableViewController.h 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "JRTViperTableViewControllerClass.h" 11 | 12 | @interface JRTIndexViewController : JRTViperTableViewControllerClass 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/View/JRTIndexViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTIndexTableViewController.m 3 | // JertiObjectiveCDemo 4 | // 5 | // Created by Juan Garcia on 13/5/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "JRTIndexViewController.h" 10 | #import "JRTIndexPresenter.h" 11 | 12 | 13 | @interface JRTIndexViewController () 14 | @property (nonatomic, readonly) JRTIndexPresenter *indexPresenter; 15 | @end 16 | 17 | @implementation JRTIndexViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | self.title = @"Index"; 23 | } 24 | 25 | #pragma mark - Getters 26 | 27 | - (JRTIndexPresenter *)indexPresenter 28 | { 29 | return (JRTIndexPresenter *)self.presenter; 30 | } 31 | 32 | #pragma mark - Table view data source 33 | 34 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 35 | { 36 | return [self.indexPresenter numberOfSectionsInTableView]; 37 | } 38 | 39 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 40 | { 41 | return [self.indexPresenter numberOfRowsInSection:section]; 42 | } 43 | 44 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 45 | { 46 | static NSString *cellIdentifier = @"classCell"; 47 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 48 | if (cell == nil) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 49 | cell.textLabel.text = [self.indexPresenter demoNameForIndexPath:indexPath]; 50 | return cell; 51 | } 52 | 53 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 54 | { 55 | [self.indexPresenter showDemorAtIndexPath:indexPath]; 56 | } 57 | 58 | 59 | -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 60 | { 61 | return [self.indexPresenter titleForHeaderInSection:section]; 62 | } 63 | 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Index/View/JRTIndexViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jerti.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemEntity.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemEntity.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperEntityClass.h" 11 | @interface ItemEntity : JRTViperEntityClass 12 | @property (nonatomic ) NSInteger uid; 13 | @property (nonatomic, strong) NSString *name; 14 | @property (nonatomic, strong) NSString *about; 15 | @end 16 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemEntity.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemEntity.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ItemEntity.h" 10 | 11 | @implementation ItemEntity 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemInteractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemInteractor.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperInteractorClass.h" 11 | #import "ItemEntity.h" 12 | 13 | @interface ItemInteractor : JRTViperInteractorClass 14 | - (ItemEntity *)readItem; 15 | @end 16 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemInteractor.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemInteractor.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ItemInteractor.h" 10 | 11 | @implementation ItemInteractor 12 | - (ItemEntity *)readItem 13 | { 14 | // Usually entities are obtained from a content provider, 15 | // but this example is only about viper 16 | 17 | ItemEntity *itemEntity = [ItemEntity new]; 18 | itemEntity.uid = 8; 19 | itemEntity.name = @"abc"; 20 | itemEntity.about = @"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."; 21 | return itemEntity; 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemPresenter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemPresenter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperPresenterClass.h" 11 | @interface ItemPresenter : JRTViperPresenterClass 12 | - (NSString *)itemId; 13 | - (NSString *)itemName; 14 | - (NSString *)itemDescription; 15 | @end 16 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemPresenter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemPresenter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ItemPresenter.h" 10 | #import "ItemEntity.h" 11 | #import "ItemInteractor.h" 12 | @interface ItemPresenter () 13 | @property (nonatomic, readonly)ItemInteractor *itemInteractor; 14 | @property (nonatomic, strong) ItemEntity *itemEntity; 15 | 16 | @end 17 | 18 | @implementation ItemPresenter 19 | 20 | - (ItemInteractor *)itemInteractor 21 | { 22 | return (ItemInteractor *)self.interactor; 23 | } 24 | 25 | -(ItemEntity *)itemEntity 26 | { 27 | if (!_itemEntity) 28 | { 29 | _itemEntity = [self.itemInteractor readItem]; 30 | } 31 | return _itemEntity; 32 | } 33 | 34 | - (NSString *)itemId 35 | { 36 | return [NSString stringWithFormat:@"[%li]",(long)self.itemEntity.uid]; 37 | } 38 | 39 | - (NSString *)itemName 40 | { 41 | return [self.itemEntity.name capitalizedString]; 42 | } 43 | 44 | - (NSString *)itemDescription 45 | { 46 | return [NSString stringWithFormat:@"%@ +",self.itemEntity.about]; 47 | } 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemRouter.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperRouterClass.h" 11 | @interface ItemRouter : JRTViperRouterClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemRouter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemRouter.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ItemRouter.h" 10 | 11 | @implementation ItemRouter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ItemViewController.h 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JRTViperViewControllerClass.h" 11 | @interface ItemViewController : JRTViperViewControllerClass 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ItemViewController.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 8/19/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import "ItemViewController.h" 10 | #import "ItemPresenter.h" 11 | 12 | @interface ItemViewController () 13 | @property (weak, nonatomic ) IBOutlet UILabel *itemIdLabel; 14 | @property (weak, nonatomic ) IBOutlet UILabel *itemNameLabel; 15 | @property (weak, nonatomic ) IBOutlet UILabel *itemDescriptionLabel; 16 | @property (nonatomic, readonly) ItemPresenter *itemPresenter; 17 | @end 18 | 19 | @implementation ItemViewController 20 | 21 | - (ItemPresenter *)itemPresenter 22 | { 23 | return (ItemPresenter *)self.presenter; 24 | } 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | self.title = @"Item"; 30 | self.itemIdLabel.text = [self.itemPresenter itemId]; 31 | self.itemNameLabel.text = [self.itemPresenter itemName]; 32 | self.itemDescriptionLabel.text = [self.itemPresenter itemDescription]; 33 | } 34 | 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/ItemViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 32 | 38 | 44 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/JRTMainRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // JRTMainRouter.h 3 | // 4 | // 5 | // Created by Juan Garcia on 31/3/15. 6 | // Copyright (c) 2015 Jerti LLC. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface JRTMainRouter : NSObject 12 | - (id)rootViewController; 13 | @end 14 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/JRTMainRouter.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTMainRouter.m 3 | // 4 | // 5 | // Created by Juan Garcia on 31/3/15. 6 | // Copyright (c) 2015 Jerti LLC. All rights reserved. 7 | // 8 | 9 | #import "JRTMainRouter.h" 10 | #import "JRTViperRouterProtocol.h" 11 | 12 | 13 | NSString * const kInitialRouter = @"JRTIndexRouter"; 14 | 15 | @interface JRTMainRouter () 16 | @property (nonatomic, strong) UINavigationController *mainNavigationController; 17 | @property (nonatomic, strong) id initialRouter; 18 | @end 19 | 20 | @implementation JRTMainRouter 21 | 22 | - (UINavigationController *)mainNavigationController 23 | { 24 | if (!_mainNavigationController) 25 | { 26 | _mainNavigationController = [UINavigationController new]; 27 | _mainNavigationController.navigationBar.translucent = NO; 28 | [self.initialRouter pushInNavigationController:_mainNavigationController animated:NO]; 29 | } 30 | return _mainNavigationController; 31 | } 32 | 33 | -(id)initialRouter 34 | { 35 | if (!_initialRouter) _initialRouter = [[NSClassFromString(kInitialRouter) alloc] init]; 36 | return _initialRouter; 37 | } 38 | 39 | - (id)rootViewController 40 | { 41 | return self.mainNavigationController; 42 | } 43 | 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViper.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | //View 22 | #import "JRTViperTabBarController.h" 23 | #import "JRTViperTableViewControllerClass.h" 24 | #import "JRTViperViewControllerClass.h" 25 | //Interactor 26 | #import "JRTViperInteractorClass.h" 27 | //Presenter 28 | #import "JRTViperPresenterClass.h" 29 | //Entity 30 | #import "JRTViperEntityClass.h" 31 | //Router 32 | #import "JRTViperRouterClass.h" -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperEntityClass.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import Foundation; 22 | #import "JRTViperEntityProtocol.h" 23 | @interface JRTViperEntityClass : NSObject 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperEntityClass.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperEntityClass.h" 22 | 23 | @implementation JRTViperEntityClass 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperEntityProtocol.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import Foundation; 22 | 23 | @protocol EntityProtocol 24 | 25 | @end -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperInteractorClass.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import Foundation; 22 | #import "JRTViperInteractorProtocol.h" 23 | @interface JRTViperInteractorClass : NSObject 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperInteractorClass.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperInteractorClass.h" 22 | 23 | @implementation JRTViperInteractorClass 24 | 25 | @synthesize presenter = _presenter; 26 | 27 | #pragma mark - Getters 28 | 29 | -(id)presenter 30 | { 31 | if (!_presenter) 32 | { 33 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"%@", self.class] 34 | reason:[NSString stringWithFormat:@"%@, the presenter should set himself into this property", NSStringFromSelector(_cmd)] 35 | userInfo:nil]; 36 | } 37 | return _presenter; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperInteractorProtocol.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | 22 | @import Foundation; 23 | #import "JRTViperPresenterProtocol.h" 24 | 25 | @protocol InteractorProtocol 26 | @property (weak, nonatomic) id presenter; 27 | @end -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperPresenterClass.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import Foundation; 22 | #import "JRTViperPresenterProtocol.h" 23 | 24 | @interface JRTViperPresenterClass : NSObject 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperPresenterClass.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperPresenterClass.h" 22 | #import "JRTViperInteractorProtocol.h" 23 | 24 | @interface JRTViperPresenterClass() 25 | @end 26 | 27 | @implementation JRTViperPresenterClass 28 | #pragma mark - Synthesize 29 | 30 | @synthesize viewController = _viewController; 31 | @synthesize interactor = _interactor; 32 | @synthesize router = _router; 33 | 34 | #pragma mark - Init 35 | 36 | -(instancetype)init 37 | { 38 | if (self = [super init]) 39 | { 40 | [self commonInit]; 41 | } 42 | return self; 43 | } 44 | 45 | - (void)commonInit 46 | { 47 | self.interactor.presenter = self; 48 | } 49 | 50 | -(void)setInteractor:(id)interactor 51 | { 52 | _interactor = interactor; 53 | _interactor.presenter = self; 54 | } 55 | 56 | #pragma mark - Getters 57 | 58 | -(id)viewController 59 | { 60 | if (!_viewController) 61 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 62 | reason:[NSString stringWithFormat:@"the Router set nil in %@ property", NSStringFromSelector(_cmd)] 63 | userInfo:nil]; 64 | return _viewController; 65 | } 66 | 67 | -(id)router 68 | { 69 | if (!_router) 70 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"%@", self.class] 71 | reason:[NSString stringWithFormat:@"%@, the Router should set himself into this property", NSStringFromSelector(_cmd)] 72 | userInfo:nil]; 73 | return _router; 74 | } 75 | 76 | #pragma mark - Abstract 77 | 78 | -(id)interactor 79 | { 80 | if (!_interactor) 81 | { 82 | _interactor = [[NSClassFromString([self interactorClassName]) alloc] init]; 83 | 84 | if (!_interactor) 85 | { 86 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 87 | reason:[NSString stringWithFormat:@"%@ it does not exist, %@ don’t have an implementation of %@", [self interactorClassName], self.class, NSStringFromSelector(_cmd)] 88 | userInfo:nil]; 89 | } 90 | else 91 | { 92 | _interactor.presenter = self; 93 | } 94 | } 95 | return _interactor; 96 | } 97 | 98 | #pragma mark - Class Name Helpers 99 | 100 | - (NSString *)abstractClassName 101 | { 102 | NSString *className = NSStringFromClass([self class]); 103 | className = [className stringByReplacingOccurrencesOfString:@"Presenter" withString:@""]; 104 | return className; 105 | } 106 | 107 | 108 | - (NSString *)interactorClassName 109 | { 110 | return [NSString stringWithFormat:@"%@%@", [self abstractClassName], @"Interactor"]; 111 | } 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperPresenterProtocol.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import UIKit; 22 | 23 | #pragma mark - External Protocol 24 | 25 | #import "JRTViperViewProtocol.h" 26 | #import "JRTViperRouterProtocol.h" 27 | @protocol InteractorProtocol; 28 | 29 | @protocol PresenterProtocol 30 | @property (weak, nonatomic) id viewController; 31 | @property (strong, nonatomic) id interactor; 32 | @property (strong, nonatomic) id router; 33 | @end -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperRouterClass.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import Foundation; 22 | #import "JRTViperRouterProtocol.h" 23 | 24 | @interface JRTViperRouterClass : NSObject 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperRouterClass.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperRouterClass.h" 22 | #import "JRTViperPresenterProtocol.h" 23 | #import "JRTViperViewProtocol.h" 24 | 25 | @interface JRTViperRouterClass() 26 | 27 | @end 28 | 29 | @implementation JRTViperRouterClass 30 | 31 | #pragma mark - Synthesize 32 | 33 | @synthesize presenter = _presenter; 34 | 35 | #pragma mark - Public 36 | 37 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated 38 | { 39 | [navigationController pushViewController: [self viewController] animated:animated]; 40 | } 41 | 42 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated withInteractor:(id)interactor 43 | { 44 | UIViewController * viewController = (UIViewController *) [self viewController]; 45 | viewController.presenter.interactor = interactor; 46 | [navigationController pushViewController: viewController animated:animated]; 47 | } 48 | 49 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated andSetPresenterPropertyNamed:(NSString *)propertyName withObject:(id)object 50 | { 51 | UIViewController * viewController = (UIViewController *) [self viewController]; 52 | NSObject *presenter = (NSObject *)viewController.presenter; 53 | 54 | NSRange range = NSMakeRange(0, 1); 55 | NSString *firstCharacter = [propertyName substringWithRange:range]; 56 | NSString *capitalizedName = [propertyName stringByReplacingCharactersInRange:range withString:[firstCharacter uppercaseString]]; 57 | NSString *selectorString = [NSString stringWithFormat:@"set%@:", capitalizedName]; 58 | SEL selector = NSSelectorFromString(selectorString); 59 | if ([presenter respondsToSelector:selector]) 60 | { 61 | #pragma clang diagnostic push 62 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 63 | [presenter performSelector:selector withObject:object]; 64 | #pragma clang diagnostic pop 65 | } 66 | else 67 | { 68 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 69 | reason:[NSString stringWithFormat:@"%@ Class must respont to selector %@", [self presenterClassName], selectorString] 70 | userInfo:nil]; 71 | } 72 | [navigationController pushViewController: viewController animated:animated]; 73 | } 74 | 75 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated andPresenterPerformSelector:(SEL)selector withObject:(id)object 76 | { 77 | UIViewController * viewController = (UIViewController *) [self viewController]; 78 | NSObject *presenter = (NSObject *)viewController.presenter; 79 | if ([presenter respondsToSelector:selector]) 80 | { 81 | #pragma clang diagnostic push 82 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 83 | [presenter performSelector:selector withObject:object]; 84 | #pragma clang diagnostic pop 85 | } 86 | else 87 | { 88 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 89 | reason:[NSString stringWithFormat:@"%@ Class must respont to selector", [self presenterClassName]] 90 | userInfo:nil]; 91 | } 92 | [navigationController pushViewController: viewController animated:animated]; 93 | } 94 | 95 | - (void)popViewControllerAnimnated:(BOOL)animated 96 | { 97 | [((UIViewController *)self.presenter.viewController).navigationController popViewControllerAnimated:animated]; 98 | } 99 | 100 | - (void)popViewControllerAnimnated:(BOOL)animated withInteractor:(id)interactor 101 | { 102 | [self setPreviousInteractor:interactor inNavigationController:((UIViewController *)self.presenter.viewController).navigationController]; 103 | [self popViewControllerAnimnated:animated]; 104 | } 105 | 106 | - (void)setPreviousInteractor:(id)interactor inNavigationController:(UINavigationController*)navigationController 107 | { 108 | NSUInteger indexOfViewController = [navigationController.viewControllers indexOfObject:self.presenter.viewController]; 109 | id previousViewController = [navigationController.viewControllers objectAtIndex:indexOfViewController-1]; 110 | id previousPresenter = previousViewController.presenter; 111 | previousPresenter.interactor = interactor; 112 | } 113 | 114 | #pragma mark - Abstract 115 | 116 | - (UIViewController *)viewController 117 | { 118 | if (!_presenter) 119 | { 120 | id viewController = [[NSClassFromString([self viewControllerClassName]) alloc] init]; 121 | if (!viewController) 122 | { 123 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 124 | reason:[NSString stringWithFormat:@"%@ Class return nil for %@", [self viewControllerClassName], NSStringFromSelector(_cmd)] 125 | userInfo:nil]; 126 | } 127 | 128 | id presenter = [[NSClassFromString([self presenterClassName]) alloc] init]; 129 | if (!presenter) 130 | { 131 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 132 | reason:[NSString stringWithFormat:@"%@ Class return nil for %@", [self presenterClassName], NSStringFromSelector(_cmd)] 133 | userInfo:nil]; 134 | } 135 | viewController.presenter = presenter; 136 | presenter.viewController = viewController; 137 | presenter.router = self; 138 | self.presenter = presenter; 139 | return (UIViewController *)viewController; 140 | } 141 | else 142 | { 143 | return (UIViewController *)self.presenter.viewController; 144 | } 145 | } 146 | 147 | 148 | 149 | #pragma mark - Class Name Helpers 150 | 151 | - (NSString *)abstractClassName 152 | { 153 | NSString *className = NSStringFromClass([self class]); 154 | className = [className stringByReplacingOccurrencesOfString:@"Router" withString:@""]; 155 | return className; 156 | } 157 | 158 | 159 | - (NSString *)viewControllerClassName 160 | { 161 | return [NSString stringWithFormat:@"%@%@", [self abstractClassName], @"ViewController"]; 162 | } 163 | 164 | - (NSString *)presenterClassName 165 | { 166 | return [NSString stringWithFormat:@"%@%@", [self abstractClassName], @"Presenter"]; 167 | } 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperRouterProtocol.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import UIKit; 22 | @protocol ViewProtocol; 23 | @protocol PresenterProtocol; 24 | @protocol InteractorProtocol; 25 | 26 | @protocol RouterProtocol 27 | 28 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated; 29 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated withInteractor:(id)interactor; 30 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated andPresenterPerformSelector:(SEL)selector withObject:(id)object; 31 | - (void)pushInNavigationController:(UINavigationController*)navigationController animated:(BOOL)animated andSetPresenterPropertyNamed:(NSString *)propertyName withObject:(id)object; 32 | - (void)popViewControllerAnimnated:(BOOL)animated; 33 | - (void)popViewControllerAnimnated:(BOOL)animated withInteractor:(id)interactor; 34 | - (void)setPreviousInteractor:(id)interactor inNavigationController:(UINavigationController*)navigationController; 35 | - (UIViewController *)viewController; 36 | 37 | @property (weak, nonatomic) id presenter; 38 | 39 | @end -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperTabBarController.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import UIKit; 22 | #import "JRTViperViewProtocol.h" 23 | 24 | @interface JRTViperTabBarController : UITabBarController 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperTabBarController.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperTabBarController.h" 22 | 23 | @interface JRTViperTabBarController () 24 | 25 | @end 26 | 27 | @implementation JRTViperTabBarController 28 | 29 | @synthesize presenter =_presenter; 30 | 31 | #pragma mark - Getters 32 | 33 | -(id)presenter 34 | { 35 | if (!_presenter) 36 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 37 | reason:[NSString stringWithFormat:@"the Router set nil in %@ property", NSStringFromSelector(_cmd)] 38 | userInfo:nil]; 39 | return _presenter; 40 | } 41 | @end 42 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperTableViewControllerClass.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import UIKit; 22 | #import "JRTViperViewProtocol.h" 23 | 24 | @interface JRTViperTableViewControllerClass : UITableViewController 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperTableViewControllerClass.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperTableViewControllerClass.h" 22 | 23 | @interface JRTViperTableViewControllerClass () 24 | 25 | @end 26 | 27 | @implementation JRTViperTableViewControllerClass 28 | 29 | 30 | @synthesize presenter =_presenter; 31 | 32 | #pragma mark - Getters 33 | 34 | -(id)presenter 35 | { 36 | if (!_presenter) 37 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 38 | reason:[NSString stringWithFormat:@"the Router set nil in %@ property", NSStringFromSelector(_cmd)] 39 | userInfo:nil]; 40 | return _presenter; 41 | } 42 | 43 | 44 | #pragma mark - Abstract Table view data source 45 | 46 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 47 | { 48 | // Return the number of sections. 49 | return 0; 50 | } 51 | 52 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 53 | { 54 | // Return the number of rows in the section. 55 | return 0; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperViewControllerClass.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import UIKit; 22 | #import "JRTViperViewProtocol.h" 23 | 24 | @interface JRTViperViewControllerClass : UIViewController 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperViewControllerClass.m: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | #import "JRTViperViewControllerClass.h" 22 | 23 | @interface JRTViperViewControllerClass () 24 | 25 | @end 26 | 27 | @implementation JRTViperViewControllerClass 28 | 29 | @synthesize presenter =_presenter; 30 | 31 | #pragma mark - Getters 32 | 33 | -(id)presenter 34 | { 35 | if (!_presenter) 36 | @throw [[NSException alloc] initWithName:[NSString stringWithFormat:@"Abstract %@", self.class] 37 | reason:[NSString stringWithFormat:@"the Router set nil in %@ property", NSStringFromSelector(_cmd)] 38 | userInfo:nil]; 39 | return _presenter; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/PodFiles/JRTViperViewProtocol.h: -------------------------------------------------------------------------------- 1 | //Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | // 3 | //Permission is hereby granted, free of charge, to any person obtaining a copy 4 | //of this software and associated documentation files (the "Software"), to deal 5 | //in the Software without restriction, including without limitation the rights 6 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | //copies of the Software, and to permit persons to whom the Software is 8 | //furnished to do so, subject to the following conditions: 9 | // 10 | //The above copyright notice and this permission notice shall be included in 11 | //all copies or substantial portions of the Software. 12 | // 13 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | //THE SOFTWARE. 20 | 21 | @import UIKit; 22 | @protocol PresenterProtocol; 23 | 24 | @protocol ViewProtocol 25 | 26 | @property (strong, nonatomic) id presenter; 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /JRTViper/JRTViper/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JRTViper 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /JRTViper/JRTViperTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.jerti.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /JRTViper/JRTViperTests/JRTViperTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JRTViperTests.m 3 | // JRTViperTests 4 | // 5 | // Created by Juan Garcia on 7/30/15. 6 | // Copyright (c) 2015 Juan Garcia. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface JRTViperTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation JRTViperTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JRTViperPattern.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "JRTViperPattern" 3 | s.version = "0.1.5" 4 | s.summary = "JRTViperPattern super classes to work in VIPER pattern" 5 | s.homepage = "https://github.com/ifobos/JRTViperPattern" 6 | s.license = "MIT" 7 | s.author = { "ifobos" => "juancarlos.garcia.alfaro@gmail.com" } 8 | s.platform = :ios, "8.0" 9 | s.source = { :git => "https://github.com/ifobos/JRTViperPattern.git", :tag => "0.1.5" } 10 | s.source_files = "JRTViper/JRTViper/PodFiles/*.{h,m}" 11 | s.requires_arc = true 12 | end 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Juan Carlos Garcia Alfaro. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JRTViperPattern 2 | 3 | Installation 4 | ------------- 5 | 6 | ####Cocoapod Method:- 7 | **JRTViperPattern** is available through CocoaPods, to install it simply add the following line to your Podfile: 8 | 9 | >pod 'JRTViperPattern' 10 | 11 | ####Source Code Method:- 12 | Just drag and drop **JRTViperPattern** directory from demo project to your project. That's it. 13 | 14 | --------------------------------------------------------------------------------