├── GWLZCDM.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── cAibDe.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── GWLZCDM.xcscheme │ └── xcschememanagement.plist ├── GWLZCDM ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CaibdeAnimation.h ├── CaibdeAnimation.m ├── CaibdeCollectionViewCell.h ├── CaibdeCollectionViewCell.m ├── CaibdeNavController.h ├── CaibdeNavController.m ├── CaibdeSeatController.h ├── CaibdeSeatController.m ├── FilmModel.h ├── FilmModel.m ├── FilmViewController.h ├── FilmViewController.m ├── Info.plist ├── Lib │ ├── MBProgressHUD.h │ ├── MBProgressHUD.m │ └── MJExtension │ │ ├── Info.plist │ │ ├── MJExtension.h │ │ ├── MJExtensionConst.h │ │ ├── MJExtensionConst.m │ │ ├── MJFoundation.h │ │ ├── MJFoundation.m │ │ ├── MJProperty.h │ │ ├── MJProperty.m │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyKey.m │ │ ├── MJPropertyType.h │ │ ├── MJPropertyType.m │ │ ├── NSObject+MJClass.h │ │ ├── NSObject+MJClass.m │ │ ├── NSObject+MJCoding.h │ │ ├── NSObject+MJCoding.m │ │ ├── NSObject+MJKeyValue.h │ │ ├── NSObject+MJKeyValue.m │ │ ├── NSObject+MJProperty.h │ │ ├── NSObject+MJProperty.m │ │ ├── NSString+MJExtension.h │ │ └── NSString+MJExtension.m ├── Resouce │ ├── seats 0.plist │ ├── seats 1.plist │ ├── seats 2.plist │ ├── seats 3.plist │ └── seats 4.plist ├── ViewController.h ├── ViewController.m ├── images │ ├── 1.jpg │ ├── 10.jpg │ ├── 11.jpg │ ├── 12.jpg │ ├── 13.jpg │ ├── 14.jpg │ ├── 15.jpg │ ├── 2.jpg │ ├── 3.jpg │ ├── 4.jpg │ ├── 5.jpg │ ├── 6.jpg │ ├── 7.jpg │ ├── 8.jpg │ ├── 9.jpg │ ├── bg1.png │ ├── c1.jpg │ ├── c10.jpg │ ├── c11.jpg │ ├── c12.jpg │ ├── c13.jpg │ ├── c14.jpg │ ├── c15.jpg │ ├── c2.jpg │ ├── c3.jpg │ ├── c4.jpg │ ├── c5.jpg │ ├── c6.jpg │ ├── c7.jpg │ ├── c8.jpg │ ├── c9.jpg │ └── close.png └── main.m ├── GWLZCDMTests ├── GWLZCDMTests.m └── Info.plist ├── GWLZCDMUITests ├── GWLZCDMUITests.m └── Info.plist └── README.md /GWLZCDM.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9A5A55301D6D4D400021C3F6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A552F1D6D4D400021C3F6 /* main.m */; }; 11 | 9A5A55331D6D4D400021C3F6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A55321D6D4D400021C3F6 /* AppDelegate.m */; }; 12 | 9A5A55361D6D4D400021C3F6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A55351D6D4D400021C3F6 /* ViewController.m */; }; 13 | 9A5A55391D6D4D400021C3F6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A5A55371D6D4D400021C3F6 /* Main.storyboard */; }; 14 | 9A5A553B1D6D4D400021C3F6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A5A553A1D6D4D400021C3F6 /* Assets.xcassets */; }; 15 | 9A5A553E1D6D4D400021C3F6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A5A553C1D6D4D400021C3F6 /* LaunchScreen.storyboard */; }; 16 | 9A5A55491D6D4D400021C3F6 /* GWLZCDMTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A55481D6D4D400021C3F6 /* GWLZCDMTests.m */; }; 17 | 9A5A55541D6D4D400021C3F6 /* GWLZCDMUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A55531D6D4D400021C3F6 /* GWLZCDMUITests.m */; }; 18 | 9A5A55631D6D4DBD0021C3F6 /* CaibdeNavController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A55621D6D4DBD0021C3F6 /* CaibdeNavController.m */; }; 19 | 9A5A55661D6D4DD60021C3F6 /* CaibdeAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A55651D6D4DD60021C3F6 /* CaibdeAnimation.m */; }; 20 | 9AA08F521D6ED1AB00F95073 /* seats 0.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AA08F4D1D6ED1AB00F95073 /* seats 0.plist */; }; 21 | 9AA08F531D6ED1AB00F95073 /* seats 1.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AA08F4E1D6ED1AB00F95073 /* seats 1.plist */; }; 22 | 9AA08F541D6ED1AB00F95073 /* seats 2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AA08F4F1D6ED1AB00F95073 /* seats 2.plist */; }; 23 | 9AA08F551D6ED1AB00F95073 /* seats 3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AA08F501D6ED1AB00F95073 /* seats 3.plist */; }; 24 | 9AA08F561D6ED1AB00F95073 /* seats 4.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AA08F511D6ED1AB00F95073 /* seats 4.plist */; }; 25 | 9AD997181D6D8967000926BF /* 1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996F81D6D8967000926BF /* 1.jpg */; }; 26 | 9AD997191D6D8967000926BF /* 10.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996F91D6D8967000926BF /* 10.jpg */; }; 27 | 9AD9971A1D6D8967000926BF /* 11.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996FA1D6D8967000926BF /* 11.jpg */; }; 28 | 9AD9971B1D6D8967000926BF /* 12.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996FB1D6D8967000926BF /* 12.jpg */; }; 29 | 9AD9971C1D6D8967000926BF /* 13.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996FC1D6D8967000926BF /* 13.jpg */; }; 30 | 9AD9971D1D6D8967000926BF /* 14.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996FD1D6D8967000926BF /* 14.jpg */; }; 31 | 9AD9971E1D6D8967000926BF /* 15.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996FE1D6D8967000926BF /* 15.jpg */; }; 32 | 9AD9971F1D6D8967000926BF /* 2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD996FF1D6D8967000926BF /* 2.jpg */; }; 33 | 9AD997201D6D8967000926BF /* 3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997001D6D8967000926BF /* 3.jpg */; }; 34 | 9AD997211D6D8967000926BF /* 4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997011D6D8967000926BF /* 4.jpg */; }; 35 | 9AD997221D6D8967000926BF /* 5.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997021D6D8967000926BF /* 5.jpg */; }; 36 | 9AD997231D6D8967000926BF /* 6.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997031D6D8967000926BF /* 6.jpg */; }; 37 | 9AD997241D6D8967000926BF /* 7.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997041D6D8967000926BF /* 7.jpg */; }; 38 | 9AD997251D6D8967000926BF /* 8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997051D6D8967000926BF /* 8.jpg */; }; 39 | 9AD997261D6D8967000926BF /* 9.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997061D6D8967000926BF /* 9.jpg */; }; 40 | 9AD997271D6D8967000926BF /* bg1.png in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997071D6D8967000926BF /* bg1.png */; }; 41 | 9AD997281D6D8967000926BF /* c1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997081D6D8967000926BF /* c1.jpg */; }; 42 | 9AD997291D6D8967000926BF /* c10.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997091D6D8967000926BF /* c10.jpg */; }; 43 | 9AD9972A1D6D8967000926BF /* c11.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9970A1D6D8967000926BF /* c11.jpg */; }; 44 | 9AD9972B1D6D8967000926BF /* c12.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9970B1D6D8967000926BF /* c12.jpg */; }; 45 | 9AD9972C1D6D8967000926BF /* c13.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9970C1D6D8967000926BF /* c13.jpg */; }; 46 | 9AD9972D1D6D8967000926BF /* c14.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9970D1D6D8967000926BF /* c14.jpg */; }; 47 | 9AD9972E1D6D8967000926BF /* c15.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9970E1D6D8967000926BF /* c15.jpg */; }; 48 | 9AD9972F1D6D8967000926BF /* c2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9970F1D6D8967000926BF /* c2.jpg */; }; 49 | 9AD997301D6D8967000926BF /* c3.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997101D6D8967000926BF /* c3.jpg */; }; 50 | 9AD997311D6D8967000926BF /* c4.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997111D6D8967000926BF /* c4.jpg */; }; 51 | 9AD997321D6D8967000926BF /* c5.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997121D6D8967000926BF /* c5.jpg */; }; 52 | 9AD997331D6D8967000926BF /* c6.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997131D6D8967000926BF /* c6.jpg */; }; 53 | 9AD997341D6D8967000926BF /* c7.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997141D6D8967000926BF /* c7.jpg */; }; 54 | 9AD997351D6D8967000926BF /* c8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997151D6D8967000926BF /* c8.jpg */; }; 55 | 9AD997361D6D8967000926BF /* c9.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997161D6D8967000926BF /* c9.jpg */; }; 56 | 9AD997371D6D8967000926BF /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = 9AD997171D6D8967000926BF /* close.png */; }; 57 | 9AD9973A1D6D9798000926BF /* FilmModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997391D6D9798000926BF /* FilmModel.m */; }; 58 | 9AD9973D1D6E7B5E000926BF /* CaibdeCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9973C1D6E7B5E000926BF /* CaibdeCollectionViewCell.m */; }; 59 | 9AD997401D6E843B000926BF /* FilmViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9973F1D6E843B000926BF /* FilmViewController.m */; }; 60 | 9AD997431D6E9A22000926BF /* CaibdeSeatController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997421D6E9A22000926BF /* CaibdeSeatController.m */; }; 61 | 9AD997641D6EC062000926BF /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9974C1D6EC061000926BF /* MBProgressHUD.m */; }; 62 | 9AD997651D6EC062000926BF /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AD9974E1D6EC061000926BF /* Info.plist */; }; 63 | 9AD997661D6EC062000926BF /* MJExtensionConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997511D6EC061000926BF /* MJExtensionConst.m */; }; 64 | 9AD997671D6EC062000926BF /* MJFoundation.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997531D6EC061000926BF /* MJFoundation.m */; }; 65 | 9AD997681D6EC062000926BF /* MJProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997551D6EC061000926BF /* MJProperty.m */; }; 66 | 9AD997691D6EC062000926BF /* MJPropertyKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997571D6EC061000926BF /* MJPropertyKey.m */; }; 67 | 9AD9976A1D6EC062000926BF /* MJPropertyType.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997591D6EC061000926BF /* MJPropertyType.m */; }; 68 | 9AD9976B1D6EC062000926BF /* NSObject+MJClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9975B1D6EC061000926BF /* NSObject+MJClass.m */; }; 69 | 9AD9976C1D6EC062000926BF /* NSObject+MJCoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9975D1D6EC061000926BF /* NSObject+MJCoding.m */; }; 70 | 9AD9976D1D6EC062000926BF /* NSObject+MJKeyValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9975F1D6EC061000926BF /* NSObject+MJKeyValue.m */; }; 71 | 9AD9976E1D6EC062000926BF /* NSObject+MJProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997611D6EC061000926BF /* NSObject+MJProperty.m */; }; 72 | 9AD9976F1D6EC062000926BF /* NSString+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AD997631D6EC061000926BF /* NSString+MJExtension.m */; }; 73 | /* End PBXBuildFile section */ 74 | 75 | /* Begin PBXContainerItemProxy section */ 76 | 9A5A55451D6D4D400021C3F6 /* PBXContainerItemProxy */ = { 77 | isa = PBXContainerItemProxy; 78 | containerPortal = 9A5A55231D6D4D400021C3F6 /* Project object */; 79 | proxyType = 1; 80 | remoteGlobalIDString = 9A5A552A1D6D4D400021C3F6; 81 | remoteInfo = GWLZCDM; 82 | }; 83 | 9A5A55501D6D4D400021C3F6 /* PBXContainerItemProxy */ = { 84 | isa = PBXContainerItemProxy; 85 | containerPortal = 9A5A55231D6D4D400021C3F6 /* Project object */; 86 | proxyType = 1; 87 | remoteGlobalIDString = 9A5A552A1D6D4D400021C3F6; 88 | remoteInfo = GWLZCDM; 89 | }; 90 | /* End PBXContainerItemProxy section */ 91 | 92 | /* Begin PBXFileReference section */ 93 | 9A5A552B1D6D4D400021C3F6 /* GWLZCDM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GWLZCDM.app; sourceTree = BUILT_PRODUCTS_DIR; }; 94 | 9A5A552F1D6D4D400021C3F6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 95 | 9A5A55311D6D4D400021C3F6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 96 | 9A5A55321D6D4D400021C3F6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 97 | 9A5A55341D6D4D400021C3F6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 98 | 9A5A55351D6D4D400021C3F6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 99 | 9A5A55381D6D4D400021C3F6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 100 | 9A5A553A1D6D4D400021C3F6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 101 | 9A5A553D1D6D4D400021C3F6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 102 | 9A5A553F1D6D4D400021C3F6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 103 | 9A5A55441D6D4D400021C3F6 /* GWLZCDMTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GWLZCDMTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 104 | 9A5A55481D6D4D400021C3F6 /* GWLZCDMTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GWLZCDMTests.m; sourceTree = ""; }; 105 | 9A5A554A1D6D4D400021C3F6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 106 | 9A5A554F1D6D4D400021C3F6 /* GWLZCDMUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GWLZCDMUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 107 | 9A5A55531D6D4D400021C3F6 /* GWLZCDMUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GWLZCDMUITests.m; sourceTree = ""; }; 108 | 9A5A55551D6D4D400021C3F6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 109 | 9A5A55611D6D4DBD0021C3F6 /* CaibdeNavController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaibdeNavController.h; sourceTree = ""; }; 110 | 9A5A55621D6D4DBD0021C3F6 /* CaibdeNavController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CaibdeNavController.m; sourceTree = ""; }; 111 | 9A5A55641D6D4DD60021C3F6 /* CaibdeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaibdeAnimation.h; sourceTree = ""; }; 112 | 9A5A55651D6D4DD60021C3F6 /* CaibdeAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CaibdeAnimation.m; sourceTree = ""; }; 113 | 9AA08F4D1D6ED1AB00F95073 /* seats 0.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "seats 0.plist"; sourceTree = ""; }; 114 | 9AA08F4E1D6ED1AB00F95073 /* seats 1.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "seats 1.plist"; sourceTree = ""; }; 115 | 9AA08F4F1D6ED1AB00F95073 /* seats 2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "seats 2.plist"; sourceTree = ""; }; 116 | 9AA08F501D6ED1AB00F95073 /* seats 3.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "seats 3.plist"; sourceTree = ""; }; 117 | 9AA08F511D6ED1AB00F95073 /* seats 4.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "seats 4.plist"; sourceTree = ""; }; 118 | 9AD996F81D6D8967000926BF /* 1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 1.jpg; sourceTree = ""; }; 119 | 9AD996F91D6D8967000926BF /* 10.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 10.jpg; sourceTree = ""; }; 120 | 9AD996FA1D6D8967000926BF /* 11.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 11.jpg; sourceTree = ""; }; 121 | 9AD996FB1D6D8967000926BF /* 12.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 12.jpg; sourceTree = ""; }; 122 | 9AD996FC1D6D8967000926BF /* 13.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 13.jpg; sourceTree = ""; }; 123 | 9AD996FD1D6D8967000926BF /* 14.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 14.jpg; sourceTree = ""; }; 124 | 9AD996FE1D6D8967000926BF /* 15.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 15.jpg; sourceTree = ""; }; 125 | 9AD996FF1D6D8967000926BF /* 2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 2.jpg; sourceTree = ""; }; 126 | 9AD997001D6D8967000926BF /* 3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 3.jpg; sourceTree = ""; }; 127 | 9AD997011D6D8967000926BF /* 4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 4.jpg; sourceTree = ""; }; 128 | 9AD997021D6D8967000926BF /* 5.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 5.jpg; sourceTree = ""; }; 129 | 9AD997031D6D8967000926BF /* 6.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 6.jpg; sourceTree = ""; }; 130 | 9AD997041D6D8967000926BF /* 7.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 7.jpg; sourceTree = ""; }; 131 | 9AD997051D6D8967000926BF /* 8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 8.jpg; sourceTree = ""; }; 132 | 9AD997061D6D8967000926BF /* 9.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 9.jpg; sourceTree = ""; }; 133 | 9AD997071D6D8967000926BF /* bg1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg1.png; sourceTree = ""; }; 134 | 9AD997081D6D8967000926BF /* c1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c1.jpg; sourceTree = ""; }; 135 | 9AD997091D6D8967000926BF /* c10.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c10.jpg; sourceTree = ""; }; 136 | 9AD9970A1D6D8967000926BF /* c11.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c11.jpg; sourceTree = ""; }; 137 | 9AD9970B1D6D8967000926BF /* c12.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c12.jpg; sourceTree = ""; }; 138 | 9AD9970C1D6D8967000926BF /* c13.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c13.jpg; sourceTree = ""; }; 139 | 9AD9970D1D6D8967000926BF /* c14.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c14.jpg; sourceTree = ""; }; 140 | 9AD9970E1D6D8967000926BF /* c15.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c15.jpg; sourceTree = ""; }; 141 | 9AD9970F1D6D8967000926BF /* c2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c2.jpg; sourceTree = ""; }; 142 | 9AD997101D6D8967000926BF /* c3.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c3.jpg; sourceTree = ""; }; 143 | 9AD997111D6D8967000926BF /* c4.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c4.jpg; sourceTree = ""; }; 144 | 9AD997121D6D8967000926BF /* c5.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c5.jpg; sourceTree = ""; }; 145 | 9AD997131D6D8967000926BF /* c6.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c6.jpg; sourceTree = ""; }; 146 | 9AD997141D6D8967000926BF /* c7.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c7.jpg; sourceTree = ""; }; 147 | 9AD997151D6D8967000926BF /* c8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c8.jpg; sourceTree = ""; }; 148 | 9AD997161D6D8967000926BF /* c9.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = c9.jpg; sourceTree = ""; }; 149 | 9AD997171D6D8967000926BF /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = ""; }; 150 | 9AD997381D6D9798000926BF /* FilmModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilmModel.h; sourceTree = ""; }; 151 | 9AD997391D6D9798000926BF /* FilmModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FilmModel.m; sourceTree = ""; }; 152 | 9AD9973B1D6E7B5E000926BF /* CaibdeCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaibdeCollectionViewCell.h; sourceTree = ""; }; 153 | 9AD9973C1D6E7B5E000926BF /* CaibdeCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CaibdeCollectionViewCell.m; sourceTree = ""; }; 154 | 9AD9973E1D6E843B000926BF /* FilmViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilmViewController.h; sourceTree = ""; }; 155 | 9AD9973F1D6E843B000926BF /* FilmViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FilmViewController.m; sourceTree = ""; }; 156 | 9AD997411D6E9A21000926BF /* CaibdeSeatController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaibdeSeatController.h; sourceTree = ""; }; 157 | 9AD997421D6E9A22000926BF /* CaibdeSeatController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CaibdeSeatController.m; sourceTree = ""; }; 158 | 9AD9974B1D6EC061000926BF /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = ""; }; 159 | 9AD9974C1D6EC061000926BF /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = ""; }; 160 | 9AD9974E1D6EC061000926BF /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 161 | 9AD9974F1D6EC061000926BF /* MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJExtension.h; sourceTree = ""; }; 162 | 9AD997501D6EC061000926BF /* MJExtensionConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJExtensionConst.h; sourceTree = ""; }; 163 | 9AD997511D6EC061000926BF /* MJExtensionConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJExtensionConst.m; sourceTree = ""; }; 164 | 9AD997521D6EC061000926BF /* MJFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJFoundation.h; sourceTree = ""; }; 165 | 9AD997531D6EC061000926BF /* MJFoundation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJFoundation.m; sourceTree = ""; }; 166 | 9AD997541D6EC061000926BF /* MJProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJProperty.h; sourceTree = ""; }; 167 | 9AD997551D6EC061000926BF /* MJProperty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJProperty.m; sourceTree = ""; }; 168 | 9AD997561D6EC061000926BF /* MJPropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJPropertyKey.h; sourceTree = ""; }; 169 | 9AD997571D6EC061000926BF /* MJPropertyKey.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJPropertyKey.m; sourceTree = ""; }; 170 | 9AD997581D6EC061000926BF /* MJPropertyType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJPropertyType.h; sourceTree = ""; }; 171 | 9AD997591D6EC061000926BF /* MJPropertyType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJPropertyType.m; sourceTree = ""; }; 172 | 9AD9975A1D6EC061000926BF /* NSObject+MJClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+MJClass.h"; sourceTree = ""; }; 173 | 9AD9975B1D6EC061000926BF /* NSObject+MJClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+MJClass.m"; sourceTree = ""; }; 174 | 9AD9975C1D6EC061000926BF /* NSObject+MJCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+MJCoding.h"; sourceTree = ""; }; 175 | 9AD9975D1D6EC061000926BF /* NSObject+MJCoding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+MJCoding.m"; sourceTree = ""; }; 176 | 9AD9975E1D6EC061000926BF /* NSObject+MJKeyValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+MJKeyValue.h"; sourceTree = ""; }; 177 | 9AD9975F1D6EC061000926BF /* NSObject+MJKeyValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+MJKeyValue.m"; sourceTree = ""; }; 178 | 9AD997601D6EC061000926BF /* NSObject+MJProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+MJProperty.h"; sourceTree = ""; }; 179 | 9AD997611D6EC061000926BF /* NSObject+MJProperty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+MJProperty.m"; sourceTree = ""; }; 180 | 9AD997621D6EC061000926BF /* NSString+MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MJExtension.h"; sourceTree = ""; }; 181 | 9AD997631D6EC061000926BF /* NSString+MJExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MJExtension.m"; sourceTree = ""; }; 182 | /* End PBXFileReference section */ 183 | 184 | /* Begin PBXFrameworksBuildPhase section */ 185 | 9A5A55281D6D4D400021C3F6 /* Frameworks */ = { 186 | isa = PBXFrameworksBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | 9A5A55411D6D4D400021C3F6 /* Frameworks */ = { 193 | isa = PBXFrameworksBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | 9A5A554C1D6D4D400021C3F6 /* Frameworks */ = { 200 | isa = PBXFrameworksBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXFrameworksBuildPhase section */ 207 | 208 | /* Begin PBXGroup section */ 209 | 9A5A55221D6D4D400021C3F6 = { 210 | isa = PBXGroup; 211 | children = ( 212 | 9A5A552D1D6D4D400021C3F6 /* GWLZCDM */, 213 | 9A5A55471D6D4D400021C3F6 /* GWLZCDMTests */, 214 | 9A5A55521D6D4D400021C3F6 /* GWLZCDMUITests */, 215 | 9A5A552C1D6D4D400021C3F6 /* Products */, 216 | ); 217 | sourceTree = ""; 218 | }; 219 | 9A5A552C1D6D4D400021C3F6 /* Products */ = { 220 | isa = PBXGroup; 221 | children = ( 222 | 9A5A552B1D6D4D400021C3F6 /* GWLZCDM.app */, 223 | 9A5A55441D6D4D400021C3F6 /* GWLZCDMTests.xctest */, 224 | 9A5A554F1D6D4D400021C3F6 /* GWLZCDMUITests.xctest */, 225 | ); 226 | name = Products; 227 | sourceTree = ""; 228 | }; 229 | 9A5A552D1D6D4D400021C3F6 /* GWLZCDM */ = { 230 | isa = PBXGroup; 231 | children = ( 232 | 9AA08F4C1D6ED1AB00F95073 /* Resouce */, 233 | 9AD9974A1D6EC061000926BF /* Lib */, 234 | 9A5A55311D6D4D400021C3F6 /* AppDelegate.h */, 235 | 9A5A55321D6D4D400021C3F6 /* AppDelegate.m */, 236 | 9A5A55341D6D4D400021C3F6 /* ViewController.h */, 237 | 9A5A55351D6D4D400021C3F6 /* ViewController.m */, 238 | 9AD9973E1D6E843B000926BF /* FilmViewController.h */, 239 | 9AD9973F1D6E843B000926BF /* FilmViewController.m */, 240 | 9AD997411D6E9A21000926BF /* CaibdeSeatController.h */, 241 | 9AD997421D6E9A22000926BF /* CaibdeSeatController.m */, 242 | 9A5A55611D6D4DBD0021C3F6 /* CaibdeNavController.h */, 243 | 9A5A55621D6D4DBD0021C3F6 /* CaibdeNavController.m */, 244 | 9A5A55641D6D4DD60021C3F6 /* CaibdeAnimation.h */, 245 | 9A5A55651D6D4DD60021C3F6 /* CaibdeAnimation.m */, 246 | 9AD997381D6D9798000926BF /* FilmModel.h */, 247 | 9AD997391D6D9798000926BF /* FilmModel.m */, 248 | 9AD9973B1D6E7B5E000926BF /* CaibdeCollectionViewCell.h */, 249 | 9AD9973C1D6E7B5E000926BF /* CaibdeCollectionViewCell.m */, 250 | 9A5A55371D6D4D400021C3F6 /* Main.storyboard */, 251 | 9A5A553A1D6D4D400021C3F6 /* Assets.xcassets */, 252 | 9A5A553C1D6D4D400021C3F6 /* LaunchScreen.storyboard */, 253 | 9A5A553F1D6D4D400021C3F6 /* Info.plist */, 254 | 9AD996F71D6D8967000926BF /* images */, 255 | 9A5A552E1D6D4D400021C3F6 /* Supporting Files */, 256 | ); 257 | path = GWLZCDM; 258 | sourceTree = ""; 259 | }; 260 | 9A5A552E1D6D4D400021C3F6 /* Supporting Files */ = { 261 | isa = PBXGroup; 262 | children = ( 263 | 9A5A552F1D6D4D400021C3F6 /* main.m */, 264 | ); 265 | name = "Supporting Files"; 266 | sourceTree = ""; 267 | }; 268 | 9A5A55471D6D4D400021C3F6 /* GWLZCDMTests */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | 9A5A55481D6D4D400021C3F6 /* GWLZCDMTests.m */, 272 | 9A5A554A1D6D4D400021C3F6 /* Info.plist */, 273 | ); 274 | path = GWLZCDMTests; 275 | sourceTree = ""; 276 | }; 277 | 9A5A55521D6D4D400021C3F6 /* GWLZCDMUITests */ = { 278 | isa = PBXGroup; 279 | children = ( 280 | 9A5A55531D6D4D400021C3F6 /* GWLZCDMUITests.m */, 281 | 9A5A55551D6D4D400021C3F6 /* Info.plist */, 282 | ); 283 | path = GWLZCDMUITests; 284 | sourceTree = ""; 285 | }; 286 | 9AA08F4C1D6ED1AB00F95073 /* Resouce */ = { 287 | isa = PBXGroup; 288 | children = ( 289 | 9AA08F4D1D6ED1AB00F95073 /* seats 0.plist */, 290 | 9AA08F4E1D6ED1AB00F95073 /* seats 1.plist */, 291 | 9AA08F4F1D6ED1AB00F95073 /* seats 2.plist */, 292 | 9AA08F501D6ED1AB00F95073 /* seats 3.plist */, 293 | 9AA08F511D6ED1AB00F95073 /* seats 4.plist */, 294 | ); 295 | path = Resouce; 296 | sourceTree = ""; 297 | }; 298 | 9AD996F71D6D8967000926BF /* images */ = { 299 | isa = PBXGroup; 300 | children = ( 301 | 9AD996F81D6D8967000926BF /* 1.jpg */, 302 | 9AD996F91D6D8967000926BF /* 10.jpg */, 303 | 9AD996FA1D6D8967000926BF /* 11.jpg */, 304 | 9AD996FB1D6D8967000926BF /* 12.jpg */, 305 | 9AD996FC1D6D8967000926BF /* 13.jpg */, 306 | 9AD996FD1D6D8967000926BF /* 14.jpg */, 307 | 9AD996FE1D6D8967000926BF /* 15.jpg */, 308 | 9AD996FF1D6D8967000926BF /* 2.jpg */, 309 | 9AD997001D6D8967000926BF /* 3.jpg */, 310 | 9AD997011D6D8967000926BF /* 4.jpg */, 311 | 9AD997021D6D8967000926BF /* 5.jpg */, 312 | 9AD997031D6D8967000926BF /* 6.jpg */, 313 | 9AD997041D6D8967000926BF /* 7.jpg */, 314 | 9AD997051D6D8967000926BF /* 8.jpg */, 315 | 9AD997061D6D8967000926BF /* 9.jpg */, 316 | 9AD997071D6D8967000926BF /* bg1.png */, 317 | 9AD997081D6D8967000926BF /* c1.jpg */, 318 | 9AD997091D6D8967000926BF /* c10.jpg */, 319 | 9AD9970A1D6D8967000926BF /* c11.jpg */, 320 | 9AD9970B1D6D8967000926BF /* c12.jpg */, 321 | 9AD9970C1D6D8967000926BF /* c13.jpg */, 322 | 9AD9970D1D6D8967000926BF /* c14.jpg */, 323 | 9AD9970E1D6D8967000926BF /* c15.jpg */, 324 | 9AD9970F1D6D8967000926BF /* c2.jpg */, 325 | 9AD997101D6D8967000926BF /* c3.jpg */, 326 | 9AD997111D6D8967000926BF /* c4.jpg */, 327 | 9AD997121D6D8967000926BF /* c5.jpg */, 328 | 9AD997131D6D8967000926BF /* c6.jpg */, 329 | 9AD997141D6D8967000926BF /* c7.jpg */, 330 | 9AD997151D6D8967000926BF /* c8.jpg */, 331 | 9AD997161D6D8967000926BF /* c9.jpg */, 332 | 9AD997171D6D8967000926BF /* close.png */, 333 | ); 334 | path = images; 335 | sourceTree = ""; 336 | }; 337 | 9AD9974A1D6EC061000926BF /* Lib */ = { 338 | isa = PBXGroup; 339 | children = ( 340 | 9AD9974B1D6EC061000926BF /* MBProgressHUD.h */, 341 | 9AD9974C1D6EC061000926BF /* MBProgressHUD.m */, 342 | 9AD9974D1D6EC061000926BF /* MJExtension */, 343 | ); 344 | path = Lib; 345 | sourceTree = ""; 346 | }; 347 | 9AD9974D1D6EC061000926BF /* MJExtension */ = { 348 | isa = PBXGroup; 349 | children = ( 350 | 9AD9974E1D6EC061000926BF /* Info.plist */, 351 | 9AD9974F1D6EC061000926BF /* MJExtension.h */, 352 | 9AD997501D6EC061000926BF /* MJExtensionConst.h */, 353 | 9AD997511D6EC061000926BF /* MJExtensionConst.m */, 354 | 9AD997521D6EC061000926BF /* MJFoundation.h */, 355 | 9AD997531D6EC061000926BF /* MJFoundation.m */, 356 | 9AD997541D6EC061000926BF /* MJProperty.h */, 357 | 9AD997551D6EC061000926BF /* MJProperty.m */, 358 | 9AD997561D6EC061000926BF /* MJPropertyKey.h */, 359 | 9AD997571D6EC061000926BF /* MJPropertyKey.m */, 360 | 9AD997581D6EC061000926BF /* MJPropertyType.h */, 361 | 9AD997591D6EC061000926BF /* MJPropertyType.m */, 362 | 9AD9975A1D6EC061000926BF /* NSObject+MJClass.h */, 363 | 9AD9975B1D6EC061000926BF /* NSObject+MJClass.m */, 364 | 9AD9975C1D6EC061000926BF /* NSObject+MJCoding.h */, 365 | 9AD9975D1D6EC061000926BF /* NSObject+MJCoding.m */, 366 | 9AD9975E1D6EC061000926BF /* NSObject+MJKeyValue.h */, 367 | 9AD9975F1D6EC061000926BF /* NSObject+MJKeyValue.m */, 368 | 9AD997601D6EC061000926BF /* NSObject+MJProperty.h */, 369 | 9AD997611D6EC061000926BF /* NSObject+MJProperty.m */, 370 | 9AD997621D6EC061000926BF /* NSString+MJExtension.h */, 371 | 9AD997631D6EC061000926BF /* NSString+MJExtension.m */, 372 | ); 373 | path = MJExtension; 374 | sourceTree = ""; 375 | }; 376 | /* End PBXGroup section */ 377 | 378 | /* Begin PBXNativeTarget section */ 379 | 9A5A552A1D6D4D400021C3F6 /* GWLZCDM */ = { 380 | isa = PBXNativeTarget; 381 | buildConfigurationList = 9A5A55581D6D4D400021C3F6 /* Build configuration list for PBXNativeTarget "GWLZCDM" */; 382 | buildPhases = ( 383 | 9A5A55271D6D4D400021C3F6 /* Sources */, 384 | 9A5A55281D6D4D400021C3F6 /* Frameworks */, 385 | 9A5A55291D6D4D400021C3F6 /* Resources */, 386 | ); 387 | buildRules = ( 388 | ); 389 | dependencies = ( 390 | ); 391 | name = GWLZCDM; 392 | productName = GWLZCDM; 393 | productReference = 9A5A552B1D6D4D400021C3F6 /* GWLZCDM.app */; 394 | productType = "com.apple.product-type.application"; 395 | }; 396 | 9A5A55431D6D4D400021C3F6 /* GWLZCDMTests */ = { 397 | isa = PBXNativeTarget; 398 | buildConfigurationList = 9A5A555B1D6D4D400021C3F6 /* Build configuration list for PBXNativeTarget "GWLZCDMTests" */; 399 | buildPhases = ( 400 | 9A5A55401D6D4D400021C3F6 /* Sources */, 401 | 9A5A55411D6D4D400021C3F6 /* Frameworks */, 402 | 9A5A55421D6D4D400021C3F6 /* Resources */, 403 | ); 404 | buildRules = ( 405 | ); 406 | dependencies = ( 407 | 9A5A55461D6D4D400021C3F6 /* PBXTargetDependency */, 408 | ); 409 | name = GWLZCDMTests; 410 | productName = GWLZCDMTests; 411 | productReference = 9A5A55441D6D4D400021C3F6 /* GWLZCDMTests.xctest */; 412 | productType = "com.apple.product-type.bundle.unit-test"; 413 | }; 414 | 9A5A554E1D6D4D400021C3F6 /* GWLZCDMUITests */ = { 415 | isa = PBXNativeTarget; 416 | buildConfigurationList = 9A5A555E1D6D4D400021C3F6 /* Build configuration list for PBXNativeTarget "GWLZCDMUITests" */; 417 | buildPhases = ( 418 | 9A5A554B1D6D4D400021C3F6 /* Sources */, 419 | 9A5A554C1D6D4D400021C3F6 /* Frameworks */, 420 | 9A5A554D1D6D4D400021C3F6 /* Resources */, 421 | ); 422 | buildRules = ( 423 | ); 424 | dependencies = ( 425 | 9A5A55511D6D4D400021C3F6 /* PBXTargetDependency */, 426 | ); 427 | name = GWLZCDMUITests; 428 | productName = GWLZCDMUITests; 429 | productReference = 9A5A554F1D6D4D400021C3F6 /* GWLZCDMUITests.xctest */; 430 | productType = "com.apple.product-type.bundle.ui-testing"; 431 | }; 432 | /* End PBXNativeTarget section */ 433 | 434 | /* Begin PBXProject section */ 435 | 9A5A55231D6D4D400021C3F6 /* Project object */ = { 436 | isa = PBXProject; 437 | attributes = { 438 | LastUpgradeCheck = 0730; 439 | ORGANIZATIONNAME = cAibDe; 440 | TargetAttributes = { 441 | 9A5A552A1D6D4D400021C3F6 = { 442 | CreatedOnToolsVersion = 7.3; 443 | }; 444 | 9A5A55431D6D4D400021C3F6 = { 445 | CreatedOnToolsVersion = 7.3; 446 | TestTargetID = 9A5A552A1D6D4D400021C3F6; 447 | }; 448 | 9A5A554E1D6D4D400021C3F6 = { 449 | CreatedOnToolsVersion = 7.3; 450 | TestTargetID = 9A5A552A1D6D4D400021C3F6; 451 | }; 452 | }; 453 | }; 454 | buildConfigurationList = 9A5A55261D6D4D400021C3F6 /* Build configuration list for PBXProject "GWLZCDM" */; 455 | compatibilityVersion = "Xcode 3.2"; 456 | developmentRegion = English; 457 | hasScannedForEncodings = 0; 458 | knownRegions = ( 459 | en, 460 | Base, 461 | ); 462 | mainGroup = 9A5A55221D6D4D400021C3F6; 463 | productRefGroup = 9A5A552C1D6D4D400021C3F6 /* Products */; 464 | projectDirPath = ""; 465 | projectRoot = ""; 466 | targets = ( 467 | 9A5A552A1D6D4D400021C3F6 /* GWLZCDM */, 468 | 9A5A55431D6D4D400021C3F6 /* GWLZCDMTests */, 469 | 9A5A554E1D6D4D400021C3F6 /* GWLZCDMUITests */, 470 | ); 471 | }; 472 | /* End PBXProject section */ 473 | 474 | /* Begin PBXResourcesBuildPhase section */ 475 | 9A5A55291D6D4D400021C3F6 /* Resources */ = { 476 | isa = PBXResourcesBuildPhase; 477 | buildActionMask = 2147483647; 478 | files = ( 479 | 9AD9971F1D6D8967000926BF /* 2.jpg in Resources */, 480 | 9AD997311D6D8967000926BF /* c4.jpg in Resources */, 481 | 9AD9971D1D6D8967000926BF /* 14.jpg in Resources */, 482 | 9AD997191D6D8967000926BF /* 10.jpg in Resources */, 483 | 9AD997201D6D8967000926BF /* 3.jpg in Resources */, 484 | 9AD9971C1D6D8967000926BF /* 13.jpg in Resources */, 485 | 9AD997331D6D8967000926BF /* c6.jpg in Resources */, 486 | 9AD9972B1D6D8967000926BF /* c12.jpg in Resources */, 487 | 9AD997281D6D8967000926BF /* c1.jpg in Resources */, 488 | 9A5A553E1D6D4D400021C3F6 /* LaunchScreen.storyboard in Resources */, 489 | 9AD9971B1D6D8967000926BF /* 12.jpg in Resources */, 490 | 9AD9971E1D6D8967000926BF /* 15.jpg in Resources */, 491 | 9AD997181D6D8967000926BF /* 1.jpg in Resources */, 492 | 9AA08F521D6ED1AB00F95073 /* seats 0.plist in Resources */, 493 | 9AD997261D6D8967000926BF /* 9.jpg in Resources */, 494 | 9AD9972A1D6D8967000926BF /* c11.jpg in Resources */, 495 | 9AA08F531D6ED1AB00F95073 /* seats 1.plist in Resources */, 496 | 9AD997341D6D8967000926BF /* c7.jpg in Resources */, 497 | 9AA08F541D6ED1AB00F95073 /* seats 2.plist in Resources */, 498 | 9AD9972F1D6D8967000926BF /* c2.jpg in Resources */, 499 | 9AD997361D6D8967000926BF /* c9.jpg in Resources */, 500 | 9AD997371D6D8967000926BF /* close.png in Resources */, 501 | 9AD997231D6D8967000926BF /* 6.jpg in Resources */, 502 | 9AD997651D6EC062000926BF /* Info.plist in Resources */, 503 | 9AD997291D6D8967000926BF /* c10.jpg in Resources */, 504 | 9AD9972D1D6D8967000926BF /* c14.jpg in Resources */, 505 | 9AA08F551D6ED1AB00F95073 /* seats 3.plist in Resources */, 506 | 9AD9971A1D6D8967000926BF /* 11.jpg in Resources */, 507 | 9AD997251D6D8967000926BF /* 8.jpg in Resources */, 508 | 9AD997301D6D8967000926BF /* c3.jpg in Resources */, 509 | 9AA08F561D6ED1AB00F95073 /* seats 4.plist in Resources */, 510 | 9AD997241D6D8967000926BF /* 7.jpg in Resources */, 511 | 9AD997271D6D8967000926BF /* bg1.png in Resources */, 512 | 9A5A553B1D6D4D400021C3F6 /* Assets.xcassets in Resources */, 513 | 9AD997221D6D8967000926BF /* 5.jpg in Resources */, 514 | 9AD997321D6D8967000926BF /* c5.jpg in Resources */, 515 | 9AD997351D6D8967000926BF /* c8.jpg in Resources */, 516 | 9AD9972C1D6D8967000926BF /* c13.jpg in Resources */, 517 | 9A5A55391D6D4D400021C3F6 /* Main.storyboard in Resources */, 518 | 9AD997211D6D8967000926BF /* 4.jpg in Resources */, 519 | 9AD9972E1D6D8967000926BF /* c15.jpg in Resources */, 520 | ); 521 | runOnlyForDeploymentPostprocessing = 0; 522 | }; 523 | 9A5A55421D6D4D400021C3F6 /* Resources */ = { 524 | isa = PBXResourcesBuildPhase; 525 | buildActionMask = 2147483647; 526 | files = ( 527 | ); 528 | runOnlyForDeploymentPostprocessing = 0; 529 | }; 530 | 9A5A554D1D6D4D400021C3F6 /* Resources */ = { 531 | isa = PBXResourcesBuildPhase; 532 | buildActionMask = 2147483647; 533 | files = ( 534 | ); 535 | runOnlyForDeploymentPostprocessing = 0; 536 | }; 537 | /* End PBXResourcesBuildPhase section */ 538 | 539 | /* Begin PBXSourcesBuildPhase section */ 540 | 9A5A55271D6D4D400021C3F6 /* Sources */ = { 541 | isa = PBXSourcesBuildPhase; 542 | buildActionMask = 2147483647; 543 | files = ( 544 | 9A5A55361D6D4D400021C3F6 /* ViewController.m in Sources */, 545 | 9AD9976D1D6EC062000926BF /* NSObject+MJKeyValue.m in Sources */, 546 | 9A5A55631D6D4DBD0021C3F6 /* CaibdeNavController.m in Sources */, 547 | 9A5A55331D6D4D400021C3F6 /* AppDelegate.m in Sources */, 548 | 9A5A55661D6D4DD60021C3F6 /* CaibdeAnimation.m in Sources */, 549 | 9AD997661D6EC062000926BF /* MJExtensionConst.m in Sources */, 550 | 9AD997641D6EC062000926BF /* MBProgressHUD.m in Sources */, 551 | 9AD9976E1D6EC062000926BF /* NSObject+MJProperty.m in Sources */, 552 | 9AD9976B1D6EC062000926BF /* NSObject+MJClass.m in Sources */, 553 | 9AD997431D6E9A22000926BF /* CaibdeSeatController.m in Sources */, 554 | 9AD997691D6EC062000926BF /* MJPropertyKey.m in Sources */, 555 | 9AD997671D6EC062000926BF /* MJFoundation.m in Sources */, 556 | 9AD9976A1D6EC062000926BF /* MJPropertyType.m in Sources */, 557 | 9A5A55301D6D4D400021C3F6 /* main.m in Sources */, 558 | 9AD997681D6EC062000926BF /* MJProperty.m in Sources */, 559 | 9AD9973A1D6D9798000926BF /* FilmModel.m in Sources */, 560 | 9AD9976C1D6EC062000926BF /* NSObject+MJCoding.m in Sources */, 561 | 9AD9976F1D6EC062000926BF /* NSString+MJExtension.m in Sources */, 562 | 9AD997401D6E843B000926BF /* FilmViewController.m in Sources */, 563 | 9AD9973D1D6E7B5E000926BF /* CaibdeCollectionViewCell.m in Sources */, 564 | ); 565 | runOnlyForDeploymentPostprocessing = 0; 566 | }; 567 | 9A5A55401D6D4D400021C3F6 /* Sources */ = { 568 | isa = PBXSourcesBuildPhase; 569 | buildActionMask = 2147483647; 570 | files = ( 571 | 9A5A55491D6D4D400021C3F6 /* GWLZCDMTests.m in Sources */, 572 | ); 573 | runOnlyForDeploymentPostprocessing = 0; 574 | }; 575 | 9A5A554B1D6D4D400021C3F6 /* Sources */ = { 576 | isa = PBXSourcesBuildPhase; 577 | buildActionMask = 2147483647; 578 | files = ( 579 | 9A5A55541D6D4D400021C3F6 /* GWLZCDMUITests.m in Sources */, 580 | ); 581 | runOnlyForDeploymentPostprocessing = 0; 582 | }; 583 | /* End PBXSourcesBuildPhase section */ 584 | 585 | /* Begin PBXTargetDependency section */ 586 | 9A5A55461D6D4D400021C3F6 /* PBXTargetDependency */ = { 587 | isa = PBXTargetDependency; 588 | target = 9A5A552A1D6D4D400021C3F6 /* GWLZCDM */; 589 | targetProxy = 9A5A55451D6D4D400021C3F6 /* PBXContainerItemProxy */; 590 | }; 591 | 9A5A55511D6D4D400021C3F6 /* PBXTargetDependency */ = { 592 | isa = PBXTargetDependency; 593 | target = 9A5A552A1D6D4D400021C3F6 /* GWLZCDM */; 594 | targetProxy = 9A5A55501D6D4D400021C3F6 /* PBXContainerItemProxy */; 595 | }; 596 | /* End PBXTargetDependency section */ 597 | 598 | /* Begin PBXVariantGroup section */ 599 | 9A5A55371D6D4D400021C3F6 /* Main.storyboard */ = { 600 | isa = PBXVariantGroup; 601 | children = ( 602 | 9A5A55381D6D4D400021C3F6 /* Base */, 603 | ); 604 | name = Main.storyboard; 605 | sourceTree = ""; 606 | }; 607 | 9A5A553C1D6D4D400021C3F6 /* LaunchScreen.storyboard */ = { 608 | isa = PBXVariantGroup; 609 | children = ( 610 | 9A5A553D1D6D4D400021C3F6 /* Base */, 611 | ); 612 | name = LaunchScreen.storyboard; 613 | sourceTree = ""; 614 | }; 615 | /* End PBXVariantGroup section */ 616 | 617 | /* Begin XCBuildConfiguration section */ 618 | 9A5A55561D6D4D400021C3F6 /* Debug */ = { 619 | isa = XCBuildConfiguration; 620 | buildSettings = { 621 | ALWAYS_SEARCH_USER_PATHS = NO; 622 | CLANG_ANALYZER_NONNULL = YES; 623 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 624 | CLANG_CXX_LIBRARY = "libc++"; 625 | CLANG_ENABLE_MODULES = YES; 626 | CLANG_ENABLE_OBJC_ARC = YES; 627 | CLANG_WARN_BOOL_CONVERSION = YES; 628 | CLANG_WARN_CONSTANT_CONVERSION = YES; 629 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 630 | CLANG_WARN_EMPTY_BODY = YES; 631 | CLANG_WARN_ENUM_CONVERSION = YES; 632 | CLANG_WARN_INT_CONVERSION = YES; 633 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 634 | CLANG_WARN_UNREACHABLE_CODE = YES; 635 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 636 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 637 | COPY_PHASE_STRIP = NO; 638 | DEBUG_INFORMATION_FORMAT = dwarf; 639 | ENABLE_STRICT_OBJC_MSGSEND = YES; 640 | ENABLE_TESTABILITY = YES; 641 | GCC_C_LANGUAGE_STANDARD = gnu99; 642 | GCC_DYNAMIC_NO_PIC = NO; 643 | GCC_NO_COMMON_BLOCKS = YES; 644 | GCC_OPTIMIZATION_LEVEL = 0; 645 | GCC_PREPROCESSOR_DEFINITIONS = ( 646 | "DEBUG=1", 647 | "$(inherited)", 648 | ); 649 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 650 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 651 | GCC_WARN_UNDECLARED_SELECTOR = YES; 652 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 653 | GCC_WARN_UNUSED_FUNCTION = YES; 654 | GCC_WARN_UNUSED_VARIABLE = YES; 655 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 656 | MTL_ENABLE_DEBUG_INFO = YES; 657 | ONLY_ACTIVE_ARCH = YES; 658 | SDKROOT = iphoneos; 659 | TARGETED_DEVICE_FAMILY = "1,2"; 660 | }; 661 | name = Debug; 662 | }; 663 | 9A5A55571D6D4D400021C3F6 /* Release */ = { 664 | isa = XCBuildConfiguration; 665 | buildSettings = { 666 | ALWAYS_SEARCH_USER_PATHS = NO; 667 | CLANG_ANALYZER_NONNULL = YES; 668 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 669 | CLANG_CXX_LIBRARY = "libc++"; 670 | CLANG_ENABLE_MODULES = YES; 671 | CLANG_ENABLE_OBJC_ARC = YES; 672 | CLANG_WARN_BOOL_CONVERSION = YES; 673 | CLANG_WARN_CONSTANT_CONVERSION = YES; 674 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 675 | CLANG_WARN_EMPTY_BODY = YES; 676 | CLANG_WARN_ENUM_CONVERSION = YES; 677 | CLANG_WARN_INT_CONVERSION = YES; 678 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 679 | CLANG_WARN_UNREACHABLE_CODE = YES; 680 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 681 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 682 | COPY_PHASE_STRIP = NO; 683 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 684 | ENABLE_NS_ASSERTIONS = NO; 685 | ENABLE_STRICT_OBJC_MSGSEND = YES; 686 | GCC_C_LANGUAGE_STANDARD = gnu99; 687 | GCC_NO_COMMON_BLOCKS = YES; 688 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 689 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 690 | GCC_WARN_UNDECLARED_SELECTOR = YES; 691 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 692 | GCC_WARN_UNUSED_FUNCTION = YES; 693 | GCC_WARN_UNUSED_VARIABLE = YES; 694 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 695 | MTL_ENABLE_DEBUG_INFO = NO; 696 | SDKROOT = iphoneos; 697 | TARGETED_DEVICE_FAMILY = "1,2"; 698 | VALIDATE_PRODUCT = YES; 699 | }; 700 | name = Release; 701 | }; 702 | 9A5A55591D6D4D400021C3F6 /* Debug */ = { 703 | isa = XCBuildConfiguration; 704 | buildSettings = { 705 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 706 | INFOPLIST_FILE = GWLZCDM/Info.plist; 707 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 708 | PRODUCT_BUNDLE_IDENTIFIER = com.cAibDe.GWLZCDM; 709 | PRODUCT_NAME = "$(TARGET_NAME)"; 710 | }; 711 | name = Debug; 712 | }; 713 | 9A5A555A1D6D4D400021C3F6 /* Release */ = { 714 | isa = XCBuildConfiguration; 715 | buildSettings = { 716 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 717 | INFOPLIST_FILE = GWLZCDM/Info.plist; 718 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 719 | PRODUCT_BUNDLE_IDENTIFIER = com.cAibDe.GWLZCDM; 720 | PRODUCT_NAME = "$(TARGET_NAME)"; 721 | }; 722 | name = Release; 723 | }; 724 | 9A5A555C1D6D4D400021C3F6 /* Debug */ = { 725 | isa = XCBuildConfiguration; 726 | buildSettings = { 727 | BUNDLE_LOADER = "$(TEST_HOST)"; 728 | INFOPLIST_FILE = GWLZCDMTests/Info.plist; 729 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 730 | PRODUCT_BUNDLE_IDENTIFIER = com.cAibDe.GWLZCDMTests; 731 | PRODUCT_NAME = "$(TARGET_NAME)"; 732 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GWLZCDM.app/GWLZCDM"; 733 | }; 734 | name = Debug; 735 | }; 736 | 9A5A555D1D6D4D400021C3F6 /* Release */ = { 737 | isa = XCBuildConfiguration; 738 | buildSettings = { 739 | BUNDLE_LOADER = "$(TEST_HOST)"; 740 | INFOPLIST_FILE = GWLZCDMTests/Info.plist; 741 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 742 | PRODUCT_BUNDLE_IDENTIFIER = com.cAibDe.GWLZCDMTests; 743 | PRODUCT_NAME = "$(TARGET_NAME)"; 744 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GWLZCDM.app/GWLZCDM"; 745 | }; 746 | name = Release; 747 | }; 748 | 9A5A555F1D6D4D400021C3F6 /* Debug */ = { 749 | isa = XCBuildConfiguration; 750 | buildSettings = { 751 | INFOPLIST_FILE = GWLZCDMUITests/Info.plist; 752 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 753 | PRODUCT_BUNDLE_IDENTIFIER = com.cAibDe.GWLZCDMUITests; 754 | PRODUCT_NAME = "$(TARGET_NAME)"; 755 | TEST_TARGET_NAME = GWLZCDM; 756 | }; 757 | name = Debug; 758 | }; 759 | 9A5A55601D6D4D400021C3F6 /* Release */ = { 760 | isa = XCBuildConfiguration; 761 | buildSettings = { 762 | INFOPLIST_FILE = GWLZCDMUITests/Info.plist; 763 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 764 | PRODUCT_BUNDLE_IDENTIFIER = com.cAibDe.GWLZCDMUITests; 765 | PRODUCT_NAME = "$(TARGET_NAME)"; 766 | TEST_TARGET_NAME = GWLZCDM; 767 | }; 768 | name = Release; 769 | }; 770 | /* End XCBuildConfiguration section */ 771 | 772 | /* Begin XCConfigurationList section */ 773 | 9A5A55261D6D4D400021C3F6 /* Build configuration list for PBXProject "GWLZCDM" */ = { 774 | isa = XCConfigurationList; 775 | buildConfigurations = ( 776 | 9A5A55561D6D4D400021C3F6 /* Debug */, 777 | 9A5A55571D6D4D400021C3F6 /* Release */, 778 | ); 779 | defaultConfigurationIsVisible = 0; 780 | defaultConfigurationName = Release; 781 | }; 782 | 9A5A55581D6D4D400021C3F6 /* Build configuration list for PBXNativeTarget "GWLZCDM" */ = { 783 | isa = XCConfigurationList; 784 | buildConfigurations = ( 785 | 9A5A55591D6D4D400021C3F6 /* Debug */, 786 | 9A5A555A1D6D4D400021C3F6 /* Release */, 787 | ); 788 | defaultConfigurationIsVisible = 0; 789 | defaultConfigurationName = Release; 790 | }; 791 | 9A5A555B1D6D4D400021C3F6 /* Build configuration list for PBXNativeTarget "GWLZCDMTests" */ = { 792 | isa = XCConfigurationList; 793 | buildConfigurations = ( 794 | 9A5A555C1D6D4D400021C3F6 /* Debug */, 795 | 9A5A555D1D6D4D400021C3F6 /* Release */, 796 | ); 797 | defaultConfigurationIsVisible = 0; 798 | defaultConfigurationName = Release; 799 | }; 800 | 9A5A555E1D6D4D400021C3F6 /* Build configuration list for PBXNativeTarget "GWLZCDMUITests" */ = { 801 | isa = XCConfigurationList; 802 | buildConfigurations = ( 803 | 9A5A555F1D6D4D400021C3F6 /* Debug */, 804 | 9A5A55601D6D4D400021C3F6 /* Release */, 805 | ); 806 | defaultConfigurationIsVisible = 0; 807 | defaultConfigurationName = Release; 808 | }; 809 | /* End XCConfigurationList section */ 810 | }; 811 | rootObject = 9A5A55231D6D4D400021C3F6 /* Project object */; 812 | } 813 | -------------------------------------------------------------------------------- /GWLZCDM.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GWLZCDM.xcodeproj/xcuserdata/cAibDe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /GWLZCDM.xcodeproj/xcuserdata/cAibDe.xcuserdatad/xcschemes/GWLZCDM.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /GWLZCDM.xcodeproj/xcuserdata/cAibDe.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | GWLZCDM.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9A5A552A1D6D4D400021C3F6 16 | 17 | primary 18 | 19 | 20 | 9A5A55431D6D4D400021C3F6 21 | 22 | primary 23 | 24 | 25 | 9A5A554E1D6D4D400021C3F6 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /GWLZCDM/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /GWLZCDM/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | #import "CaibdeNavController.h" 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; 22 | self.window.rootViewController = [[CaibdeNavController alloc]initWithRootViewController:[[ViewController alloc]init]]; 23 | [self.window makeKeyAndVisible]; 24 | 25 | 26 | 27 | return YES; 28 | } 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application { 31 | // 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. 32 | // 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. 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application { 36 | // 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. 37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 38 | } 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application { 41 | // 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. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application { 45 | // 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. 46 | } 47 | 48 | - (void)applicationWillTerminate:(UIApplication *)application { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /GWLZCDM/Assets.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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /GWLZCDM/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /GWLZCDM/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeAnimation.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CaibdeAnimation : NSObject 13 | /** 14 | * 图片的Rect 15 | */ 16 | @property (nonatomic, assign) CGRect imageRect; 17 | /** 18 | * 图片 19 | */ 20 | @property (nonatomic, strong) UIImage *image; 21 | /** 22 | * 判断是否PUSH的标识 23 | */ 24 | @property (nonatomic, assign) BOOL isPush; 25 | 26 | @property (nonatomic, assign) CGRect desRect; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeAnimation.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "CaibdeAnimation.h" 10 | @interface CaibdeAnimation() 11 | 12 | @property (nonatomic, weak) id transitionContext; 13 | /** 14 | * 最终位置 15 | */ 16 | @property (nonatomic, assign) CGRect finalRect; 17 | 18 | @property (nonatomic, weak) UIImageView *imageView; 19 | 20 | @end 21 | @implementation CaibdeAnimation 22 | /* 23 | * 动画时间 24 | */ 25 | - (NSTimeInterval)transitionDuration:(id)transitionContext{ 26 | return 0.35; 27 | } 28 | - (void)animateTransition:(id)transitionContext{ 29 | self.transitionContext = transitionContext; 30 | self.finalRect = self.desRect; 31 | 32 | /** 33 | * 判断isPush是否为真,是则Push,否则Pop 34 | */ 35 | if (self.isPush) { 36 | [self cAibDePushAnimation]; 37 | }else{ 38 | [self cAibDePopAnimation]; 39 | } 40 | } 41 | /** 42 | * PUSH 动画 43 | */ 44 | - (void)cAibDePushAnimation{ 45 | UIView *contentView = [self.transitionContext containerView]; 46 | [contentView addSubview:[self bgView]]; 47 | 48 | UIViewController *toVC = [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 49 | 50 | UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.imageRect]; 51 | self.imageView = imageView; 52 | imageView.image = self.image; 53 | imageView.layer.shadowColor = [UIColor darkGrayColor].CGColor; 54 | imageView.layer.shadowOffset = CGSizeMake(0, 0); 55 | imageView.layer.shadowOpacity = 5; 56 | imageView.layer.shadowRadius = 5; 57 | [contentView addSubview:imageView]; 58 | 59 | [UIView animateWithDuration:0.3 animations:^{ 60 | imageView.transform = CGAffineTransformScale(imageView.transform, 1.2, 1.2); 61 | } completion:^(BOOL finished) { 62 | [UIView animateWithDuration:0.5 animations:^{ 63 | imageView.frame = self.finalRect; 64 | self.finalRect = imageView.frame; 65 | } completion:^(BOOL finished) { 66 | imageView.layer.shadowRadius = 5; 67 | imageView.layer.shadowOpacity = 5; 68 | imageView.layer.borderColor = [UIColor whiteColor].CGColor; 69 | imageView.layer.borderWidth = 3; 70 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 71 | imageView.layer.shadowRadius = 0; 72 | [contentView addSubview:toVC.view]; 73 | [self setUpCircle]; 74 | [contentView bringSubviewToFront:imageView]; 75 | }); 76 | }]; 77 | }]; 78 | } 79 | - (void)setUpCircle{ 80 | CGPoint point = CGPointMake(20, 150); 81 | UIBezierPath *origionPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(point.x+self.imageRect.size.width/2, point.y+self.imageRect.size.height/2, 0, 0)]; 82 | 83 | CGFloat X = [UIScreen mainScreen].bounds.size.width - point.x; 84 | CGFloat Y = [UIScreen mainScreen].bounds.size.height - point.y; 85 | CGFloat radius = sqrt(X*X + Y*Y); 86 | 87 | UIBezierPath *finalPath = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(CGRectMake(point.x+self.imageRect.size.width/2, point.y+self.imageRect.size.height/2, 0, 0), -radius, -radius)]; 88 | 89 | UIViewController *toVC = [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 90 | 91 | CAShapeLayer *layer = [CAShapeLayer layer]; 92 | layer.path = finalPath.CGPath; 93 | toVC.view.layer.mask = layer; 94 | 95 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"]; 96 | animation.delegate = self; 97 | animation.fromValue = (__bridge id _Nullable)(origionPath.CGPath); 98 | animation.toValue = (__bridge id _Nullable)(finalPath.CGPath); 99 | animation.duration = 0.3; 100 | [layer addAnimation:animation forKey:@"path"]; 101 | 102 | } 103 | /** 104 | * Pop 动画 105 | */ 106 | - (void)cAibDePopAnimation{ 107 | 108 | UIViewController *fromVC = [self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 109 | 110 | CGFloat X = [UIScreen mainScreen].bounds.size.width - self.finalRect.origin.x; 111 | CGFloat Y = [UIScreen mainScreen].bounds.size.height - self.finalRect.origin.y; 112 | CGFloat radius = sqrt(X*X + Y*Y); 113 | 114 | UIBezierPath *origionPath = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(CGRectMake(50, 120, 20, 20), -radius, -radius)]; 115 | UIBezierPath *finalPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(25+self.imageRect.size.width/2, 180+self.imageRect.size.height/2, 0, 0)]; 116 | 117 | CAShapeLayer *layer = [CAShapeLayer layer]; 118 | layer.path = finalPath.CGPath; 119 | fromVC.view.layer.mask = layer; 120 | 121 | CABasicAnimation* animimation = [CABasicAnimation animationWithKeyPath:@"path"]; 122 | animimation.fromValue = (__bridge id _Nullable)(origionPath.CGPath); 123 | animimation.toValue = (__bridge id _Nullable)(finalPath.CGPath); 124 | animimation.delegate = self; 125 | animimation.duration = 0.3; 126 | [layer addAnimation:animimation forKey:@"path"]; 127 | } 128 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ 129 | if (!self.isPush) { 130 | UIView *contentView = [self.transitionContext containerView]; 131 | UIViewController *toVC = [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 132 | 133 | UIImageView *imageView = nil; 134 | for (id view in contentView.subviews) { 135 | if ([view isKindOfClass:[UIImageView class]]) { 136 | imageView = view; 137 | break; 138 | } 139 | } 140 | 141 | imageView.layer.borderWidth = 0; 142 | imageView.layer.shadowColor = [UIColor darkGrayColor].CGColor; 143 | imageView.layer.shadowOffset = CGSizeMake(0, 0); 144 | imageView.layer.shadowRadius = 5; 145 | imageView.layer.shadowOpacity = 5; 146 | 147 | [UIView animateWithDuration:0.3 animations:^{ 148 | imageView.transform = CGAffineTransformScale(imageView.transform, 1.2, 1.2); 149 | } completion:^(BOOL finished) { 150 | [UIView animateWithDuration:0.5 animations:^{ 151 | imageView.frame = self.imageRect; 152 | imageView.transform = CGAffineTransformScale(imageView.transform, 1.2, 1.2); 153 | } completion:^(BOOL finished) { 154 | [UIView animateWithDuration:0.15 animations:^{ 155 | imageView.frame = self.imageRect; 156 | } completion:^(BOOL finished) { 157 | imageView.layer.shadowRadius = 5; 158 | imageView.layer.shadowOpacity = 5; 159 | 160 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 161 | imageView.layer.shadowRadius = 0; 162 | imageView.layer.shadowOpacity = 0; 163 | 164 | [contentView addSubview:toVC.view]; 165 | toVC.view.alpha = 0; 166 | 167 | [UIView animateWithDuration:0.2 animations:^{ 168 | toVC.view.alpha = 1; 169 | } completion:^(BOOL finished) { 170 | [imageView removeFromSuperview]; 171 | [[[self.transitionContext containerView]viewWithTag:1]removeFromSuperview]; 172 | [self.transitionContext completeTransition:YES]; 173 | 174 | [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey].view.layer.mask = nil; 175 | [self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey].view.layer.mask = nil; 176 | }]; 177 | }); 178 | }]; 179 | }]; 180 | }]; 181 | 182 | }else{ 183 | 184 | [self.transitionContext completeTransition:YES]; 185 | [self.transitionContext viewControllerForKey:UITransitionContextToViewControllerKey].view.layer.mask = nil; 186 | [self.transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey].view.layer.mask = nil; 187 | } 188 | } 189 | #pragma mark - Lazy Load 190 | - (UIView *)bgView{ 191 | UIView *view = [[UIView alloc]initWithFrame:[UIScreen mainScreen].bounds]; 192 | view.tag = 1; 193 | //头视图 194 | UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 220)]; 195 | view.backgroundColor = [UIColor whiteColor]; 196 | topView.backgroundColor = [UIColor lightGrayColor]; 197 | [view addSubview:topView]; 198 | 199 | view.alpha = 0; 200 | [UIView animateWithDuration:0.35 animations:^{ 201 | view.alpha = 1; 202 | }]; 203 | return view; 204 | } 205 | @end 206 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeCollectionViewCell.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/25. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FilmModel.h" 11 | @interface CaibdeCollectionViewCell : UICollectionViewCell 12 | /** 13 | * 电影的封面图 14 | */ 15 | @property (nonatomic, strong) UIImageView *filmImageView; 16 | /** 17 | * 电影名字Label 18 | */ 19 | @property (nonatomic, strong) UILabel *filmLabel; 20 | /** 21 | * 电影数据实例 22 | */ 23 | @property (nonatomic, strong) FilmModel *model; 24 | 25 | - (void)updateData:(FilmModel *)model withIndexPath:(NSIndexPath *)indexPath; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeCollectionViewCell.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/25. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "CaibdeCollectionViewCell.h" 10 | @interface CaibdeCollectionViewCell() 11 | 12 | 13 | @end 14 | 15 | @implementation CaibdeCollectionViewCell 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame{ 18 | self = [super initWithFrame:frame]; 19 | if (self) { 20 | [self addSubview:self.filmImageView]; 21 | [self addSubview:self.filmLabel]; 22 | } 23 | return self; 24 | } 25 | -(void)updateData:(FilmModel *)model withIndexPath:(NSIndexPath *)indexPath{ 26 | self.filmImageView.image = [UIImage imageNamed:model.image]; 27 | self.filmLabel.text = model.name; 28 | } 29 | 30 | #pragma mark - Lazy Load 31 | - (UILabel *)filmLabel{ 32 | if (!_filmLabel) { 33 | _filmLabel = [[UILabel alloc]init]; 34 | _filmLabel.frame = CGRectMake(0, self.bounds.size.height-20, self.bounds.size.width, 20); 35 | _filmLabel.textAlignment = NSTextAlignmentCenter; 36 | _filmLabel.font = [UIFont systemFontOfSize:15]; 37 | _filmLabel.textColor = [UIColor blueColor]; 38 | 39 | } 40 | return _filmLabel; 41 | } 42 | - (UIImageView *)filmImageView{ 43 | if (!_filmImageView) { 44 | _filmImageView = [[UIImageView alloc]init]; 45 | _filmImageView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height-20); 46 | } 47 | return _filmImageView; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeNavController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeNavController.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CaibdeNavController : UINavigationController 12 | 13 | /** 14 | * push 方法 15 | * 16 | * @param viewController 目标控制器 17 | * @param imageView 所要移动的ImageView 18 | * @param desRect 目标位置矩形 19 | */ 20 | 21 | - (void)pushViewController:(UIViewController *)viewController withImageView:(UIImageView *)imageView desRect:(CGRect)desRect; 22 | 23 | /** 24 | * push 不带有动画的形式 25 | * 26 | * @param viewController 目标控制器 27 | * @param isAnimation 是否带有动画 28 | */ 29 | - (void)pushViewController:(UIViewController *)viewController isAnimation:(BOOL)isAnimation; 30 | 31 | - (UIViewController *)popViewControllerWithAnimated:(BOOL)animated isAnimation:(BOOL)isAnimation; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeNavController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeNavController.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "CaibdeNavController.h" 10 | #import "CaibdeAnimation.h" 11 | @interface CaibdeNavController () 12 | @property (nonatomic, assign) CGRect origionRect; 13 | @property (nonatomic, assign) CGRect desRect; 14 | @property (nonatomic, strong) UIImage* image; 15 | @property (nonatomic, assign) BOOL isPush; 16 | @property (nonatomic, assign) BOOL isAnimation; 17 | @end 18 | 19 | @implementation CaibdeNavController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view. 24 | self.navigationBar.translucent = NO; 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | -(void)pushViewController:(UIViewController *)viewController withImageView:(UIImageView *)imageView desRect:(CGRect)desRect{ 32 | self.delegate = self; 33 | self.origionRect = [imageView convertRect:imageView.frame toView:self.view]; 34 | ; 35 | self.desRect = desRect; 36 | self.image = imageView.image; 37 | self.isPush = YES; 38 | self.isAnimation = YES; 39 | [super pushViewController:viewController animated:YES]; 40 | } 41 | - (void)pushViewController:(UIViewController *)viewController isAnimation:(BOOL)isAnimation{ 42 | self.isAnimation = isAnimation; 43 | self.isPush = YES; 44 | [super pushViewController:viewController animated:YES]; 45 | } 46 | -(UIViewController *)popViewControllerAnimated:(BOOL)animated{ 47 | self.isPush = NO; 48 | return [super popViewControllerAnimated:animated]; 49 | } 50 | - (UIViewController *)popViewControllerWithAnimated:(BOOL)animated isAnimation:(BOOL)isAnimation{ 51 | self.isPush = NO; 52 | self.isAnimation = isAnimation; 53 | return [super popViewControllerAnimated:animated]; 54 | } 55 | 56 | #pragma mark - UINavigationControllerDelegate 57 | 58 | - (id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC{ 59 | if (self.isAnimation) { 60 | CaibdeAnimation *animation = [[CaibdeAnimation alloc]init]; 61 | animation.imageRect = self.origionRect; 62 | animation.image = self.image; 63 | animation.isPush = self.isPush; 64 | animation.desRect = self.desRect; 65 | if (!self.isPush) { 66 | self.delegate = nil; 67 | } 68 | return animation; 69 | }else{ 70 | return nil; 71 | } 72 | 73 | } 74 | /* 75 | #pragma mark - Navigation 76 | 77 | // In a storyboard-based application, you will often want to do a little preparation before navigation 78 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 79 | // Get the new view controller using [segue destinationViewController]. 80 | // Pass the selected object to the new view controller. 81 | } 82 | */ 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeSeatController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeSeatController.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/25. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CaibdeSeatController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /GWLZCDM/CaibdeSeatController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CaibdeSeatController.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/25. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "CaibdeSeatController.h" 10 | 11 | #import "MJExtension.h" 12 | 13 | @interface CaibdeSeatController () 14 | 15 | @end 16 | 17 | @implementation CaibdeSeatController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | self.view.backgroundColor = [UIColor whiteColor]; 23 | self.title = @"选座"; 24 | } 25 | 26 | - (void)viewWillAppear:(BOOL)animated{ 27 | [super viewWillAppear:animated]; 28 | if (self.navigationController.navigationBar.hidden) { 29 | self.navigationController.navigationBar.hidden = NO; 30 | } 31 | } 32 | 33 | - (void)didReceiveMemoryWarning { 34 | [super didReceiveMemoryWarning]; 35 | // Dispose of any resources that can be recreated. 36 | } 37 | 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /GWLZCDM/FilmModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // FilmModel.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FilmModel : NSObject 12 | /** 13 | * 图片名字 14 | */ 15 | @property (nonatomic, copy) NSString *image; 16 | /** 17 | * 电影名字 18 | */ 19 | @property (nonatomic, copy) NSString *name; 20 | 21 | @property (nonatomic, copy) NSString *cover; 22 | 23 | + (NSArray *)filmArray; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /GWLZCDM/FilmModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // FilmModel.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "FilmModel.h" 10 | 11 | @implementation FilmModel 12 | +(NSArray *)filmArray{ 13 | NSMutableArray* array = [NSMutableArray array]; 14 | 15 | FilmModel* m1 = [[FilmModel alloc] init]; 16 | m1.name = @" 速度与激情7"; 17 | m1.image = @"1.jpg"; 18 | m1.cover = @"c1.jpg"; 19 | [array addObject:m1]; 20 | 21 | FilmModel* m2 = [[FilmModel alloc] init]; 22 | m2.name = @"霍比特人2"; 23 | m2.image = @"2.jpg"; 24 | m2.cover = @"c2.jpg"; 25 | [array addObject:m2]; 26 | 27 | 28 | FilmModel* m3 = [[FilmModel alloc] init]; 29 | m3.name = @"美人鱼"; 30 | m3.image = @"3.jpg"; 31 | m3.cover = @"c3.jpg"; 32 | [array addObject:m3]; 33 | 34 | FilmModel* m4 = [[FilmModel alloc] init]; 35 | m4.name = @"疯狂动物城"; 36 | m4.image = @"4.jpg"; 37 | m4.cover = @"c4.jpg"; 38 | [array addObject:m4]; 39 | 40 | FilmModel* m5 = [[FilmModel alloc] init]; 41 | m5.name = @"美国队长3"; 42 | m5.image = @"5.jpg"; 43 | m5.cover = @"c5.jpg"; 44 | 45 | [array addObject:m5]; 46 | 47 | 48 | FilmModel* m6 = [[FilmModel alloc] init]; 49 | m6.name = @"X战警"; 50 | m6.image = @"6.jpg"; 51 | m6.cover = @"c6.jpg"; 52 | [array addObject:m6]; 53 | 54 | 55 | FilmModel* m7 = [[FilmModel alloc] init]; 56 | m7.name = @"爱丽丝梦游仙境"; 57 | m7.image = @"7.jpg"; 58 | m7.cover = @"c7.jpg"; 59 | [array addObject:m7]; 60 | 61 | FilmModel* m8 = [[FilmModel alloc] init]; 62 | m8.name = @"愤怒的小鸟"; 63 | m8.image = @"8.jpg"; 64 | m8.cover = @"c8.jpg"; 65 | [array addObject:m8]; 66 | 67 | 68 | FilmModel* m9 = [[FilmModel alloc] init]; 69 | m9.name = @"魔兽世界"; 70 | m9.image = @"9.jpg"; 71 | m9.cover = @"c9.jpg"; 72 | [array addObject:m9]; 73 | 74 | FilmModel* m10 = [[FilmModel alloc] init]; 75 | m10.name = @"北京遇上西雅图2"; 76 | m10.image = @"10.jpg"; 77 | m10.cover = @"c10.jpg"; 78 | [array addObject:m10]; 79 | 80 | FilmModel* m11 = [[FilmModel alloc] init]; 81 | m11.name = @"海底总动员"; 82 | m11.image = @"11.jpg"; 83 | m11.cover = @"c11.jpg"; 84 | [array addObject:m11]; 85 | 86 | FilmModel* m12 = [[FilmModel alloc] init]; 87 | m12.name = @"忍者神龟2"; 88 | m12.image = @"12.jpg"; 89 | m12.cover = @"c12.jpg"; 90 | [array addObject:m12]; 91 | 92 | 93 | FilmModel* m13 = [[FilmModel alloc] init]; 94 | m13.name = @"盗墓笔记"; 95 | m13.image = @"13.jpg"; 96 | m13.cover = @"c13.jpg"; 97 | [array addObject:m13]; 98 | 99 | 100 | FilmModel* m14 = [[FilmModel alloc] init]; 101 | m14.name = @"我最好朋友的婚礼"; 102 | m14.image = @"14.jpg"; 103 | m14.cover = @"c14.jpg"; 104 | [array addObject:m14]; 105 | 106 | FilmModel* m15 = [[FilmModel alloc] init]; 107 | m15.name = @"记忆碎片"; 108 | m15.image = @"15.jpg"; 109 | m15.cover = @"c15.jpg"; 110 | [array addObject:m15]; 111 | return array; 112 | } 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /GWLZCDM/FilmViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FilmViewController.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/25. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FilmViewController : UIViewController 12 | 13 | @property (nonatomic, copy) NSString *name; 14 | 15 | @property (nonatomic, copy) NSString *cover; 16 | 17 | @property (nonatomic, copy) NSString *image; 18 | 19 | @property (nonatomic, strong) UIImageView *filmImageView; 20 | 21 | @property (nonatomic, assign) CGFloat width; 22 | 23 | @property (nonatomic, assign) CGFloat height; 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /GWLZCDM/FilmViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FilmViewController.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/25. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "FilmViewController.h" 10 | #import "CaibdeNavController.h" 11 | #import "CaibdeSeatController.h" 12 | @interface FilmViewController () 13 | /** 14 | * 顶部视图 15 | */ 16 | @property (nonatomic, strong) UIImageView *topView; 17 | /** 18 | * 电影名 19 | */ 20 | @property (nonatomic, strong) UILabel *nameLabel; 21 | /** 22 | * 导航栏隐藏的时候返回按钮 23 | */ 24 | @property (nonatomic, strong) UIButton* closeButton; 25 | 26 | @property (nonatomic, strong) UIScrollView *filmScrollView; 27 | /** 28 | * 在线选座 29 | */ 30 | @property (nonatomic, strong) UIButton *selectedSeatButton; 31 | 32 | @end 33 | 34 | @implementation FilmViewController 35 | 36 | - (void)viewDidLoad { 37 | [super viewDidLoad]; 38 | // Do any additional setup after loading the view. 39 | self.view.backgroundColor = [UIColor whiteColor]; 40 | [self.view addSubview:self.topView]; 41 | [self.topView addSubview:self.nameLabel]; 42 | [self.view addSubview:self.closeButton]; 43 | [self.view addSubview:self.selectedSeatButton]; 44 | [self.view addSubview:self.filmImageView]; 45 | 46 | self.filmImageView.image = [UIImage imageNamed:self.image]; 47 | self.topView.image = [UIImage imageNamed:self.cover]; 48 | self.nameLabel.text = self.name; 49 | self.title = self.name; 50 | self.navigationController.navigationBar.hidden = YES; 51 | } 52 | - (void)viewWillAppear:(BOOL)animated{ 53 | [super viewWillAppear:animated]; 54 | if (!self.navigationController.navigationBar.hidden) { 55 | self.navigationController.navigationBar.hidden = YES; 56 | } 57 | } 58 | - (void)creatScrollView{ 59 | 60 | } 61 | - (void)didReceiveMemoryWarning { 62 | [super didReceiveMemoryWarning]; 63 | // Dispose of any resources that can be recreated. 64 | } 65 | 66 | /* 67 | #pragma mark - Navigation 68 | 69 | // In a storyboard-based application, you will often want to do a little preparation before navigation 70 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 71 | // Get the new view controller using [segue destinationViewController]. 72 | // Pass the selected object to the new view controller. 73 | } 74 | */ 75 | #pragma mark - Lazy Load 76 | - (UIImageView *)topView{ 77 | if (!_topView) { 78 | _topView = [[UIImageView alloc]init]; 79 | _topView.frame = CGRectMake(0, 0, self.view.bounds.size.width, 220); 80 | _topView.contentMode = UIViewContentModeScaleAspectFill; 81 | } 82 | return _topView; 83 | } 84 | - (UILabel *)nameLabel{ 85 | if (!_nameLabel) { 86 | _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, 170, 250, 40)]; 87 | _nameLabel.textColor = [UIColor whiteColor]; 88 | _nameLabel.font = [UIFont boldSystemFontOfSize:17]; 89 | } 90 | return _nameLabel; 91 | } 92 | - (UIButton *)closeButton 93 | { 94 | if (!_closeButton) { 95 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 96 | [button addTarget:self action:@selector(close) forControlEvents:UIControlEventTouchUpInside]; 97 | [button setImage:[UIImage imageNamed:@"close"] forState:UIControlStateNormal]; 98 | button.frame = CGRectMake(10, 30, 30, 30); 99 | 100 | _closeButton = button; 101 | } 102 | return _closeButton; 103 | } 104 | - (UIButton *)selectedSeatButton{ 105 | 106 | if (!_selectedSeatButton) { 107 | _selectedSeatButton = [UIButton buttonWithType:UIButtonTypeCustom]; 108 | _selectedSeatButton.frame = CGRectMake(200,400, 100, 30); 109 | [_selectedSeatButton setTitle:@"在线选座" forState:UIControlStateNormal]; 110 | [_selectedSeatButton setTitleColor:[UIColor purpleColor] forState:UIControlStateNormal]; 111 | _selectedSeatButton.titleLabel.font = [UIFont boldSystemFontOfSize:17]; 112 | [_selectedSeatButton addTarget:self action:@selector(pushToSelectedSeat) forControlEvents:UIControlEventTouchUpInside]; 113 | } 114 | return _selectedSeatButton; 115 | } 116 | - (UIImageView *)filmImageView{ 117 | if (!_filmImageView) { 118 | _filmImageView = [[UIImageView alloc]init]; 119 | _filmImageView.frame = CGRectMake(20, 150, _width, _height); 120 | } 121 | return _filmImageView; 122 | } 123 | - (void)pushToSelectedSeat{ 124 | CaibdeSeatController *seatVC = [[CaibdeSeatController alloc]init]; 125 | [((CaibdeNavController *)self.navigationController) pushViewController:seatVC isAnimation:NO]; 126 | } 127 | -(void)close{ 128 | // [((CaibdeNavController*)self.navigationController) popViewControllerAnimated:YES]; 129 | [((CaibdeNavController*)self.navigationController) popViewControllerWithAnimated:YES isAnimation:YES]; 130 | } 131 | @end 132 | -------------------------------------------------------------------------------- /GWLZCDM/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // MBProgressHUD.h 3 | // Version 0.9.2 4 | // Created by Matej Bukovinski on 2.4.09. 5 | // 6 | 7 | // This code is distributed under the terms and conditions of the MIT license. 8 | 9 | // Copyright (c) 2009-2015 Matej Bukovinski 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | // copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | #import 30 | #import 31 | #import 32 | 33 | @class MBBackgroundView; 34 | @protocol MBProgressHUDDelegate; 35 | 36 | 37 | extern CGFloat const MBProgressMaxOffset; 38 | 39 | typedef NS_ENUM(NSInteger, MBProgressHUDMode) { 40 | /// UIActivityIndicatorView. 41 | MBProgressHUDModeIndeterminate, 42 | /// A round, pie-chart like, progress view. 43 | MBProgressHUDModeDeterminate, 44 | /// Horizontal progress bar. 45 | MBProgressHUDModeDeterminateHorizontalBar, 46 | /// Ring-shaped progress view. 47 | MBProgressHUDModeAnnularDeterminate, 48 | /// Shows a custom view. 49 | MBProgressHUDModeCustomView, 50 | /// Shows only labels. 51 | MBProgressHUDModeText 52 | }; 53 | 54 | typedef NS_ENUM(NSInteger, MBProgressHUDAnimation) { 55 | /// Opacity animation 56 | MBProgressHUDAnimationFade, 57 | /// Opacity + scale animation (zoom in when appearing zoom out when disappearing) 58 | MBProgressHUDAnimationZoom, 59 | /// Opacity + scale animation (zoom out style) 60 | MBProgressHUDAnimationZoomOut, 61 | /// Opacity + scale animation (zoom in style) 62 | MBProgressHUDAnimationZoomIn 63 | }; 64 | 65 | typedef NS_ENUM(NSInteger, MBProgressHUDBackgroundStyle) { 66 | /// Solid color background 67 | MBProgressHUDBackgroundStyleSolidColor, 68 | /// UIVisualEffectView or UIToolbar.layer background view 69 | MBProgressHUDBackgroundStyleBlur 70 | }; 71 | 72 | typedef void (^MBProgressHUDCompletionBlock)(); 73 | 74 | 75 | NS_ASSUME_NONNULL_BEGIN 76 | 77 | 78 | /** 79 | * Displays a simple HUD window containing a progress indicator and two optional labels for short messages. 80 | * 81 | * This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class. 82 | * The MBProgressHUD window spans over the entire space given to it by the initWithFrame: constructor and catches all 83 | * user input on this region, thereby preventing the user operations on components below the view. 84 | * 85 | * @note To still allow touches to pass through the HUD, you can set hud.userInteractionEnabled = NO. 86 | * @attention MBProgressHUD is a UI class and should therefore only be accessed on the main thread. 87 | */ 88 | @interface MBProgressHUD : UIView 89 | 90 | /** 91 | * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:. 92 | * 93 | * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden. 94 | * 95 | * @param view The view that the HUD will be added to 96 | * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use 97 | * animations while appearing. 98 | * @return A reference to the created HUD. 99 | * 100 | * @see hideHUDForView:animated: 101 | * @see animationType 102 | */ 103 | + (instancetype)showHUDAddedTo:(UIView *)view animated:(BOOL)animated; 104 | 105 | /// @name Showing and hiding 106 | 107 | /** 108 | * Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:. 109 | * 110 | * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden. 111 | * 112 | * @param view The view that is going to be searched for a HUD subview. 113 | * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use 114 | * animations while disappearing. 115 | * @return YES if a HUD was found and removed, NO otherwise. 116 | * 117 | * @see showHUDAddedTo:animated: 118 | * @see animationType 119 | */ 120 | + (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated; 121 | 122 | /** 123 | * Finds the top-most HUD subview and returns it. 124 | * 125 | * @param view The view that is going to be searched. 126 | * @return A reference to the last HUD subview discovered. 127 | */ 128 | + (nullable MBProgressHUD *)HUDForView:(UIView *)view; 129 | 130 | /** 131 | * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with 132 | * view.bounds as the parameter. 133 | * 134 | * @param view The view instance that will provide the bounds for the HUD. Should be the same instance as 135 | * the HUD's superview (i.e., the view that the HUD will be added to). 136 | */ 137 | - (instancetype)initWithView:(UIView *)view; 138 | 139 | /** 140 | * Displays the HUD. 141 | * 142 | * @note You need to make sure that the main thread completes its run loop soon after this method call so that 143 | * the user interface can be updated. Call this method when your task is already set up to be executed in a new thread 144 | * (e.g., when using something like NSOperation or making an asynchronous call like NSURLRequest). 145 | * 146 | * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use 147 | * animations while appearing. 148 | * 149 | * @see animationType 150 | */ 151 | - (void)showAnimated:(BOOL)animated; 152 | 153 | /** 154 | * Hides the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to 155 | * hide the HUD when your task completes. 156 | * 157 | * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use 158 | * animations while disappearing. 159 | * 160 | * @see animationType 161 | */ 162 | - (void)hideAnimated:(BOOL)animated; 163 | 164 | /** 165 | * Hides the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to 166 | * hide the HUD when your task completes. 167 | * 168 | * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use 169 | * animations while disappearing. 170 | * @param delay Delay in seconds until the HUD is hidden. 171 | * 172 | * @see animationType 173 | */ 174 | - (void)hideAnimated:(BOOL)animated afterDelay:(NSTimeInterval)delay; 175 | 176 | /** 177 | * The HUD delegate object. Receives HUD state notifications. 178 | */ 179 | @property (weak, nonatomic) id delegate; 180 | 181 | /** 182 | * Called after the HUD is hiden. 183 | */ 184 | @property (copy, nullable) MBProgressHUDCompletionBlock completionBlock; 185 | 186 | /* 187 | * Grace period is the time (in seconds) that the invoked method may be run without 188 | * showing the HUD. If the task finishes before the grace time runs out, the HUD will 189 | * not be shown at all. 190 | * This may be used to prevent HUD display for very short tasks. 191 | * Defaults to 0 (no grace time). 192 | */ 193 | @property (assign, nonatomic) NSTimeInterval graceTime; 194 | 195 | /** 196 | * The minimum time (in seconds) that the HUD is shown. 197 | * This avoids the problem of the HUD being shown and than instantly hidden. 198 | * Defaults to 0 (no minimum show time). 199 | */ 200 | @property (assign, nonatomic) NSTimeInterval minShowTime; 201 | 202 | /** 203 | * Removes the HUD from its parent view when hidden. 204 | * Defaults to NO. 205 | */ 206 | @property (assign, nonatomic) BOOL removeFromSuperViewOnHide; 207 | 208 | /// @name Appearance 209 | 210 | /** 211 | * MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate. 212 | */ 213 | @property (assign, nonatomic) MBProgressHUDMode mode; 214 | 215 | /** 216 | * A color that gets forwarded to all labels and supported indicators. Also sets the tintColor 217 | * for custom views on iOS 7+. Set to nil to manage color individually. 218 | * Defaults to semi-translucent black on iOS 7 and later and white on earlier iOS versions. 219 | */ 220 | @property (strong, nonatomic, nullable) UIColor *contentColor UI_APPEARANCE_SELECTOR; 221 | 222 | /** 223 | * The animation type that should be used when the HUD is shown and hidden. 224 | */ 225 | @property (assign, nonatomic) MBProgressHUDAnimation animationType UI_APPEARANCE_SELECTOR; 226 | 227 | /** 228 | * The bezel offset relative to the center of the view. You can use MBProgressMaxOffset 229 | * and -MBProgressMaxOffset to move the HUD all the way to the screen edge in each direction. 230 | * E.g., CGPointMake(0.f, MBProgressMaxOffset) would position the HUD centered on the bottom edge. 231 | */ 232 | @property (assign, nonatomic) CGPoint offset UI_APPEARANCE_SELECTOR; 233 | 234 | /** 235 | * The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views). 236 | * This also represents the minimum bezel distance to the edge of the HUD view. 237 | * Defaults to 20.f 238 | */ 239 | @property (assign, nonatomic) CGFloat margin UI_APPEARANCE_SELECTOR; 240 | 241 | /** 242 | * The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size). 243 | */ 244 | @property (assign, nonatomic) CGSize minSize UI_APPEARANCE_SELECTOR; 245 | 246 | /** 247 | * Force the HUD dimensions to be equal if possible. 248 | */ 249 | @property (assign, nonatomic, getter = isSquare) BOOL square UI_APPEARANCE_SELECTOR; 250 | 251 | /** 252 | * When enabled, the bezel center gets slightly affected by the device accelerometer data. 253 | * Has no effect on iOS < 7.0. Defaults to YES. 254 | */ 255 | @property (assign, nonatomic, getter=areDefaultMotionEffectsEnabled) BOOL defaultMotionEffectsEnabled UI_APPEARANCE_SELECTOR; 256 | 257 | /// @name Progress 258 | 259 | /** 260 | * The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0. 261 | */ 262 | @property (assign, nonatomic) float progress; 263 | 264 | /// @name Views 265 | 266 | /** 267 | * The view containing the labels and indicator (or customView). 268 | */ 269 | @property (strong, nonatomic, readonly) MBBackgroundView *bezelView; 270 | 271 | /** 272 | * View covering the entire HUD area, placed behind bezelView. 273 | */ 274 | @property (strong, nonatomic, readonly) MBBackgroundView *backgroundView; 275 | 276 | /** 277 | * The UIView (e.g., a UIImageView) to be shown when the HUD is in MBProgressHUDModeCustomView. 278 | * The view should implement intrinsicContentSize for proper sizing. For best results use approximately 37 by 37 pixels. 279 | */ 280 | @property (strong, nonatomic, nullable) UIView *customView; 281 | 282 | /** 283 | * A label that holds an optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit 284 | * the entire text. 285 | */ 286 | @property (strong, nonatomic, readonly) UILabel *label; 287 | 288 | /** 289 | * A label that holds an optional details message displayed below the labelText message. The details text can span multiple lines. 290 | */ 291 | @property (strong, nonatomic, readonly) UILabel *detailsLabel; 292 | 293 | /** 294 | * A button that is placed below the labels. Visible only if a target / action is added. 295 | */ 296 | @property (strong, nonatomic, readonly) UIButton *button; 297 | 298 | @end 299 | 300 | 301 | @protocol MBProgressHUDDelegate 302 | 303 | @optional 304 | 305 | /** 306 | * Called after the HUD was fully hidden from the screen. 307 | */ 308 | - (void)hudWasHidden:(MBProgressHUD *)hud; 309 | 310 | @end 311 | 312 | 313 | /** 314 | * A progress view for showing definite progress by filling up a circle (pie chart). 315 | */ 316 | @interface MBRoundProgressView : UIView 317 | 318 | /** 319 | * Progress (0.0 to 1.0) 320 | */ 321 | @property (nonatomic, assign) float progress; 322 | 323 | /** 324 | * Indicator progress color. 325 | * Defaults to white [UIColor whiteColor]. 326 | */ 327 | @property (nonatomic, strong) UIColor *progressTintColor; 328 | 329 | /** 330 | * Indicator background (non-progress) color. 331 | * Only applicable on iOS versions older than iOS 7. 332 | * Defaults to translucent white (alpha 0.1). 333 | */ 334 | @property (nonatomic, strong) UIColor *backgroundTintColor; 335 | 336 | /* 337 | * Display mode - NO = round or YES = annular. Defaults to round. 338 | */ 339 | @property (nonatomic, assign, getter = isAnnular) BOOL annular; 340 | 341 | @end 342 | 343 | 344 | /** 345 | * A flat bar progress view. 346 | */ 347 | @interface MBBarProgressView : UIView 348 | 349 | /** 350 | * Progress (0.0 to 1.0) 351 | */ 352 | @property (nonatomic, assign) float progress; 353 | 354 | /** 355 | * Bar border line color. 356 | * Defaults to white [UIColor whiteColor]. 357 | */ 358 | @property (nonatomic, strong) UIColor *lineColor; 359 | 360 | /** 361 | * Bar background color. 362 | * Defaults to clear [UIColor clearColor]; 363 | */ 364 | @property (nonatomic, strong) UIColor *progressRemainingColor; 365 | 366 | /** 367 | * Bar progress color. 368 | * Defaults to white [UIColor whiteColor]. 369 | */ 370 | @property (nonatomic, strong) UIColor *progressColor; 371 | 372 | @end 373 | 374 | 375 | @interface MBBackgroundView : UIView 376 | 377 | /** 378 | * The background style. 379 | * Defaults to MBProgressHUDBackgroundStyleBlur on iOS 7 or later and MBProgressHUDBackgroundStyleSolidColor otherwise. 380 | * @note Due to iOS 7 not supporting UIVisualEffectView, the blur effect differs slightly between iOS 7 and later versions. 381 | */ 382 | @property (nonatomic) MBProgressHUDBackgroundStyle style; 383 | 384 | /** 385 | * The background color or the blur tint color. 386 | * @note Due to iOS 7 not supporting UIVisualEffectView, the blur effect differs slightly between iOS 7 and later versions. 387 | */ 388 | @property (nonatomic, strong) UIColor *color; 389 | 390 | @end 391 | 392 | @interface MBProgressHUD (Deprecated) 393 | 394 | + (NSArray *)allHUDsForView:(UIView *)view __attribute__((deprecated("Store references when using more than one HUD per view."))); 395 | + (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated __attribute__((deprecated("Store references when using more than one HUD per view."))); 396 | 397 | - (id)initWithWindow:(UIWindow *)window __attribute__((deprecated("Use initWithView: instead."))); 398 | 399 | - (void)show:(BOOL)animated __attribute__((deprecated("Use showAnimated: instead."))); 400 | - (void)hide:(BOOL)animated __attribute__((deprecated("Use hideAnimated: instead."))); 401 | - (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay __attribute__((deprecated("Use hideAnimated:afterDelay: instead."))); 402 | 403 | - (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated __attribute__((deprecated("Use GCD directly."))); 404 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block __attribute__((deprecated("Use GCD directly."))); 405 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(nullable MBProgressHUDCompletionBlock)completion __attribute__((deprecated("Use GCD directly."))); 406 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue __attribute__((deprecated("Use GCD directly."))); 407 | - (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue 408 | completionBlock:(nullable MBProgressHUDCompletionBlock)completion __attribute__((deprecated("Use GCD directly."))); 409 | @property (assign) BOOL taskInProgress __attribute__((deprecated("No longer needed."))); 410 | 411 | @property (nonatomic, copy) NSString *labelText __attribute__((deprecated("Use label.text instead."))); 412 | @property (nonatomic, strong) UIFont *labelFont __attribute__((deprecated("Use label.font instead."))); 413 | @property (nonatomic, strong) UIColor *labelColor __attribute__((deprecated("Use label.textColor instead."))); 414 | @property (nonatomic, copy) NSString *detailsLabelText __attribute__((deprecated("Use detailsLabel.text instead."))); 415 | @property (nonatomic, strong) UIFont *detailsLabelFont __attribute__((deprecated("Use detailsLabel.font instead."))); 416 | @property (nonatomic, strong) UIColor *detailsLabelColor __attribute__((deprecated("Use detailsLabel.textColor instead."))); 417 | @property (assign, nonatomic) CGFloat opacity __attribute__((deprecated("Customize bezelView properties instead."))); 418 | @property (strong, nonatomic) UIColor *color __attribute__((deprecated("Customize the bezelView color instead."))); 419 | @property (assign, nonatomic) CGFloat xOffset __attribute__((deprecated("Set offset.x instead."))); 420 | @property (assign, nonatomic) CGFloat yOffset __attribute__((deprecated("Set offset.y instead."))); 421 | @property (assign, nonatomic) CGFloat cornerRadius __attribute__((deprecated("Set bezelView.layer.cornerRadius instead."))); 422 | @property (assign, nonatomic) BOOL dimBackground __attribute__((deprecated("Customize HUD background properties instead."))); 423 | @property (strong, nonatomic) UIColor *activityIndicatorColor __attribute__((deprecated("Use UIAppearance to customize UIActivityIndicatorView. E.g.: [UIActivityIndicatorView appearanceWhenContainedIn:[MBProgressHUD class], nil].color = [UIColor redColor];"))); 424 | @property (atomic, assign, readonly) CGSize size __attribute__((deprecated("Get the bezelView.frame.size instead."))); 425 | 426 | @end 427 | 428 | NS_ASSUME_NONNULL_END 429 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJExtension.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 代码地址:https://github.com/CoderMJLee/MJExtension 8 | // 代码地址:http://code4app.com/ios/%E5%AD%97%E5%85%B8-JSON-%E4%B8%8E%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%BD%AC%E6%8D%A2/5339992a933bf062608b4c57 9 | 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "NSObject+MJClass.h" 13 | #import "NSObject+MJKeyValue.h" 14 | #import "NSString+MJExtension.h" 15 | #import "MJExtensionConst.h" -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MJExtensionConst__H__ 3 | #define __MJExtensionConst__H__ 4 | 5 | #import 6 | 7 | // 过期 8 | #define MJExtensionDeprecated(instead) NS_DEPRECATED(2_0, 2_0, 2_0, 2_0, instead) 9 | 10 | // 构建错误 11 | #define MJExtensionBuildError(clazz, msg) \ 12 | NSError *error = [NSError errorWithDomain:msg code:250 userInfo:nil]; \ 13 | [clazz setMj_error:error]; 14 | 15 | // 日志输出 16 | #ifdef DEBUG 17 | #define MJExtensionLog(...) NSLog(__VA_ARGS__) 18 | #else 19 | #define MJExtensionLog(...) 20 | #endif 21 | 22 | /** 23 | * 断言 24 | * @param condition 条件 25 | * @param returnValue 返回值 26 | */ 27 | #define MJExtensionAssertError(condition, returnValue, clazz, msg) \ 28 | [clazz setMj_error:nil]; \ 29 | if ((condition) == NO) { \ 30 | MJExtensionBuildError(clazz, msg); \ 31 | return returnValue;\ 32 | } 33 | 34 | #define MJExtensionAssert2(condition, returnValue) \ 35 | if ((condition) == NO) return returnValue; 36 | 37 | /** 38 | * 断言 39 | * @param condition 条件 40 | */ 41 | #define MJExtensionAssert(condition) MJExtensionAssert2(condition, ) 42 | 43 | /** 44 | * 断言 45 | * @param param 参数 46 | * @param returnValue 返回值 47 | */ 48 | #define MJExtensionAssertParamNotNil2(param, returnValue) \ 49 | MJExtensionAssert2((param) != nil, returnValue) 50 | 51 | /** 52 | * 断言 53 | * @param param 参数 54 | */ 55 | #define MJExtensionAssertParamNotNil(param) MJExtensionAssertParamNotNil2(param, ) 56 | 57 | /** 58 | * 打印所有的属性 59 | */ 60 | #define MJLogAllIvars \ 61 | -(NSString *)description \ 62 | { \ 63 | return [self mj_keyValues].description; \ 64 | } 65 | #define MJExtensionLogAllProperties MJLogAllIvars 66 | 67 | /** 68 | * 类型(属性类型) 69 | */ 70 | extern NSString *const MJPropertyTypeInt; 71 | extern NSString *const MJPropertyTypeShort; 72 | extern NSString *const MJPropertyTypeFloat; 73 | extern NSString *const MJPropertyTypeDouble; 74 | extern NSString *const MJPropertyTypeLong; 75 | extern NSString *const MJPropertyTypeLongLong; 76 | extern NSString *const MJPropertyTypeChar; 77 | extern NSString *const MJPropertyTypeBOOL1; 78 | extern NSString *const MJPropertyTypeBOOL2; 79 | extern NSString *const MJPropertyTypePointer; 80 | 81 | extern NSString *const MJPropertyTypeIvar; 82 | extern NSString *const MJPropertyTypeMethod; 83 | extern NSString *const MJPropertyTypeBlock; 84 | extern NSString *const MJPropertyTypeClass; 85 | extern NSString *const MJPropertyTypeSEL; 86 | extern NSString *const MJPropertyTypeId; 87 | 88 | #endif -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJExtensionConst.m: -------------------------------------------------------------------------------- 1 | #ifndef __MJExtensionConst__M__ 2 | #define __MJExtensionConst__M__ 3 | 4 | #import 5 | 6 | /** 7 | * 成员变量类型(属性类型) 8 | */ 9 | NSString *const MJPropertyTypeInt = @"i"; 10 | NSString *const MJPropertyTypeShort = @"s"; 11 | NSString *const MJPropertyTypeFloat = @"f"; 12 | NSString *const MJPropertyTypeDouble = @"d"; 13 | NSString *const MJPropertyTypeLong = @"l"; 14 | NSString *const MJPropertyTypeLongLong = @"q"; 15 | NSString *const MJPropertyTypeChar = @"c"; 16 | NSString *const MJPropertyTypeBOOL1 = @"c"; 17 | NSString *const MJPropertyTypeBOOL2 = @"b"; 18 | NSString *const MJPropertyTypePointer = @"*"; 19 | 20 | NSString *const MJPropertyTypeIvar = @"^{objc_ivar=}"; 21 | NSString *const MJPropertyTypeMethod = @"^{objc_method=}"; 22 | NSString *const MJPropertyTypeBlock = @"@?"; 23 | NSString *const MJPropertyTypeClass = @"#"; 24 | NSString *const MJPropertyTypeSEL = @":"; 25 | NSString *const MJPropertyTypeId = @"@"; 26 | 27 | #endif -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MJFoundation : NSObject 12 | + (BOOL)isClassFromFoundation:(Class)c; 13 | @end 14 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJFoundation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJFoundation.h" 10 | #import "MJExtensionConst.h" 11 | #import 12 | 13 | static NSSet *foundationClasses_; 14 | 15 | @implementation MJFoundation 16 | 17 | + (NSSet *)foundationClasses 18 | { 19 | if (foundationClasses_ == nil) { 20 | // 集合中没有NSObject,因为几乎所有的类都是继承自NSObject,具体是不是NSObject需要特殊判断 21 | foundationClasses_ = [NSSet setWithObjects: 22 | [NSURL class], 23 | [NSDate class], 24 | [NSValue class], 25 | [NSData class], 26 | [NSError class], 27 | [NSArray class], 28 | [NSDictionary class], 29 | [NSString class], 30 | [NSAttributedString class], nil]; 31 | } 32 | return foundationClasses_; 33 | } 34 | 35 | + (BOOL)isClassFromFoundation:(Class)c 36 | { 37 | if (c == [NSObject class] || c == [NSManagedObject class]) return YES; 38 | 39 | __block BOOL result = NO; 40 | [[self foundationClasses] enumerateObjectsUsingBlock:^(Class foundationClass, BOOL *stop) { 41 | if ([c isSubclassOfClass:foundationClass]) { 42 | result = YES; 43 | *stop = YES; 44 | } 45 | }]; 46 | return result; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 包装一个成员属性 8 | 9 | #import 10 | #import 11 | #import "MJPropertyType.h" 12 | #import "MJPropertyKey.h" 13 | 14 | /** 15 | * 包装一个成员 16 | */ 17 | @interface MJProperty : NSObject 18 | /** 成员属性 */ 19 | @property (nonatomic, assign) objc_property_t property; 20 | /** 成员属性的名字 */ 21 | @property (nonatomic, readonly) NSString *name; 22 | 23 | /** 成员属性的类型 */ 24 | @property (nonatomic, readonly) MJPropertyType *type; 25 | /** 成员属性来源于哪个类(可能是父类) */ 26 | @property (nonatomic, assign) Class srcClass; 27 | 28 | /**** 同一个成员属性 - 父类和子类的行为可能不一致(originKey、propertyKeys、objectClassInArray) ****/ 29 | /** 设置最原始的key */ 30 | - (void)setOriginKey:(id)originKey forClass:(Class)c; 31 | /** 对应着字典中的多级key(里面存放的数组,数组里面都是MJPropertyKey对象) */ 32 | - (NSArray *)propertyKeysForClass:(Class)c; 33 | 34 | /** 模型数组中的模型类型 */ 35 | - (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; 36 | - (Class)objectClassInArrayForClass:(Class)c; 37 | /**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ 38 | 39 | /** 40 | * 设置object的成员变量值 41 | */ 42 | - (void)setValue:(id)value forObject:(id)object; 43 | /** 44 | * 得到object的成员属性值 45 | */ 46 | - (id)valueForObject:(id)object; 47 | 48 | /** 49 | * 初始化 50 | */ 51 | + (instancetype)cachedPropertyWithProperty:(objc_property_t)property; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJProperty.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJProperty.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJProperty.h" 10 | #import "MJFoundation.h" 11 | #import "MJExtensionConst.h" 12 | #import 13 | 14 | @interface MJProperty() 15 | @property (strong, nonatomic) NSMutableDictionary *propertyKeysDict; 16 | @property (strong, nonatomic) NSMutableDictionary *objectClassInArrayDict; 17 | @end 18 | 19 | @implementation MJProperty 20 | 21 | #pragma mark - 懒加载 22 | - (NSMutableDictionary *)propertyKeysDict 23 | { 24 | if (!_propertyKeysDict) { 25 | _propertyKeysDict = [NSMutableDictionary dictionary]; 26 | } 27 | return _propertyKeysDict; 28 | } 29 | 30 | - (NSMutableDictionary *)objectClassInArrayDict 31 | { 32 | if (!_objectClassInArrayDict) { 33 | _objectClassInArrayDict = [NSMutableDictionary dictionary]; 34 | } 35 | return _objectClassInArrayDict; 36 | } 37 | 38 | #pragma mark - 缓存 39 | + (instancetype)cachedPropertyWithProperty:(objc_property_t)property 40 | { 41 | MJProperty *propertyObj = objc_getAssociatedObject(self, property); 42 | if (propertyObj == nil) { 43 | propertyObj = [[self alloc] init]; 44 | propertyObj.property = property; 45 | objc_setAssociatedObject(self, property, propertyObj, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 46 | } 47 | return propertyObj; 48 | } 49 | 50 | #pragma mark - 公共方法 51 | - (void)setProperty:(objc_property_t)property 52 | { 53 | _property = property; 54 | 55 | MJExtensionAssertParamNotNil(property); 56 | 57 | // 1.属性名 58 | _name = @(property_getName(property)); 59 | 60 | // 2.成员类型 61 | NSString *attrs = @(property_getAttributes(property)); 62 | NSUInteger dotLoc = [attrs rangeOfString:@","].location; 63 | NSString *code = nil; 64 | NSUInteger loc = 1; 65 | if (dotLoc == NSNotFound) { // 没有, 66 | code = [attrs substringFromIndex:loc]; 67 | } else { 68 | code = [attrs substringWithRange:NSMakeRange(loc, dotLoc - loc)]; 69 | } 70 | _type = [MJPropertyType cachedTypeWithCode:code]; 71 | } 72 | 73 | /** 74 | * 获得成员变量的值 75 | */ 76 | - (id)valueForObject:(id)object 77 | { 78 | if (self.type.KVCDisabled) return [NSNull null]; 79 | return [object valueForKey:self.name]; 80 | } 81 | 82 | /** 83 | * 设置成员变量的值 84 | */ 85 | - (void)setValue:(id)value forObject:(id)object 86 | { 87 | if (self.type.KVCDisabled || value == nil) return; 88 | [object setValue:value forKey:self.name]; 89 | } 90 | 91 | /** 92 | * 通过字符串key创建对应的keys 93 | */ 94 | - (NSArray *)propertyKeysWithStringKey:(NSString *)stringKey 95 | { 96 | if (stringKey.length == 0) return nil; 97 | 98 | NSMutableArray *propertyKeys = [NSMutableArray array]; 99 | // 如果有多级映射 100 | NSArray *oldKeys = [stringKey componentsSeparatedByString:@"."]; 101 | 102 | for (NSString *oldKey in oldKeys) { 103 | NSUInteger start = [oldKey rangeOfString:@"["].location; 104 | if (start != NSNotFound) { // 有索引的key 105 | NSString *prefixKey = [oldKey substringToIndex:start]; 106 | NSString *indexKey = prefixKey; 107 | if (prefixKey.length) { 108 | MJPropertyKey *propertyKey = [[MJPropertyKey alloc] init]; 109 | propertyKey.name = prefixKey; 110 | [propertyKeys addObject:propertyKey]; 111 | 112 | indexKey = [oldKey stringByReplacingOccurrencesOfString:prefixKey withString:@""]; 113 | } 114 | 115 | /** 解析索引 **/ 116 | // 元素 117 | NSArray *cmps = [[indexKey stringByReplacingOccurrencesOfString:@"[" withString:@""] componentsSeparatedByString:@"]"]; 118 | for (NSInteger i = 0; i 10 | 11 | typedef enum { 12 | MJPropertyKeyTypeDictionary = 0, // 字典的key 13 | MJPropertyKeyTypeArray // 数组的key 14 | } MJPropertyKeyType; 15 | 16 | /** 17 | * 属性的key 18 | */ 19 | @interface MJPropertyKey : NSObject 20 | /** key的名字 */ 21 | @property (copy, nonatomic) NSString *name; 22 | /** key的种类,可能是@"10",可能是@"age" */ 23 | @property (assign, nonatomic) MJPropertyKeyType type; 24 | 25 | /** 26 | * 根据当前的key,也就是name,从object(字典或者数组)中取值 27 | */ 28 | - (id)valueInObject:(id)object; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJPropertyKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyKey.h" 10 | 11 | @implementation MJPropertyKey 12 | 13 | - (id)valueInObject:(id)object 14 | { 15 | if ([object isKindOfClass:[NSDictionary class]] && self.type == MJPropertyKeyTypeDictionary) { 16 | return object[self.name]; 17 | } else if ([object isKindOfClass:[NSArray class]] && self.type == MJPropertyKeyTypeArray) { 18 | NSArray *array = object; 19 | NSUInteger index = self.name.intValue; 20 | if (index < array.count) return array[index]; 21 | return nil; 22 | } 23 | return nil; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 包装一种类型 8 | 9 | #import 10 | 11 | /** 12 | * 包装一种类型 13 | */ 14 | @interface MJPropertyType : NSObject 15 | /** 类型标识符 */ 16 | @property (nonatomic, copy) NSString *code; 17 | 18 | /** 是否为id类型 */ 19 | @property (nonatomic, readonly, getter=isIdType) BOOL idType; 20 | 21 | /** 是否为基本数字类型:int、float等 */ 22 | @property (nonatomic, readonly, getter=isNumberType) BOOL numberType; 23 | 24 | /** 是否为BOOL类型 */ 25 | @property (nonatomic, readonly, getter=isBoolType) BOOL boolType; 26 | 27 | /** 对象类型(如果是基本数据类型,此值为nil) */ 28 | @property (nonatomic, readonly) Class typeClass; 29 | 30 | /** 类型是否来自于Foundation框架,比如NSString、NSArray */ 31 | @property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; 32 | /** 类型是否不支持KVC */ 33 | @property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; 34 | 35 | /** 36 | * 获得缓存的类型对象 37 | */ 38 | + (instancetype)cachedTypeWithCode:(NSString *)code; 39 | @end -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/MJPropertyType.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyType.h" 10 | #import "MJExtension.h" 11 | #import "MJFoundation.h" 12 | #import "MJExtensionConst.h" 13 | 14 | @implementation MJPropertyType 15 | 16 | static NSMutableDictionary *types_; 17 | + (void)initialize 18 | { 19 | types_ = [NSMutableDictionary dictionary]; 20 | } 21 | 22 | + (instancetype)cachedTypeWithCode:(NSString *)code 23 | { 24 | MJExtensionAssertParamNotNil2(code, nil); 25 | 26 | MJPropertyType *type = types_[code]; 27 | if (type == nil) { 28 | type = [[self alloc] init]; 29 | type.code = code; 30 | types_[code] = type; 31 | } 32 | return type; 33 | } 34 | 35 | #pragma mark - 公共方法 36 | - (void)setCode:(NSString *)code 37 | { 38 | _code = code; 39 | 40 | MJExtensionAssertParamNotNil(code); 41 | 42 | if ([code isEqualToString:MJPropertyTypeId]) { 43 | _idType = YES; 44 | } else if (code.length == 0) { 45 | _KVCDisabled = YES; 46 | } else if (code.length > 3 && [code hasPrefix:@"@\""]) { 47 | // 去掉@"和",截取中间的类型名称 48 | _code = [code substringWithRange:NSMakeRange(2, code.length - 3)]; 49 | _typeClass = NSClassFromString(_code); 50 | _fromFoundation = [MJFoundation isClassFromFoundation:_typeClass]; 51 | _numberType = [_typeClass isSubclassOfClass:[NSNumber class]]; 52 | 53 | } else if ([code isEqualToString:MJPropertyTypeSEL] || 54 | [code isEqualToString:MJPropertyTypeIvar] || 55 | [code isEqualToString:MJPropertyTypeMethod]) { 56 | _KVCDisabled = YES; 57 | } 58 | 59 | // 是否为数字类型 60 | NSString *lowerCode = _code.lowercaseString; 61 | NSArray *numberTypes = @[MJPropertyTypeInt, MJPropertyTypeShort, MJPropertyTypeBOOL1, MJPropertyTypeBOOL2, MJPropertyTypeFloat, MJPropertyTypeDouble, MJPropertyTypeLong, MJPropertyTypeLongLong, MJPropertyTypeChar]; 62 | if ([numberTypes containsObject:lowerCode]) { 63 | _numberType = YES; 64 | 65 | if ([lowerCode isEqualToString:MJPropertyTypeBOOL1] 66 | || [lowerCode isEqualToString:MJPropertyTypeBOOL2]) { 67 | _boolType = YES; 68 | } 69 | } 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJClass.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 遍历所有类的block(父类) 13 | */ 14 | typedef void (^MJClassesEnumeration)(Class c, BOOL *stop); 15 | 16 | /** 这个数组中的属性名才会进行字典和模型的转换 */ 17 | typedef NSArray * (^MJAllowedPropertyNames)(); 18 | /** 这个数组中的属性名才会进行归档 */ 19 | typedef NSArray * (^MJAllowedCodingPropertyNames)(); 20 | 21 | /** 这个数组中的属性名将会被忽略:不进行字典和模型的转换 */ 22 | typedef NSArray * (^MJIgnoredPropertyNames)(); 23 | /** 这个数组中的属性名将会被忽略:不进行归档 */ 24 | typedef NSArray * (^MJIgnoredCodingPropertyNames)(); 25 | 26 | /** 27 | * 类相关的扩展 28 | */ 29 | @interface NSObject (MJClass) 30 | /** 31 | * 遍历所有的类 32 | */ 33 | + (void)mj_enumerateClasses:(MJClassesEnumeration)enumeration; 34 | + (void)mj_enumerateAllClasses:(MJClassesEnumeration)enumeration; 35 | 36 | #pragma mark - 属性白名单配置 37 | /** 38 | * 这个数组中的属性名才会进行字典和模型的转换 39 | * 40 | * @param allowedPropertyNames 这个数组中的属性名才会进行字典和模型的转换 41 | */ 42 | + (void)mj_setupAllowedPropertyNames:(MJAllowedPropertyNames)allowedPropertyNames; 43 | 44 | /** 45 | * 这个数组中的属性名才会进行字典和模型的转换 46 | */ 47 | + (NSMutableArray *)mj_totalAllowedPropertyNames; 48 | 49 | #pragma mark - 属性黑名单配置 50 | /** 51 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 52 | * 53 | * @param ignoredPropertyNames 这个数组中的属性名将会被忽略:不进行字典和模型的转换 54 | */ 55 | + (void)mj_setupIgnoredPropertyNames:(MJIgnoredPropertyNames)ignoredPropertyNames; 56 | 57 | /** 58 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 59 | */ 60 | + (NSMutableArray *)mj_totalIgnoredPropertyNames; 61 | 62 | #pragma mark - 归档属性白名单配置 63 | /** 64 | * 这个数组中的属性名才会进行归档 65 | * 66 | * @param allowedCodingPropertyNames 这个数组中的属性名才会进行归档 67 | */ 68 | + (void)mj_setupAllowedCodingPropertyNames:(MJAllowedCodingPropertyNames)allowedCodingPropertyNames; 69 | 70 | /** 71 | * 这个数组中的属性名才会进行字典和模型的转换 72 | */ 73 | + (NSMutableArray *)mj_totalAllowedCodingPropertyNames; 74 | 75 | #pragma mark - 归档属性黑名单配置 76 | /** 77 | * 这个数组中的属性名将会被忽略:不进行归档 78 | * 79 | * @param ignoredCodingPropertyNames 这个数组中的属性名将会被忽略:不进行归档 80 | */ 81 | + (void)mj_setupIgnoredCodingPropertyNames:(MJIgnoredCodingPropertyNames)ignoredCodingPropertyNames; 82 | 83 | /** 84 | * 这个数组中的属性名将会被忽略:不进行归档 85 | */ 86 | + (NSMutableArray *)mj_totalIgnoredCodingPropertyNames; 87 | 88 | #pragma mark - 内部使用 89 | + (void)mj_setupBlockReturnValue:(id (^)())block key:(const char *)key; 90 | @end 91 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJClass.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJClass.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJClass.h" 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJKeyValue.h" 12 | #import "MJFoundation.h" 13 | #import 14 | 15 | static const char MJAllowedPropertyNamesKey = '\0'; 16 | static const char MJIgnoredPropertyNamesKey = '\0'; 17 | static const char MJAllowedCodingPropertyNamesKey = '\0'; 18 | static const char MJIgnoredCodingPropertyNamesKey = '\0'; 19 | 20 | static NSMutableDictionary *allowedPropertyNamesDict_; 21 | static NSMutableDictionary *ignoredPropertyNamesDict_; 22 | static NSMutableDictionary *allowedCodingPropertyNamesDict_; 23 | static NSMutableDictionary *ignoredCodingPropertyNamesDict_; 24 | 25 | @implementation NSObject (MJClass) 26 | 27 | + (void)load 28 | { 29 | allowedPropertyNamesDict_ = [NSMutableDictionary dictionary]; 30 | ignoredPropertyNamesDict_ = [NSMutableDictionary dictionary]; 31 | allowedCodingPropertyNamesDict_ = [NSMutableDictionary dictionary]; 32 | ignoredCodingPropertyNamesDict_ = [NSMutableDictionary dictionary]; 33 | } 34 | 35 | + (NSMutableDictionary *)dictForKey:(const void *)key 36 | { 37 | if (key == &MJAllowedPropertyNamesKey) return allowedPropertyNamesDict_; 38 | if (key == &MJIgnoredPropertyNamesKey) return ignoredPropertyNamesDict_; 39 | if (key == &MJAllowedCodingPropertyNamesKey) return allowedCodingPropertyNamesDict_; 40 | if (key == &MJIgnoredCodingPropertyNamesKey) return ignoredCodingPropertyNamesDict_; 41 | return nil; 42 | } 43 | 44 | + (void)mj_enumerateClasses:(MJClassesEnumeration)enumeration 45 | { 46 | // 1.没有block就直接返回 47 | if (enumeration == nil) return; 48 | 49 | // 2.停止遍历的标记 50 | BOOL stop = NO; 51 | 52 | // 3.当前正在遍历的类 53 | Class c = self; 54 | 55 | // 4.开始遍历每一个类 56 | while (c && !stop) { 57 | // 4.1.执行操作 58 | enumeration(c, &stop); 59 | 60 | // 4.2.获得父类 61 | c = class_getSuperclass(c); 62 | 63 | if ([MJFoundation isClassFromFoundation:c]) break; 64 | } 65 | } 66 | 67 | + (void)mj_enumerateAllClasses:(MJClassesEnumeration)enumeration 68 | { 69 | // 1.没有block就直接返回 70 | if (enumeration == nil) return; 71 | 72 | // 2.停止遍历的标记 73 | BOOL stop = NO; 74 | 75 | // 3.当前正在遍历的类 76 | Class c = self; 77 | 78 | // 4.开始遍历每一个类 79 | while (c && !stop) { 80 | // 4.1.执行操作 81 | enumeration(c, &stop); 82 | 83 | // 4.2.获得父类 84 | c = class_getSuperclass(c); 85 | } 86 | } 87 | 88 | #pragma mark - 属性黑名单配置 89 | + (void)mj_setupIgnoredPropertyNames:(MJIgnoredPropertyNames)ignoredPropertyNames 90 | { 91 | [self mj_setupBlockReturnValue:ignoredPropertyNames key:&MJIgnoredPropertyNamesKey]; 92 | } 93 | 94 | + (NSMutableArray *)mj_totalIgnoredPropertyNames 95 | { 96 | return [self mj_totalObjectsWithSelector:@selector(mj_ignoredPropertyNames) key:&MJIgnoredPropertyNamesKey]; 97 | } 98 | 99 | #pragma mark - 归档属性黑名单配置 100 | + (void)mj_setupIgnoredCodingPropertyNames:(MJIgnoredCodingPropertyNames)ignoredCodingPropertyNames 101 | { 102 | [self mj_setupBlockReturnValue:ignoredCodingPropertyNames key:&MJIgnoredCodingPropertyNamesKey]; 103 | } 104 | 105 | + (NSMutableArray *)mj_totalIgnoredCodingPropertyNames 106 | { 107 | return [self mj_totalObjectsWithSelector:@selector(mj_ignoredCodingPropertyNames) key:&MJIgnoredCodingPropertyNamesKey]; 108 | } 109 | 110 | #pragma mark - 属性白名单配置 111 | + (void)mj_setupAllowedPropertyNames:(MJAllowedPropertyNames)allowedPropertyNames; 112 | { 113 | [self mj_setupBlockReturnValue:allowedPropertyNames key:&MJAllowedPropertyNamesKey]; 114 | } 115 | 116 | + (NSMutableArray *)mj_totalAllowedPropertyNames 117 | { 118 | return [self mj_totalObjectsWithSelector:@selector(mj_allowedPropertyNames) key:&MJAllowedPropertyNamesKey]; 119 | } 120 | 121 | #pragma mark - 归档属性白名单配置 122 | + (void)mj_setupAllowedCodingPropertyNames:(MJAllowedCodingPropertyNames)allowedCodingPropertyNames 123 | { 124 | [self mj_setupBlockReturnValue:allowedCodingPropertyNames key:&MJAllowedCodingPropertyNamesKey]; 125 | } 126 | 127 | + (NSMutableArray *)mj_totalAllowedCodingPropertyNames 128 | { 129 | return [self mj_totalObjectsWithSelector:@selector(mj_allowedCodingPropertyNames) key:&MJAllowedCodingPropertyNamesKey]; 130 | } 131 | #pragma mark - block和方法处理:存储block的返回值 132 | + (void)mj_setupBlockReturnValue:(id (^)())block key:(const char *)key 133 | { 134 | if (block) { 135 | objc_setAssociatedObject(self, key, block(), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 136 | } else { 137 | objc_setAssociatedObject(self, key, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 138 | } 139 | 140 | // 清空数据 141 | [[self dictForKey:key] removeAllObjects]; 142 | } 143 | 144 | + (NSMutableArray *)mj_totalObjectsWithSelector:(SEL)selector key:(const char *)key 145 | { 146 | NSMutableArray *array = [self dictForKey:key][NSStringFromClass(self)]; 147 | if (array) return array; 148 | 149 | // 创建、存储 150 | [self dictForKey:key][NSStringFromClass(self)] = array = [NSMutableArray array]; 151 | 152 | if ([self respondsToSelector:selector]) { 153 | #pragma clang diagnostic push 154 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 155 | NSArray *subArray = [self performSelector:selector]; 156 | #pragma clang diagnostic pop 157 | if (subArray) { 158 | [array addObjectsFromArray:subArray]; 159 | } 160 | } 161 | 162 | [self mj_enumerateAllClasses:^(__unsafe_unretained Class c, BOOL *stop) { 163 | NSArray *subArray = objc_getAssociatedObject(c, key); 164 | [array addObjectsFromArray:subArray]; 165 | }]; 166 | return array; 167 | } 168 | @end 169 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | /** 13 | * Codeing协议 14 | */ 15 | @protocol MJCoding 16 | @optional 17 | /** 18 | * 这个数组中的属性名才会进行归档 19 | */ 20 | + (NSArray *)mj_allowedCodingPropertyNames; 21 | /** 22 | * 这个数组中的属性名将会被忽略:不进行归档 23 | */ 24 | + (NSArray *)mj_ignoredCodingPropertyNames; 25 | @end 26 | 27 | @interface NSObject (MJCoding) 28 | /** 29 | * 解码(从文件中解析对象) 30 | */ 31 | - (void)mj_decode:(NSCoder *)decoder; 32 | /** 33 | * 编码(将对象写入文件中) 34 | */ 35 | - (void)mj_encode:(NSCoder *)encoder; 36 | @end 37 | 38 | /** 39 | 归档的实现 40 | */ 41 | #define MJCodingImplementation \ 42 | - (id)initWithCoder:(NSCoder *)decoder \ 43 | { \ 44 | if (self = [super init]) { \ 45 | [self mj_decode:decoder]; \ 46 | } \ 47 | return self; \ 48 | } \ 49 | \ 50 | - (void)encodeWithCoder:(NSCoder *)encoder \ 51 | { \ 52 | [self mj_encode:encoder]; \ 53 | } 54 | 55 | #define MJExtensionCodingImplementation MJCodingImplementation -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJCoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJCoding.h" 10 | #import "NSObject+MJClass.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "MJProperty.h" 13 | 14 | @implementation NSObject (MJCoding) 15 | 16 | - (void)mj_encode:(NSCoder *)encoder 17 | { 18 | Class clazz = [self class]; 19 | 20 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 21 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 22 | 23 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 24 | // 检测是否被忽略 25 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 26 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 27 | 28 | id value = [property valueForObject:self]; 29 | if (value == nil) return; 30 | [encoder encodeObject:value forKey:property.name]; 31 | }]; 32 | } 33 | 34 | - (void)mj_decode:(NSCoder *)decoder 35 | { 36 | Class clazz = [self class]; 37 | 38 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 39 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 40 | 41 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 42 | // 检测是否被忽略 43 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 44 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 45 | 46 | id value = [decoder decodeObjectForKey:property.name]; 47 | if (value == nil) { // 兼容以前的MJExtension版本 48 | value = [decoder decodeObjectForKey:[@"_" stringByAppendingString:property.name]]; 49 | } 50 | if (value == nil) return; 51 | [property setValue:value forObject:self]; 52 | }]; 53 | } 54 | @end 55 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJKeyValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJKeyValue.h 3 | // MJExtension 4 | // 5 | // Created by mj on 13-8-24. 6 | // Copyright (c) 2013年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | #import 12 | #import "MJProperty.h" 13 | 14 | /** 15 | * KeyValue协议 16 | */ 17 | @protocol MJKeyValue 18 | @optional 19 | /** 20 | * 只有这个数组中的属性名才允许进行字典和模型的转换 21 | */ 22 | + (NSArray *)mj_allowedPropertyNames; 23 | 24 | /** 25 | * 这个数组中的属性名将会被忽略:不进行字典和模型的转换 26 | */ 27 | + (NSArray *)mj_ignoredPropertyNames; 28 | 29 | /** 30 | * 将属性名换为其他key去字典中取值 31 | * 32 | * @return 字典中的key是属性名,value是从字典中取值用的key 33 | */ 34 | + (NSDictionary *)mj_replacedKeyFromPropertyName; 35 | 36 | /** 37 | * 将属性名换为其他key去字典中取值 38 | * 39 | * @return 从字典中取值用的key 40 | */ 41 | + (id)mj_replacedKeyFromPropertyName121:(NSString *)propertyName; 42 | 43 | /** 44 | * 数组中需要转换的模型类 45 | * 46 | * @return 字典中的key是数组属性名,value是数组中存放模型的Class(Class类型或者NSString类型) 47 | */ 48 | + (NSDictionary *)mj_objectClassInArray; 49 | 50 | /** 51 | * 旧值换新值,用于过滤字典中的值 52 | * 53 | * @param oldValue 旧值 54 | * 55 | * @return 新值 56 | */ 57 | - (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property; 58 | 59 | /** 60 | * 当字典转模型完毕时调用 61 | */ 62 | - (void)mj_keyValuesDidFinishConvertingToObject; 63 | 64 | /** 65 | * 当模型转字典完毕时调用 66 | */ 67 | - (void)mj_objectDidFinishConvertingToKeyValues; 68 | @end 69 | 70 | @interface NSObject (MJKeyValue) 71 | #pragma mark - 类方法 72 | /** 73 | * 字典转模型过程中遇到的错误 74 | */ 75 | + (NSError *)mj_error; 76 | 77 | /** 78 | * 模型转字典时,字典的key是否参考replacedKeyFromPropertyName等方法(父类设置了,子类也会继承下来) 79 | */ 80 | + (void)mj_referenceReplacedKeyWhenCreatingKeyValues:(BOOL)reference; 81 | 82 | #pragma mark - 对象方法 83 | /** 84 | * 将字典的键值对转成模型属性 85 | * @param keyValues 字典(可以是NSDictionary、NSData、NSString) 86 | */ 87 | - (instancetype)mj_setKeyValues:(id)keyValues; 88 | 89 | /** 90 | * 将字典的键值对转成模型属性 91 | * @param keyValues 字典(可以是NSDictionary、NSData、NSString) 92 | * @param context CoreData上下文 93 | */ 94 | - (instancetype)mj_setKeyValues:(id)keyValues context:(NSManagedObjectContext *)context; 95 | 96 | /** 97 | * 将模型转成字典 98 | * @return 字典 99 | */ 100 | - (NSMutableDictionary *)mj_keyValues; 101 | - (NSMutableDictionary *)mj_keyValuesWithKeys:(NSArray *)keys; 102 | - (NSMutableDictionary *)mj_keyValuesWithIgnoredKeys:(NSArray *)ignoredKeys; 103 | 104 | /** 105 | * 通过模型数组来创建一个字典数组 106 | * @param objectArray 模型数组 107 | * @return 字典数组 108 | */ 109 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray; 110 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys; 111 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray ignoredKeys:(NSArray *)ignoredKeys; 112 | 113 | #pragma mark - 字典转模型 114 | /** 115 | * 通过字典来创建一个模型 116 | * @param keyValues 字典(可以是NSDictionary、NSData、NSString) 117 | * @return 新建的对象 118 | */ 119 | + (instancetype)mj_objectWithKeyValues:(id)keyValues; 120 | 121 | /** 122 | * 通过字典来创建一个CoreData模型 123 | * @param keyValues 字典(可以是NSDictionary、NSData、NSString) 124 | * @param context CoreData上下文 125 | * @return 新建的对象 126 | */ 127 | + (instancetype)mj_objectWithKeyValues:(id)keyValues context:(NSManagedObjectContext *)context; 128 | 129 | /** 130 | * 通过plist来创建一个模型 131 | * @param filename 文件名(仅限于mainBundle中的文件) 132 | * @return 新建的对象 133 | */ 134 | + (instancetype)mj_objectWithFilename:(NSString *)filename; 135 | 136 | /** 137 | * 通过plist来创建一个模型 138 | * @param file 文件全路径 139 | * @return 新建的对象 140 | */ 141 | + (instancetype)mj_objectWithFile:(NSString *)file; 142 | 143 | #pragma mark - 字典数组转模型数组 144 | /** 145 | * 通过字典数组来创建一个模型数组 146 | * @param keyValuesArray 字典数组(可以是NSDictionary、NSData、NSString) 147 | * @return 模型数组 148 | */ 149 | + (NSMutableArray *)mj_objectArrayWithKeyValuesArray:(id)keyValuesArray; 150 | 151 | /** 152 | * 通过字典数组来创建一个模型数组 153 | * @param keyValuesArray 字典数组(可以是NSDictionary、NSData、NSString) 154 | * @param context CoreData上下文 155 | * @return 模型数组 156 | */ 157 | + (NSMutableArray *)mj_objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context; 158 | 159 | /** 160 | * 通过plist来创建一个模型数组 161 | * @param filename 文件名(仅限于mainBundle中的文件) 162 | * @return 模型数组 163 | */ 164 | + (NSMutableArray *)mj_objectArrayWithFilename:(NSString *)filename; 165 | 166 | /** 167 | * 通过plist来创建一个模型数组 168 | * @param file 文件全路径 169 | * @return 模型数组 170 | */ 171 | + (NSMutableArray *)mj_objectArrayWithFile:(NSString *)file; 172 | 173 | #pragma mark - 转换为JSON 174 | /** 175 | * 转换为JSON Data 176 | */ 177 | - (NSData *)mj_JSONData; 178 | /** 179 | * 转换为字典或者数组 180 | */ 181 | - (id)mj_JSONObject; 182 | /** 183 | * 转换为JSON 字符串 184 | */ 185 | - (NSString *)mj_JSONString; 186 | @end 187 | 188 | @interface NSObject (MJKeyValueDeprecated_v_2_5_16) 189 | - (instancetype)setKeyValues:(id)keyValue MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 190 | - (instancetype)setKeyValues:(id)keyValues error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 191 | - (instancetype)setKeyValues:(id)keyValues context:(NSManagedObjectContext *)context MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 192 | - (instancetype)setKeyValues:(id)keyValues context:(NSManagedObjectContext *)context error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 193 | + (void)referenceReplacedKeyWhenCreatingKeyValues:(BOOL)reference MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 194 | - (NSMutableDictionary *)keyValues MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 195 | - (NSMutableDictionary *)keyValuesWithError:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 196 | - (NSMutableDictionary *)keyValuesWithKeys:(NSArray *)keys MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 197 | - (NSMutableDictionary *)keyValuesWithKeys:(NSArray *)keys error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 198 | - (NSMutableDictionary *)keyValuesWithIgnoredKeys:(NSArray *)ignoredKeys MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 199 | - (NSMutableDictionary *)keyValuesWithIgnoredKeys:(NSArray *)ignoredKeys error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 200 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 201 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 202 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 203 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 204 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray ignoredKeys:(NSArray *)ignoredKeys MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 205 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray ignoredKeys:(NSArray *)ignoredKeys error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 206 | + (instancetype)objectWithKeyValues:(id)keyValues MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 207 | + (instancetype)objectWithKeyValues:(id)keyValues error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 208 | + (instancetype)objectWithKeyValues:(id)keyValues context:(NSManagedObjectContext *)context MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 209 | + (instancetype)objectWithKeyValues:(id)keyValues context:(NSManagedObjectContext *)context error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 210 | + (instancetype)objectWithFilename:(NSString *)filename MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 211 | + (instancetype)objectWithFilename:(NSString *)filename error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 212 | + (instancetype)objectWithFile:(NSString *)file MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 213 | + (instancetype)objectWithFile:(NSString *)file error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 214 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 215 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 216 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 217 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 218 | + (NSMutableArray *)objectArrayWithFilename:(NSString *)filename MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 219 | + (NSMutableArray *)objectArrayWithFilename:(NSString *)filename error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 220 | + (NSMutableArray *)objectArrayWithFile:(NSString *)file MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 221 | + (NSMutableArray *)objectArrayWithFile:(NSString *)file error:(NSError **)error MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 222 | - (NSData *)JSONData MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 223 | - (id)JSONObject MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 224 | - (NSString *)JSONString MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 225 | @end 226 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJKeyValue.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJKeyValue.m 3 | // MJExtension 4 | // 5 | // Created by mj on 13-8-24. 6 | // Copyright (c) 2013年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJKeyValue.h" 10 | #import "NSObject+MJProperty.h" 11 | #import "NSString+MJExtension.h" 12 | #import "MJProperty.h" 13 | #import "MJPropertyType.h" 14 | #import "MJExtensionConst.h" 15 | #import "MJFoundation.h" 16 | #import "NSString+MJExtension.h" 17 | #import "NSObject+MJClass.h" 18 | 19 | @implementation NSObject (MJKeyValue) 20 | 21 | #pragma mark - 错误 22 | static const char MJErrorKey = '\0'; 23 | + (NSError *)mj_error 24 | { 25 | return objc_getAssociatedObject(self, &MJErrorKey); 26 | } 27 | 28 | + (void)setMj_error:(NSError *)error 29 | { 30 | objc_setAssociatedObject(self, &MJErrorKey, error, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 31 | } 32 | 33 | #pragma mark - 模型 -> 字典时的参考 34 | /** 模型转字典时,字典的key是否参考replacedKeyFromPropertyName等方法(父类设置了,子类也会继承下来) */ 35 | static const char MJReferenceReplacedKeyWhenCreatingKeyValuesKey = '\0'; 36 | 37 | + (void)mj_referenceReplacedKeyWhenCreatingKeyValues:(BOOL)reference 38 | { 39 | objc_setAssociatedObject(self, &MJReferenceReplacedKeyWhenCreatingKeyValuesKey, @(reference), OBJC_ASSOCIATION_ASSIGN); 40 | } 41 | 42 | + (BOOL)mj_isReferenceReplacedKeyWhenCreatingKeyValues 43 | { 44 | __block id value = objc_getAssociatedObject(self, &MJReferenceReplacedKeyWhenCreatingKeyValuesKey); 45 | if (!value) { 46 | [self mj_enumerateAllClasses:^(__unsafe_unretained Class c, BOOL *stop) { 47 | value = objc_getAssociatedObject(c, &MJReferenceReplacedKeyWhenCreatingKeyValuesKey); 48 | 49 | if (value) *stop = YES; 50 | }]; 51 | } 52 | return [value boolValue]; 53 | } 54 | 55 | #pragma mark - --常用的对象-- 56 | static NSNumberFormatter *numberFormatter_; 57 | + (void)load 58 | { 59 | numberFormatter_ = [[NSNumberFormatter alloc] init]; 60 | 61 | // 默认设置 62 | [self mj_referenceReplacedKeyWhenCreatingKeyValues:YES]; 63 | } 64 | 65 | #pragma mark - --公共方法-- 66 | #pragma mark - 字典 -> 模型 67 | - (instancetype)mj_setKeyValues:(id)keyValues 68 | { 69 | return [self mj_setKeyValues:keyValues context:nil]; 70 | } 71 | 72 | /** 73 | 核心代码: 74 | */ 75 | - (instancetype)mj_setKeyValues:(id)keyValues context:(NSManagedObjectContext *)context 76 | { 77 | // 获得JSON对象 78 | keyValues = [keyValues mj_JSONObject]; 79 | 80 | MJExtensionAssertError([keyValues isKindOfClass:[NSDictionary class]], self, [self class], @"keyValues参数不是一个字典"); 81 | 82 | Class clazz = [self class]; 83 | NSArray *allowedPropertyNames = [clazz mj_totalAllowedPropertyNames]; 84 | NSArray *ignoredPropertyNames = [clazz mj_totalIgnoredPropertyNames]; 85 | 86 | //通过封装的方法回调一个通过运行时编写的,用于返回属性列表的方法。 87 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 88 | @try { 89 | // 0.检测是否被忽略 90 | if (allowedPropertyNames.count && ![allowedPropertyNames containsObject:property.name]) return; 91 | if ([ignoredPropertyNames containsObject:property.name]) return; 92 | 93 | // 1.取出属性值 94 | id value; 95 | NSArray *propertyKeyses = [property propertyKeysForClass:clazz]; 96 | for (NSArray *propertyKeys in propertyKeyses) { 97 | value = keyValues; 98 | for (MJPropertyKey *propertyKey in propertyKeys) { 99 | value = [propertyKey valueInObject:value]; 100 | } 101 | if (value) break; 102 | } 103 | 104 | // 值的过滤 105 | id newValue = [clazz mj_getNewValueFromObject:self oldValue:value property:property]; 106 | if (newValue != value) { // 有过滤后的新值 107 | [property setValue:newValue forObject:self]; 108 | return; 109 | } 110 | 111 | // 如果没有值,就直接返回 112 | if (!value || value == [NSNull null]) return; 113 | 114 | // 2.复杂处理 115 | MJPropertyType *type = property.type; 116 | Class propertyClass = type.typeClass; 117 | Class objectClass = [property objectClassInArrayForClass:[self class]]; 118 | 119 | // 不可变 -> 可变处理 120 | if (propertyClass == [NSMutableArray class] && [value isKindOfClass:[NSArray class]]) { 121 | value = [NSMutableArray arrayWithArray:value]; 122 | } else if (propertyClass == [NSMutableDictionary class] && [value isKindOfClass:[NSDictionary class]]) { 123 | value = [NSMutableDictionary dictionaryWithDictionary:value]; 124 | } else if (propertyClass == [NSMutableString class] && [value isKindOfClass:[NSString class]]) { 125 | value = [NSMutableString stringWithString:value]; 126 | } else if (propertyClass == [NSMutableData class] && [value isKindOfClass:[NSData class]]) { 127 | value = [NSMutableData dataWithData:value]; 128 | } 129 | 130 | if (!type.isFromFoundation && propertyClass) { // 模型属性 131 | value = [propertyClass mj_objectWithKeyValues:value context:context]; 132 | } else if (objectClass) { 133 | if (objectClass == [NSURL class] && [value isKindOfClass:[NSArray class]]) { 134 | // string array -> url array 135 | NSMutableArray *urlArray = [NSMutableArray array]; 136 | for (NSString *string in value) { 137 | if (![string isKindOfClass:[NSString class]]) continue; 138 | [urlArray addObject:string.mj_url]; 139 | } 140 | value = urlArray; 141 | } else { // 字典数组-->模型数组 142 | value = [objectClass mj_objectArrayWithKeyValuesArray:value context:context]; 143 | } 144 | } else { 145 | if (propertyClass == [NSString class]) { 146 | if ([value isKindOfClass:[NSNumber class]]) { 147 | // NSNumber -> NSString 148 | value = [value description]; 149 | } else if ([value isKindOfClass:[NSURL class]]) { 150 | // NSURL -> NSString 151 | value = [value absoluteString]; 152 | } 153 | } else if ([value isKindOfClass:[NSString class]]) { 154 | if (propertyClass == [NSURL class]) { 155 | // NSString -> NSURL 156 | // 字符串转码 157 | value = [value mj_url]; 158 | } else if (type.isNumberType) { 159 | NSString *oldValue = value; 160 | 161 | // NSString -> NSNumber 162 | if (type.typeClass == [NSDecimalNumber class]) { 163 | value = [NSDecimalNumber decimalNumberWithString:oldValue]; 164 | } else { 165 | value = [numberFormatter_ numberFromString:oldValue]; 166 | } 167 | 168 | // 如果是BOOL 169 | if (type.isBoolType) { 170 | // 字符串转BOOL(字符串没有charValue方法) 171 | // 系统会调用字符串的charValue转为BOOL类型 172 | NSString *lower = [oldValue lowercaseString]; 173 | if ([lower isEqualToString:@"yes"] || [lower isEqualToString:@"true"]) { 174 | value = @YES; 175 | } else if ([lower isEqualToString:@"no"] || [lower isEqualToString:@"false"]) { 176 | value = @NO; 177 | } 178 | } 179 | } 180 | } 181 | 182 | // value和property类型不匹配 183 | if (propertyClass && ![value isKindOfClass:propertyClass]) { 184 | value = nil; 185 | } 186 | } 187 | 188 | // 3.赋值 189 | [property setValue:value forObject:self]; 190 | } @catch (NSException *exception) { 191 | MJExtensionBuildError([self class], exception.reason); 192 | MJExtensionLog(@"%@", exception); 193 | } 194 | }]; 195 | 196 | // 转换完毕 197 | if ([self respondsToSelector:@selector(mj_keyValuesDidFinishConvertingToObject)]) { 198 | [self mj_keyValuesDidFinishConvertingToObject]; 199 | } 200 | return self; 201 | } 202 | 203 | + (instancetype)mj_objectWithKeyValues:(id)keyValues 204 | { 205 | return [self mj_objectWithKeyValues:keyValues context:nil]; 206 | } 207 | 208 | + (instancetype)mj_objectWithKeyValues:(id)keyValues context:(NSManagedObjectContext *)context 209 | { 210 | // 获得JSON对象 211 | keyValues = [keyValues mj_JSONObject]; 212 | MJExtensionAssertError([keyValues isKindOfClass:[NSDictionary class]], nil, [self class], @"keyValues参数不是一个字典"); 213 | 214 | if ([self isSubclassOfClass:[NSManagedObject class]] && context) { 215 | return [[NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass(self) inManagedObjectContext:context] mj_setKeyValues:keyValues context:context]; 216 | } 217 | return [[[self alloc] init] mj_setKeyValues:keyValues]; 218 | } 219 | 220 | + (instancetype)mj_objectWithFilename:(NSString *)filename 221 | { 222 | MJExtensionAssertError(filename != nil, nil, [self class], @"filename参数为nil"); 223 | 224 | return [self mj_objectWithFile:[[NSBundle mainBundle] pathForResource:filename ofType:nil]]; 225 | } 226 | 227 | + (instancetype)mj_objectWithFile:(NSString *)file 228 | { 229 | MJExtensionAssertError(file != nil, nil, [self class], @"file参数为nil"); 230 | 231 | return [self mj_objectWithKeyValues:[NSDictionary dictionaryWithContentsOfFile:file]]; 232 | } 233 | 234 | #pragma mark - 字典数组 -> 模型数组 235 | + (NSMutableArray *)mj_objectArrayWithKeyValuesArray:(NSArray *)keyValuesArray 236 | { 237 | return [self mj_objectArrayWithKeyValuesArray:keyValuesArray context:nil]; 238 | } 239 | 240 | + (NSMutableArray *)mj_objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context 241 | { 242 | // 如果是JSON字符串 243 | keyValuesArray = [keyValuesArray mj_JSONObject]; 244 | 245 | // 1.判断真实性 246 | MJExtensionAssertError([keyValuesArray isKindOfClass:[NSArray class]], nil, [self class], @"keyValuesArray参数不是一个数组"); 247 | 248 | // 如果数组里面放的是NSString、NSNumber等数据 249 | if ([MJFoundation isClassFromFoundation:self]) return [NSMutableArray arrayWithArray:keyValuesArray]; 250 | 251 | 252 | // 2.创建数组 253 | NSMutableArray *modelArray = [NSMutableArray array]; 254 | 255 | // 3.遍历 256 | for (NSDictionary *keyValues in keyValuesArray) { 257 | if ([keyValues isKindOfClass:[NSArray class]]){ 258 | [modelArray addObject:[self mj_objectArrayWithKeyValuesArray:keyValues context:context]]; 259 | } else { 260 | id model = [self mj_objectWithKeyValues:keyValues context:context]; 261 | if (model) [modelArray addObject:model]; 262 | } 263 | } 264 | 265 | return modelArray; 266 | } 267 | 268 | + (NSMutableArray *)mj_objectArrayWithFilename:(NSString *)filename 269 | { 270 | MJExtensionAssertError(filename != nil, nil, [self class], @"filename参数为nil"); 271 | 272 | return [self mj_objectArrayWithFile:[[NSBundle mainBundle] pathForResource:filename ofType:nil]]; 273 | } 274 | 275 | + (NSMutableArray *)mj_objectArrayWithFile:(NSString *)file 276 | { 277 | MJExtensionAssertError(file != nil, nil, [self class], @"file参数为nil"); 278 | 279 | return [self mj_objectArrayWithKeyValuesArray:[NSArray arrayWithContentsOfFile:file]]; 280 | } 281 | 282 | #pragma mark - 模型 -> 字典 283 | - (NSMutableDictionary *)mj_keyValues 284 | { 285 | return [self mj_keyValuesWithKeys:nil ignoredKeys:nil]; 286 | } 287 | 288 | - (NSMutableDictionary *)mj_keyValuesWithKeys:(NSArray *)keys 289 | { 290 | return [self mj_keyValuesWithKeys:keys ignoredKeys:nil]; 291 | } 292 | 293 | - (NSMutableDictionary *)mj_keyValuesWithIgnoredKeys:(NSArray *)ignoredKeys 294 | { 295 | return [self mj_keyValuesWithKeys:nil ignoredKeys:ignoredKeys]; 296 | } 297 | 298 | - (NSMutableDictionary *)mj_keyValuesWithKeys:(NSArray *)keys ignoredKeys:(NSArray *)ignoredKeys 299 | { 300 | // 如果自己不是模型类, 那就返回自己 301 | MJExtensionAssertError(![MJFoundation isClassFromFoundation:[self class]], (NSMutableDictionary *)self, [self class], @"不是自定义的模型类") 302 | 303 | id keyValues = [NSMutableDictionary dictionary]; 304 | 305 | Class clazz = [self class]; 306 | NSArray *allowedPropertyNames = [clazz mj_totalAllowedPropertyNames]; 307 | NSArray *ignoredPropertyNames = [clazz mj_totalIgnoredPropertyNames]; 308 | 309 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 310 | @try { 311 | // 0.检测是否被忽略 312 | if (allowedPropertyNames.count && ![allowedPropertyNames containsObject:property.name]) return; 313 | if ([ignoredPropertyNames containsObject:property.name]) return; 314 | if (keys.count && ![keys containsObject:property.name]) return; 315 | if ([ignoredKeys containsObject:property.name]) return; 316 | 317 | // 1.取出属性值 318 | id value = [property valueForObject:self]; 319 | if (!value) return; 320 | 321 | // 2.如果是模型属性 322 | MJPropertyType *type = property.type; 323 | Class propertyClass = type.typeClass; 324 | if (!type.isFromFoundation && propertyClass) { 325 | value = [value mj_keyValues]; 326 | } else if ([value isKindOfClass:[NSArray class]]) { 327 | // 3.处理数组里面有模型的情况 328 | value = [NSObject mj_keyValuesArrayWithObjectArray:value]; 329 | } else if (propertyClass == [NSURL class]) { 330 | value = [value absoluteString]; 331 | } 332 | 333 | // 4.赋值 334 | if ([clazz mj_isReferenceReplacedKeyWhenCreatingKeyValues]) { 335 | NSArray *propertyKeys = [[property propertyKeysForClass:clazz] firstObject]; 336 | NSUInteger keyCount = propertyKeys.count; 337 | // 创建字典 338 | __block id innerContainer = keyValues; 339 | [propertyKeys enumerateObjectsUsingBlock:^(MJPropertyKey *propertyKey, NSUInteger idx, BOOL *stop) { 340 | // 下一个属性 341 | MJPropertyKey *nextPropertyKey = nil; 342 | if (idx != keyCount - 1) { 343 | nextPropertyKey = propertyKeys[idx + 1]; 344 | } 345 | 346 | if (nextPropertyKey) { // 不是最后一个key 347 | // 当前propertyKey对应的字典或者数组 348 | id tempInnerContainer = [propertyKey valueInObject:innerContainer]; 349 | if (tempInnerContainer == nil || [tempInnerContainer isKindOfClass:[NSNull class]]) { 350 | if (nextPropertyKey.type == MJPropertyKeyTypeDictionary) { 351 | tempInnerContainer = [NSMutableDictionary dictionary]; 352 | } else { 353 | tempInnerContainer = [NSMutableArray array]; 354 | } 355 | if (propertyKey.type == MJPropertyKeyTypeDictionary) { 356 | innerContainer[propertyKey.name] = tempInnerContainer; 357 | } else { 358 | innerContainer[propertyKey.name.intValue] = tempInnerContainer; 359 | } 360 | } 361 | 362 | if ([tempInnerContainer isKindOfClass:[NSMutableArray class]]) { 363 | NSMutableArray *tempInnerContainerArray = tempInnerContainer; 364 | int index = nextPropertyKey.name.intValue; 365 | while (tempInnerContainerArray.count < index + 1) { 366 | [tempInnerContainerArray addObject:[NSNull null]]; 367 | } 368 | } 369 | 370 | innerContainer = tempInnerContainer; 371 | } else { // 最后一个key 372 | if (propertyKey.type == MJPropertyKeyTypeDictionary) { 373 | innerContainer[propertyKey.name] = value; 374 | } else { 375 | innerContainer[propertyKey.name.intValue] = value; 376 | } 377 | } 378 | }]; 379 | } else { 380 | keyValues[property.name] = value; 381 | } 382 | } @catch (NSException *exception) { 383 | MJExtensionBuildError([self class], exception.reason); 384 | MJExtensionLog(@"%@", exception); 385 | } 386 | }]; 387 | 388 | // 转换完毕 389 | if ([self respondsToSelector:@selector(mj_objectDidFinishConvertingToKeyValues)]) { 390 | [self mj_objectDidFinishConvertingToKeyValues]; 391 | } 392 | 393 | return keyValues; 394 | } 395 | #pragma mark - 模型数组 -> 字典数组 396 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray 397 | { 398 | return [self mj_keyValuesArrayWithObjectArray:objectArray keys:nil ignoredKeys:nil]; 399 | } 400 | 401 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys 402 | { 403 | return [self mj_keyValuesArrayWithObjectArray:objectArray keys:keys ignoredKeys:nil]; 404 | } 405 | 406 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray ignoredKeys:(NSArray *)ignoredKeys 407 | { 408 | return [self mj_keyValuesArrayWithObjectArray:objectArray keys:nil ignoredKeys:ignoredKeys]; 409 | } 410 | 411 | + (NSMutableArray *)mj_keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys ignoredKeys:(NSArray *)ignoredKeys 412 | { 413 | // 0.判断真实性 414 | MJExtensionAssertError([objectArray isKindOfClass:[NSArray class]], nil, [self class], @"objectArray参数不是一个数组"); 415 | 416 | // 1.创建数组 417 | NSMutableArray *keyValuesArray = [NSMutableArray array]; 418 | for (id object in objectArray) { 419 | if (keys) { 420 | [keyValuesArray addObject:[object mj_keyValuesWithKeys:keys]]; 421 | } else { 422 | [keyValuesArray addObject:[object mj_keyValuesWithIgnoredKeys:ignoredKeys]]; 423 | } 424 | } 425 | return keyValuesArray; 426 | } 427 | 428 | #pragma mark - 转换为JSON 429 | - (NSData *)mj_JSONData 430 | { 431 | if ([self isKindOfClass:[NSString class]]) { 432 | return [((NSString *)self) dataUsingEncoding:NSUTF8StringEncoding]; 433 | } else if ([self isKindOfClass:[NSData class]]) { 434 | return (NSData *)self; 435 | } 436 | 437 | return [NSJSONSerialization dataWithJSONObject:[self mj_JSONObject] options:kNilOptions error:nil]; 438 | } 439 | 440 | - (id)mj_JSONObject 441 | { 442 | if ([self isKindOfClass:[NSString class]]) { 443 | return [NSJSONSerialization JSONObjectWithData:[((NSString *)self) dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil]; 444 | } else if ([self isKindOfClass:[NSData class]]) { 445 | return [NSJSONSerialization JSONObjectWithData:(NSData *)self options:kNilOptions error:nil]; 446 | } 447 | 448 | return self.mj_keyValues; 449 | } 450 | 451 | - (NSString *)mj_JSONString 452 | { 453 | if ([self isKindOfClass:[NSString class]]) { 454 | return (NSString *)self; 455 | } else if ([self isKindOfClass:[NSData class]]) { 456 | return [[NSString alloc] initWithData:(NSData *)self encoding:NSUTF8StringEncoding]; 457 | } 458 | 459 | return [[NSString alloc] initWithData:[self mj_JSONData] encoding:NSUTF8StringEncoding]; 460 | } 461 | @end 462 | 463 | @implementation NSObject (MJKeyValueDeprecated_v_2_5_16) 464 | - (instancetype)setKeyValues:(id)keyValues 465 | { 466 | return [self mj_setKeyValues:keyValues]; 467 | } 468 | 469 | - (instancetype)setKeyValues:(id)keyValues error:(NSError **)error 470 | { 471 | id value = [self mj_setKeyValues:keyValues]; 472 | if (error != NULL) { 473 | *error = [self.class mj_error]; 474 | } 475 | return value; 476 | 477 | } 478 | 479 | - (instancetype)setKeyValues:(id)keyValues context:(NSManagedObjectContext *)context 480 | { 481 | return [self mj_setKeyValues:keyValues context:context]; 482 | } 483 | 484 | - (instancetype)setKeyValues:(id)keyValues context:(NSManagedObjectContext *)context error:(NSError **)error 485 | { 486 | id value = [self mj_setKeyValues:keyValues context:context]; 487 | if (error != NULL) { 488 | *error = [self.class mj_error]; 489 | } 490 | return value; 491 | } 492 | 493 | + (void)referenceReplacedKeyWhenCreatingKeyValues:(BOOL)reference 494 | { 495 | [self mj_referenceReplacedKeyWhenCreatingKeyValues:reference]; 496 | } 497 | 498 | - (NSMutableDictionary *)keyValues 499 | { 500 | return [self mj_keyValues]; 501 | } 502 | 503 | - (NSMutableDictionary *)keyValuesWithError:(NSError **)error 504 | { 505 | id value = [self mj_keyValues]; 506 | if (error != NULL) { 507 | *error = [self.class mj_error]; 508 | } 509 | return value; 510 | } 511 | 512 | - (NSMutableDictionary *)keyValuesWithKeys:(NSArray *)keys 513 | { 514 | return [self mj_keyValuesWithKeys:keys]; 515 | } 516 | 517 | - (NSMutableDictionary *)keyValuesWithKeys:(NSArray *)keys error:(NSError **)error 518 | { 519 | id value = [self mj_keyValuesWithKeys:keys]; 520 | if (error != NULL) { 521 | *error = [self.class mj_error]; 522 | } 523 | return value; 524 | } 525 | 526 | - (NSMutableDictionary *)keyValuesWithIgnoredKeys:(NSArray *)ignoredKeys 527 | { 528 | return [self mj_keyValuesWithIgnoredKeys:ignoredKeys]; 529 | } 530 | 531 | - (NSMutableDictionary *)keyValuesWithIgnoredKeys:(NSArray *)ignoredKeys error:(NSError **)error 532 | { 533 | id value = [self mj_keyValuesWithIgnoredKeys:ignoredKeys]; 534 | if (error != NULL) { 535 | *error = [self.class mj_error]; 536 | } 537 | return value; 538 | } 539 | 540 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray 541 | { 542 | return [self mj_keyValuesArrayWithObjectArray:objectArray]; 543 | } 544 | 545 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray error:(NSError **)error 546 | { 547 | id value = [self mj_keyValuesArrayWithObjectArray:objectArray]; 548 | if (error != NULL) { 549 | *error = [self mj_error]; 550 | } 551 | return value; 552 | } 553 | 554 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys 555 | { 556 | return [self mj_keyValuesArrayWithObjectArray:objectArray keys:keys]; 557 | } 558 | 559 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray keys:(NSArray *)keys error:(NSError **)error 560 | { 561 | id value = [self mj_keyValuesArrayWithObjectArray:objectArray keys:keys]; 562 | if (error != NULL) { 563 | *error = [self mj_error]; 564 | } 565 | return value; 566 | } 567 | 568 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray ignoredKeys:(NSArray *)ignoredKeys 569 | { 570 | return [self mj_keyValuesArrayWithObjectArray:objectArray ignoredKeys:ignoredKeys]; 571 | } 572 | 573 | + (NSMutableArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray ignoredKeys:(NSArray *)ignoredKeys error:(NSError **)error 574 | { 575 | id value = [self mj_keyValuesArrayWithObjectArray:objectArray ignoredKeys:ignoredKeys]; 576 | if (error != NULL) { 577 | *error = [self mj_error]; 578 | } 579 | return value; 580 | } 581 | 582 | + (instancetype)objectWithKeyValues:(id)keyValues 583 | { 584 | return [self mj_objectWithKeyValues:keyValues]; 585 | } 586 | 587 | + (instancetype)objectWithKeyValues:(id)keyValues error:(NSError **)error 588 | { 589 | id value = [self mj_objectWithKeyValues:keyValues]; 590 | if (error != NULL) { 591 | *error = [self mj_error]; 592 | } 593 | return value; 594 | } 595 | 596 | + (instancetype)objectWithKeyValues:(id)keyValues context:(NSManagedObjectContext *)context 597 | { 598 | return [self mj_objectWithKeyValues:keyValues context:context]; 599 | } 600 | 601 | + (instancetype)objectWithKeyValues:(id)keyValues context:(NSManagedObjectContext *)context error:(NSError **)error 602 | { 603 | id value = [self mj_objectWithKeyValues:keyValues context:context]; 604 | if (error != NULL) { 605 | *error = [self mj_error]; 606 | } 607 | return value; 608 | } 609 | 610 | + (instancetype)objectWithFilename:(NSString *)filename 611 | { 612 | return [self mj_objectWithFilename:filename]; 613 | } 614 | 615 | + (instancetype)objectWithFilename:(NSString *)filename error:(NSError **)error 616 | { 617 | id value = [self mj_objectWithFilename:filename]; 618 | if (error != NULL) { 619 | *error = [self mj_error]; 620 | } 621 | return value; 622 | } 623 | 624 | + (instancetype)objectWithFile:(NSString *)file 625 | { 626 | return [self mj_objectWithFile:file]; 627 | } 628 | 629 | + (instancetype)objectWithFile:(NSString *)file error:(NSError **)error 630 | { 631 | id value = [self mj_objectWithFile:file]; 632 | if (error != NULL) { 633 | *error = [self mj_error]; 634 | } 635 | return value; 636 | } 637 | 638 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray 639 | { 640 | return [self mj_objectArrayWithKeyValuesArray:keyValuesArray]; 641 | } 642 | 643 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray error:(NSError **)error 644 | { 645 | id value = [self mj_objectArrayWithKeyValuesArray:keyValuesArray]; 646 | if (error != NULL) { 647 | *error = [self mj_error]; 648 | } 649 | return value; 650 | } 651 | 652 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context 653 | { 654 | return [self mj_objectArrayWithKeyValuesArray:keyValuesArray context:context]; 655 | } 656 | 657 | + (NSMutableArray *)objectArrayWithKeyValuesArray:(id)keyValuesArray context:(NSManagedObjectContext *)context error:(NSError **)error 658 | { 659 | id value = [self mj_objectArrayWithKeyValuesArray:keyValuesArray context:context]; 660 | if (error != NULL) { 661 | *error = [self mj_error]; 662 | } 663 | return value; 664 | } 665 | 666 | + (NSMutableArray *)objectArrayWithFilename:(NSString *)filename 667 | { 668 | return [self mj_objectArrayWithFilename:filename]; 669 | } 670 | 671 | + (NSMutableArray *)objectArrayWithFilename:(NSString *)filename error:(NSError **)error 672 | { 673 | id value = [self mj_objectArrayWithFilename:filename]; 674 | if (error != NULL) { 675 | *error = [self mj_error]; 676 | } 677 | return value; 678 | } 679 | 680 | + (NSMutableArray *)objectArrayWithFile:(NSString *)file 681 | { 682 | return [self mj_objectArrayWithFile:file]; 683 | } 684 | 685 | + (NSMutableArray *)objectArrayWithFile:(NSString *)file error:(NSError **)error 686 | { 687 | id value = [self mj_objectArrayWithFile:file]; 688 | if (error != NULL) { 689 | *error = [self mj_error]; 690 | } 691 | return value; 692 | } 693 | 694 | - (NSData *)JSONData 695 | { 696 | return [self mj_JSONData]; 697 | } 698 | 699 | - (id)JSONObject 700 | { 701 | return [self mj_JSONObject]; 702 | } 703 | 704 | - (NSString *)JSONString 705 | { 706 | return [self mj_JSONString]; 707 | } 708 | @end -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @class MJProperty; 13 | 14 | /** 15 | * 遍历成员变量用的block 16 | * 17 | * @param property 成员的包装对象 18 | * @param stop YES代表停止遍历,NO代表继续遍历 19 | */ 20 | typedef void (^MJPropertiesEnumeration)(MJProperty *property, BOOL *stop); 21 | 22 | /** 将属性名换为其他key去字典中取值 */ 23 | typedef NSDictionary * (^MJReplacedKeyFromPropertyName)(); 24 | typedef id (^MJReplacedKeyFromPropertyName121)(NSString *propertyName); 25 | /** 数组中需要转换的模型类 */ 26 | typedef NSDictionary * (^MJObjectClassInArray)(); 27 | /** 用于过滤字典中的值 */ 28 | typedef id (^MJNewValueFromOldValue)(id object, id oldValue, MJProperty *property); 29 | 30 | /** 31 | * 成员属性相关的扩展 32 | */ 33 | @interface NSObject (MJProperty) 34 | #pragma mark - 遍历 35 | /** 36 | * 遍历所有的成员 37 | */ 38 | + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration; 39 | 40 | #pragma mark - 新值配置 41 | /** 42 | * 用于过滤字典中的值 43 | * 44 | * @param newValueFormOldValue 用于过滤字典中的值 45 | */ 46 | + (void)mj_setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue; 47 | + (id)mj_getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property; 48 | 49 | #pragma mark - key配置 50 | /** 51 | * 将属性名换为其他key去字典中取值 52 | * 53 | * @param replacedKeyFromPropertyName 将属性名换为其他key去字典中取值 54 | */ 55 | + (void)mj_setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName; 56 | /** 57 | * 将属性名换为其他key去字典中取值 58 | * 59 | * @param replacedKeyFromPropertyName121 将属性名换为其他key去字典中取值 60 | */ 61 | + (void)mj_setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121; 62 | 63 | #pragma mark - array model class配置 64 | /** 65 | * 数组中需要转换的模型类 66 | * 67 | * @param objectClassInArray 数组中需要转换的模型类 68 | */ 69 | + (void)mj_setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray; 70 | @end 71 | 72 | @interface NSObject (MJPropertyDeprecated_v_2_5_16) 73 | + (void)enumerateProperties:(MJPropertiesEnumeration)enumeration MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 74 | + (void)setupNewValueFromOldValue:(MJNewValueFromOldValue)newValueFormOldValue MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 75 | + (id)getNewValueFromObject:(__unsafe_unretained id)object oldValue:(__unsafe_unretained id)oldValue property:(__unsafe_unretained MJProperty *)property MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 76 | + (void)setupReplacedKeyFromPropertyName:(MJReplacedKeyFromPropertyName)replacedKeyFromPropertyName MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 77 | + (void)setupReplacedKeyFromPropertyName121:(MJReplacedKeyFromPropertyName121)replacedKeyFromPropertyName121 MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 78 | + (void)setupObjectClassInArray:(MJObjectClassInArray)objectClassInArray MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 79 | @end -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSObject+MJProperty.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJProperty.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJProperty.h" 10 | #import "NSObject+MJKeyValue.h" 11 | #import "NSObject+MJCoding.h" 12 | #import "NSObject+MJClass.h" 13 | #import "MJProperty.h" 14 | #import "MJFoundation.h" 15 | #import 16 | 17 | #pragma clang diagnostic push 18 | #pragma clang diagnostic ignored "-Wundeclared-selector" 19 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 20 | 21 | static const char MJReplacedKeyFromPropertyNameKey = '\0'; 22 | static const char MJReplacedKeyFromPropertyName121Key = '\0'; 23 | static const char MJNewValueFromOldValueKey = '\0'; 24 | static const char MJObjectClassInArrayKey = '\0'; 25 | 26 | static const char MJCachedPropertiesKey = '\0'; 27 | 28 | @implementation NSObject (Property) 29 | 30 | static NSMutableDictionary *replacedKeyFromPropertyNameDict_; 31 | static NSMutableDictionary *replacedKeyFromPropertyName121Dict_; 32 | static NSMutableDictionary *newValueFromOldValueDict_; 33 | static NSMutableDictionary *objectClassInArrayDict_; 34 | static NSMutableDictionary *cachedPropertiesDict_; 35 | 36 | + (void)load 37 | { 38 | replacedKeyFromPropertyNameDict_ = [NSMutableDictionary dictionary]; 39 | replacedKeyFromPropertyName121Dict_ = [NSMutableDictionary dictionary]; 40 | newValueFromOldValueDict_ = [NSMutableDictionary dictionary]; 41 | objectClassInArrayDict_ = [NSMutableDictionary dictionary]; 42 | cachedPropertiesDict_ = [NSMutableDictionary dictionary]; 43 | } 44 | 45 | + (NSMutableDictionary *)dictForKey:(const void *)key 46 | { 47 | if (key == &MJReplacedKeyFromPropertyNameKey) return replacedKeyFromPropertyNameDict_; 48 | if (key == &MJReplacedKeyFromPropertyName121Key) return replacedKeyFromPropertyName121Dict_; 49 | if (key == &MJNewValueFromOldValueKey) return newValueFromOldValueDict_; 50 | if (key == &MJObjectClassInArrayKey) return objectClassInArrayDict_; 51 | if (key == &MJCachedPropertiesKey) return cachedPropertiesDict_; 52 | return nil; 53 | } 54 | 55 | #pragma mark - --私有方法-- 56 | + (id)propertyKey:(NSString *)propertyName 57 | { 58 | MJExtensionAssertParamNotNil2(propertyName, nil); 59 | 60 | __block id key = nil; 61 | // 查看有没有需要替换的key 62 | if ([self respondsToSelector:@selector(mj_replacedKeyFromPropertyName121:)]) { 63 | key = [self mj_replacedKeyFromPropertyName121:propertyName]; 64 | } 65 | // 兼容旧版本 66 | if ([self respondsToSelector:@selector(replacedKeyFromPropertyName121:)]) { 67 | key = [self performSelector:@selector(replacedKeyFromPropertyName121) withObject:propertyName]; 68 | } 69 | 70 | // 调用block 71 | if (!key) { 72 | [self mj_enumerateAllClasses:^(__unsafe_unretained Class c, BOOL *stop) { 73 | MJReplacedKeyFromPropertyName121 block = objc_getAssociatedObject(c, &MJReplacedKeyFromPropertyName121Key); 74 | if (block) { 75 | key = block(propertyName); 76 | } 77 | if (key) *stop = YES; 78 | }]; 79 | } 80 | 81 | // 查看有没有需要替换的key 82 | if ((!key || [key isEqual:propertyName]) && [self respondsToSelector:@selector(mj_replacedKeyFromPropertyName)]) { 83 | key = [self mj_replacedKeyFromPropertyName][propertyName]; 84 | } 85 | // 兼容旧版本 86 | if ((!key || [key isEqual:propertyName]) && [self respondsToSelector:@selector(replacedKeyFromPropertyName)]) { 87 | key = [self performSelector:@selector(replacedKeyFromPropertyName)][propertyName]; 88 | } 89 | 90 | if (!key || [key isEqual:propertyName]) { 91 | [self mj_enumerateAllClasses:^(__unsafe_unretained Class c, BOOL *stop) { 92 | NSDictionary *dict = objc_getAssociatedObject(c, &MJReplacedKeyFromPropertyNameKey); 93 | if (dict) { 94 | key = dict[propertyName]; 95 | } 96 | if (key && ![key isEqual:propertyName]) *stop = YES; 97 | }]; 98 | } 99 | 100 | // 2.用属性名作为key 101 | if (!key) key = propertyName; 102 | 103 | return key; 104 | } 105 | 106 | + (Class)propertyObjectClassInArray:(NSString *)propertyName 107 | { 108 | __block id clazz = nil; 109 | if ([self respondsToSelector:@selector(mj_objectClassInArray)]) { 110 | clazz = [self mj_objectClassInArray][propertyName]; 111 | } 112 | // 兼容旧版本 113 | if ([self respondsToSelector:@selector(objectClassInArray)]) { 114 | clazz = [self performSelector:@selector(objectClassInArray)][propertyName]; 115 | } 116 | 117 | if (!clazz) { 118 | [self mj_enumerateAllClasses:^(__unsafe_unretained Class c, BOOL *stop) { 119 | NSDictionary *dict = objc_getAssociatedObject(c, &MJObjectClassInArrayKey); 120 | if (dict) { 121 | clazz = dict[propertyName]; 122 | } 123 | if (clazz) *stop = YES; 124 | }]; 125 | } 126 | 127 | // 如果是NSString类型 128 | if ([clazz isKindOfClass:[NSString class]]) { 129 | clazz = NSClassFromString(clazz); 130 | } 131 | return clazz; 132 | } 133 | 134 | #pragma mark - --公共方法-- 135 | + (void)mj_enumerateProperties:(MJPropertiesEnumeration)enumeration 136 | { 137 | // 获得成员变量 138 | NSArray *cachedProperties = [self properties]; 139 | 140 | // 遍历成员变量 141 | BOOL stop = NO; 142 | for (MJProperty *property in cachedProperties) { 143 | enumeration(property, &stop); 144 | if (stop) break; 145 | } 146 | } 147 | 148 | #pragma mark - 公共方法 149 | + (NSMutableArray *)properties 150 | { 151 | NSMutableArray *cachedProperties = [self dictForKey:&MJCachedPropertiesKey][NSStringFromClass(self)]; 152 | 153 | if (cachedProperties == nil) { 154 | cachedProperties = [NSMutableArray array]; 155 | 156 | [self mj_enumerateClasses:^(__unsafe_unretained Class c, BOOL *stop) { 157 | // 1.获得所有的成员变量 158 | unsigned int outCount = 0; 159 | objc_property_t *properties = class_copyPropertyList(c, &outCount); 160 | 161 | // 2.遍历每一个成员变量 162 | for (unsigned int i = 0; i 10 | #import "MJExtensionConst.h" 11 | 12 | @interface NSString (MJExtension) 13 | /** 14 | * 驼峰转下划线(loveYou -> love_you) 15 | */ 16 | - (NSString *)mj_underlineFromCamel; 17 | /** 18 | * 下划线转驼峰(love_you -> loveYou) 19 | */ 20 | - (NSString *)mj_camelFromUnderline; 21 | /** 22 | * 首字母变大写 23 | */ 24 | - (NSString *)mj_firstCharUpper; 25 | /** 26 | * 首字母变小写 27 | */ 28 | - (NSString *)mj_firstCharLower; 29 | 30 | - (BOOL)mj_isPureInt; 31 | 32 | - (NSURL *)mj_url; 33 | @end 34 | 35 | @interface NSString (MJExtensionDeprecated_v_2_5_16) 36 | - (NSString *)underlineFromCamel MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 37 | - (NSString *)camelFromUnderline MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 38 | - (NSString *)firstCharUpper MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 39 | - (NSString *)firstCharLower MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 40 | - (BOOL)isPureInt MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 41 | - (NSURL *)url MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 42 | @end 43 | -------------------------------------------------------------------------------- /GWLZCDM/Lib/MJExtension/NSString+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSString+MJExtension.h" 10 | 11 | @implementation NSString (MJExtension) 12 | - (NSString *)mj_underlineFromCamel 13 | { 14 | if (self.length == 0) return self; 15 | NSMutableString *string = [NSMutableString string]; 16 | for (NSUInteger i = 0; i= 2) [string appendString:[cmp substringFromIndex:1]]; 40 | } else { 41 | [string appendString:cmp]; 42 | } 43 | } 44 | return string; 45 | } 46 | 47 | - (NSString *)mj_firstCharLower 48 | { 49 | if (self.length == 0) return self; 50 | NSMutableString *string = [NSMutableString string]; 51 | [string appendString:[NSString stringWithFormat:@"%c", [self characterAtIndex:0]].lowercaseString]; 52 | if (self.length >= 2) [string appendString:[self substringFromIndex:1]]; 53 | return string; 54 | } 55 | 56 | - (NSString *)mj_firstCharUpper 57 | { 58 | if (self.length == 0) return self; 59 | NSMutableString *string = [NSMutableString string]; 60 | [string appendString:[NSString stringWithFormat:@"%c", [self characterAtIndex:0]].uppercaseString]; 61 | if (self.length >= 2) [string appendString:[self substringFromIndex:1]]; 62 | return string; 63 | } 64 | 65 | - (BOOL)mj_isPureInt 66 | { 67 | NSScanner *scan = [NSScanner scannerWithString:self]; 68 | int val; 69 | return [scan scanInt:&val] && [scan isAtEnd]; 70 | } 71 | 72 | - (NSURL *)mj_url 73 | { 74 | // [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"!$&'()*+,-./:;=?@_~%#[]"]]; 75 | 76 | return [NSURL URLWithString:(NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, (CFStringRef)@"!$&'()*+,-./:;=?@_~%#[]", NULL,kCFStringEncodingUTF8))]; 77 | } 78 | @end 79 | 80 | @implementation NSString (MJExtensionDeprecated_v_2_5_16) 81 | - (NSString *)underlineFromCamel 82 | { 83 | return self.mj_underlineFromCamel; 84 | } 85 | 86 | - (NSString *)camelFromUnderline 87 | { 88 | return self.mj_camelFromUnderline; 89 | } 90 | 91 | - (NSString *)firstCharLower 92 | { 93 | return self.mj_firstCharLower; 94 | } 95 | 96 | - (NSString *)firstCharUpper 97 | { 98 | return self.mj_firstCharUpper; 99 | } 100 | 101 | - (BOOL)isPureInt 102 | { 103 | return self.mj_isPureInt; 104 | } 105 | 106 | - (NSURL *)url 107 | { 108 | return self.mj_url; 109 | } 110 | @end 111 | -------------------------------------------------------------------------------- /GWLZCDM/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /GWLZCDM/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "FilmModel.h" 11 | #import "CaibdeCollectionViewCell.h" 12 | #import "FilmViewController.h" 13 | #import "CaibdeNavController.h" 14 | #define kPadding 10 15 | #define kItemOfLine 3 16 | 17 | @interface ViewController () 18 | /** 19 | * 电影数据的数组 20 | */ 21 | @property (nonatomic, strong) NSArray *filmArray; 22 | /** 23 | * 布局 24 | */ 25 | @property (nonatomic, strong) UICollectionViewFlowLayout *filmCollectionLayout; 26 | /** 27 | * CollectionView 28 | */ 29 | @property (nonatomic, strong) UICollectionView *filmCollectionView; 30 | @end 31 | 32 | @implementation ViewController 33 | 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | self.view.backgroundColor = [UIColor whiteColor]; 39 | self.title = @"电影列表"; 40 | 41 | [self setUpUI]; 42 | } 43 | - (void)viewWillAppear:(BOOL)animated{ 44 | [super viewWillAppear:animated]; 45 | if (self.navigationController.navigationBar.hidden) { 46 | self.navigationController.navigationBar.hidden = NO; 47 | } 48 | } 49 | 50 | - (void)didReceiveMemoryWarning { 51 | [super didReceiveMemoryWarning]; 52 | // Dispose of any resources that can be recreated. 53 | } 54 | #pragma mark - UI 55 | - (void)setUpUI{ 56 | [self creatCollectionView]; 57 | } 58 | - (void)creatCollectionView{ 59 | //FlowLayOut 60 | CGFloat width = (self.view.bounds.size.width - kPadding*(kItemOfLine +1))/kItemOfLine; 61 | self.filmCollectionLayout = [[UICollectionViewFlowLayout alloc]init]; 62 | self.filmCollectionLayout.itemSize = CGSizeMake(width, width*1.5); 63 | self.filmCollectionLayout.minimumLineSpacing = 2*kPadding; 64 | self.filmCollectionLayout.minimumInteritemSpacing = kPadding; 65 | //CollectionView 66 | self.filmCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height-64) collectionViewLayout:self.filmCollectionLayout]; 67 | self.filmCollectionView.delegate = self; 68 | self.filmCollectionView.dataSource = self; 69 | [self.filmCollectionView registerClass:[CaibdeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([CaibdeCollectionViewCell class])]; 70 | self.filmCollectionView.backgroundColor = [UIColor clearColor]; 71 | [self.view addSubview:self.filmCollectionView]; 72 | } 73 | #pragma mark - UICollectionView 74 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ 75 | return 1; 76 | } 77 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ 78 | return self.filmArray.count; 79 | } 80 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ 81 | CaibdeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([CaibdeCollectionViewCell class]) forIndexPath:indexPath]; 82 | FilmModel *model = self.filmArray[indexPath.row]; 83 | [cell updateData:model withIndexPath:indexPath]; 84 | return cell; 85 | } 86 | #pragma mark - UICollectionViewDelegate 87 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ 88 | FilmViewController *filmVC = [[FilmViewController alloc]init]; 89 | CaibdeCollectionViewCell *cell = (CaibdeCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath]; 90 | FilmModel *model = self.filmArray[indexPath.row]; 91 | filmVC.name = model.name; 92 | filmVC.cover = model.cover; 93 | filmVC.image = model.image; 94 | filmVC.width = cell.filmImageView.bounds.size.width; 95 | filmVC.height = cell.filmImageView.bounds.size.height; 96 | 97 | [((CaibdeNavController *)self.navigationController) pushViewController:filmVC withImageView:cell.filmImageView desRect:CGRectMake(20, 150, cell.filmImageView.bounds.size.width, cell.filmImageView.bounds.size.height)]; 98 | } 99 | #pragma mark - Lazy Load 100 | - (NSArray *)filmArray{ 101 | if (!_filmArray) { 102 | _filmArray = [FilmModel filmArray]; 103 | } 104 | return _filmArray; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /GWLZCDM/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/1.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/10.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/11.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/12.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/13.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/14.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/15.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/2.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/3.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/4.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/5.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/6.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/7.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/8.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/9.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/bg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/bg1.png -------------------------------------------------------------------------------- /GWLZCDM/images/c1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c1.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c10.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c11.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c12.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c13.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c14.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c15.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c2.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c3.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c4.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c5.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c6.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c7.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c8.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/c9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/c9.jpg -------------------------------------------------------------------------------- /GWLZCDM/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cAibDe/GWLZCDM/ac6f28fb2373e7f211f8e65e92cd56ae72c11300/GWLZCDM/images/close.png -------------------------------------------------------------------------------- /GWLZCDM/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GWLZCDM 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. 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 | -------------------------------------------------------------------------------- /GWLZCDMTests/GWLZCDMTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GWLZCDMTests.m 3 | // GWLZCDMTests 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GWLZCDMTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation GWLZCDMTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /GWLZCDMTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /GWLZCDMUITests/GWLZCDMUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GWLZCDMUITests.m 3 | // GWLZCDMUITests 4 | // 5 | // Created by cAibDe on 16/8/24. 6 | // Copyright © 2016年 cAibDe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GWLZCDMUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation GWLZCDMUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /GWLZCDMUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GWLZCDM 2 | 这是我在别人哪里学到的一个类似于格瓦拉电影的转场动画,我在里面改了一下,用一个导航控制器去执行不同的Push效果 3 | #PUSH 4 | 这是带有动画效果的一个Push 5 | ```objc 6 | - (void)pushViewController:(UIViewController *)viewController isAnimation:(BOOL)isAnimation{ 7 | self.isAnimation = isAnimation; 8 | self.isPush = YES; 9 | [super pushViewController:viewController animated:YES]; 10 | } 11 | ``` 12 | 当self.isAnimation = YES;Push就会带有那种动画的效果,反之就不会带有动画效果; 13 | 14 | 15 | 16 | #POP 17 | 这个就是返回的时候不带有动画效果的方法 18 | ```objc 19 | -(UIViewController *)popViewControllerAnimated:(BOOL)animated{ 20 | self.isPush = NO; 21 | return [super popViewControllerAnimated:animated]; 22 | } 23 | ``` 24 | 这就是返回的时候带有效果的Pop 25 | ```objc 26 | - (UIViewController *)popViewControllerWithAnimated:(BOOL)animated isAnimation:(BOOL)isAnimation{ 27 | self.isPush = NO; 28 | self.isAnimation = isAnimation; 29 | return [super popViewControllerAnimated:animated]; 30 | } 31 | ``` 32 | # 讨论 33 | 最近有个朋友给我提了一个小问题,说是第二个界面滑动的时候,电影海报会有个BUG,这里我做了改进。 34 | 我们可以再CaibdeAnimation这个类中的push代码模块中- (void)cAibDePushAnimation{}这个方法里面的一个代码注释掉就可以解决了,这个代码就是[contentView bringSubviewToFront:imageView]; 35 | --------------------------------------------------------------------------------