├── PushTransitionDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── liuyufeng.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── liuyufeng.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── sjimac01.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── PushTransitionDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Define.h ├── HomeCell.h ├── HomeCell.m ├── HomeDetailViewController.h ├── HomeDetailViewController.m ├── HomeImage │ ├── Home_demo_01.png │ ├── Home_demo_02.png │ ├── Home_demo_03.png │ ├── Mine_photo_define@2x.png │ └── Mine_photo_define@3x.png ├── HomeViewController.h ├── HomeViewController.m ├── Info.plist ├── Others │ ├── CenterViewController.h │ ├── CenterViewController.m │ ├── CommunityViewController.h │ ├── CommunityViewController.m │ ├── FunctionViewController.h │ ├── FunctionViewController.m │ ├── MineViewController.h │ ├── MineViewController.m │ ├── UIColor+ConvertColor.h │ ├── UIColor+ConvertColor.m │ ├── UILabel+Size.h │ ├── UILabel+Size.m │ ├── WBTool.h │ └── WBTool.m ├── TabbarCostom │ ├── TabBarController.h │ ├── TabBarController.m │ ├── Tabbar.h │ └── Tabbar.m ├── TabbarImage │ ├── TB_community_normal@3x.png │ ├── TB_community_press@3x.png │ ├── TB_function_normal@3x.png │ ├── TB_function_press@3x.png │ ├── TB_home_normal@3x.png │ ├── TB_home_press@3x.png │ ├── TB_mine_normal@3x.png │ ├── TB_mine_press@3x.png │ ├── homePage_saoyisao@2x.png │ └── homePage_saoyisao@3x.png ├── ViewController.h ├── ViewController.m └── main.m ├── README.md └── pushDemoImage.png /PushTransitionDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4F0EFE1920284E52003A2330 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE1820284E52003A2330 /* AppDelegate.m */; }; 11 | 4F0EFE1C20284E52003A2330 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE1B20284E52003A2330 /* ViewController.m */; }; 12 | 4F0EFE1F20284E52003A2330 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE1D20284E52003A2330 /* Main.storyboard */; }; 13 | 4F0EFE2120284E52003A2330 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE2020284E52003A2330 /* Assets.xcassets */; }; 14 | 4F0EFE2420284E52003A2330 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE2220284E52003A2330 /* LaunchScreen.storyboard */; }; 15 | 4F0EFE2720284E52003A2330 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE2620284E52003A2330 /* main.m */; }; 16 | 4F0EFE3D20284E95003A2330 /* Tabbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE2F20284E95003A2330 /* Tabbar.m */; }; 17 | 4F0EFE3E20284E95003A2330 /* TabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3120284E95003A2330 /* TabBarController.m */; }; 18 | 4F0EFE3F20284E95003A2330 /* homePage_saoyisao@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3320284E95003A2330 /* homePage_saoyisao@2x.png */; }; 19 | 4F0EFE4020284E95003A2330 /* homePage_saoyisao@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3420284E95003A2330 /* homePage_saoyisao@3x.png */; }; 20 | 4F0EFE4120284E95003A2330 /* TB_community_normal@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3520284E95003A2330 /* TB_community_normal@3x.png */; }; 21 | 4F0EFE4220284E95003A2330 /* TB_community_press@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3620284E95003A2330 /* TB_community_press@3x.png */; }; 22 | 4F0EFE4320284E95003A2330 /* TB_function_normal@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3720284E95003A2330 /* TB_function_normal@3x.png */; }; 23 | 4F0EFE4420284E95003A2330 /* TB_function_press@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3820284E95003A2330 /* TB_function_press@3x.png */; }; 24 | 4F0EFE4520284E95003A2330 /* TB_home_normal@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3920284E95003A2330 /* TB_home_normal@3x.png */; }; 25 | 4F0EFE4620284E95003A2330 /* TB_home_press@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3A20284E95003A2330 /* TB_home_press@3x.png */; }; 26 | 4F0EFE4720284E95003A2330 /* TB_mine_normal@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3B20284E95003A2330 /* TB_mine_normal@3x.png */; }; 27 | 4F0EFE4820284E95003A2330 /* TB_mine_press@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE3C20284E95003A2330 /* TB_mine_press@3x.png */; }; 28 | 4F0EFE5320284EEF003A2330 /* CenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE4A20284EEE003A2330 /* CenterViewController.m */; }; 29 | 4F0EFE5420284EEF003A2330 /* FunctionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE4E20284EEF003A2330 /* FunctionViewController.m */; }; 30 | 4F0EFE5520284EEF003A2330 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE4F20284EEF003A2330 /* HomeViewController.m */; }; 31 | 4F0EFE5620284EEF003A2330 /* MineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE5020284EEF003A2330 /* MineViewController.m */; }; 32 | 4F0EFE5720284EEF003A2330 /* CommunityViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE5220284EEF003A2330 /* CommunityViewController.m */; }; 33 | 4F0EFE5C20285069003A2330 /* Home_demo_01.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE5920285069003A2330 /* Home_demo_01.png */; }; 34 | 4F0EFE5D20285069003A2330 /* Home_demo_02.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE5A20285069003A2330 /* Home_demo_02.png */; }; 35 | 4F0EFE5E20285069003A2330 /* Home_demo_03.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE5B20285069003A2330 /* Home_demo_03.png */; }; 36 | 4F0EFE6120285087003A2330 /* HomeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE6020285087003A2330 /* HomeCell.m */; }; 37 | 4F0EFE65202850A7003A2330 /* HomeDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE64202850A7003A2330 /* HomeDetailViewController.m */; }; 38 | 4F0EFE6C20285479003A2330 /* UILabel+Size.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE6820285479003A2330 /* UILabel+Size.m */; }; 39 | 4F0EFE6D20285479003A2330 /* UIColor+ConvertColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE6B20285479003A2330 /* UIColor+ConvertColor.m */; }; 40 | 4F0EFE70202855B0003A2330 /* WBTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F0EFE6F202855B0003A2330 /* WBTool.m */; }; 41 | 4F0EFE73202856C7003A2330 /* Mine_photo_define@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE71202856C7003A2330 /* Mine_photo_define@2x.png */; }; 42 | 4F0EFE74202856C7003A2330 /* Mine_photo_define@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F0EFE72202856C7003A2330 /* Mine_photo_define@3x.png */; }; 43 | /* End PBXBuildFile section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 4F0EFE1420284E52003A2330 /* PushTransitionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PushTransitionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 4F0EFE1720284E52003A2330 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 4F0EFE1820284E52003A2330 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 4F0EFE1A20284E52003A2330 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 50 | 4F0EFE1B20284E52003A2330 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 51 | 4F0EFE1E20284E52003A2330 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 52 | 4F0EFE2020284E52003A2330 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 53 | 4F0EFE2320284E52003A2330 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 54 | 4F0EFE2520284E52003A2330 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 4F0EFE2620284E52003A2330 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 4F0EFE2E20284E95003A2330 /* Tabbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tabbar.h; sourceTree = ""; }; 57 | 4F0EFE2F20284E95003A2330 /* Tabbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tabbar.m; sourceTree = ""; }; 58 | 4F0EFE3020284E95003A2330 /* TabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabBarController.h; sourceTree = ""; }; 59 | 4F0EFE3120284E95003A2330 /* TabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TabBarController.m; sourceTree = ""; }; 60 | 4F0EFE3320284E95003A2330 /* homePage_saoyisao@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "homePage_saoyisao@2x.png"; sourceTree = ""; }; 61 | 4F0EFE3420284E95003A2330 /* homePage_saoyisao@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "homePage_saoyisao@3x.png"; sourceTree = ""; }; 62 | 4F0EFE3520284E95003A2330 /* TB_community_normal@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_community_normal@3x.png"; sourceTree = ""; }; 63 | 4F0EFE3620284E95003A2330 /* TB_community_press@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_community_press@3x.png"; sourceTree = ""; }; 64 | 4F0EFE3720284E95003A2330 /* TB_function_normal@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_function_normal@3x.png"; sourceTree = ""; }; 65 | 4F0EFE3820284E95003A2330 /* TB_function_press@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_function_press@3x.png"; sourceTree = ""; }; 66 | 4F0EFE3920284E95003A2330 /* TB_home_normal@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_home_normal@3x.png"; sourceTree = ""; }; 67 | 4F0EFE3A20284E95003A2330 /* TB_home_press@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_home_press@3x.png"; sourceTree = ""; }; 68 | 4F0EFE3B20284E95003A2330 /* TB_mine_normal@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_mine_normal@3x.png"; sourceTree = ""; }; 69 | 4F0EFE3C20284E95003A2330 /* TB_mine_press@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "TB_mine_press@3x.png"; sourceTree = ""; }; 70 | 4F0EFE4920284EEE003A2330 /* CommunityViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommunityViewController.h; sourceTree = ""; }; 71 | 4F0EFE4A20284EEE003A2330 /* CenterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CenterViewController.m; sourceTree = ""; }; 72 | 4F0EFE4B20284EEF003A2330 /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = ""; }; 73 | 4F0EFE4C20284EEF003A2330 /* MineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineViewController.h; sourceTree = ""; }; 74 | 4F0EFE4D20284EEF003A2330 /* FunctionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionViewController.h; sourceTree = ""; }; 75 | 4F0EFE4E20284EEF003A2330 /* FunctionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunctionViewController.m; sourceTree = ""; }; 76 | 4F0EFE4F20284EEF003A2330 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = ""; }; 77 | 4F0EFE5020284EEF003A2330 /* MineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineViewController.m; sourceTree = ""; }; 78 | 4F0EFE5120284EEF003A2330 /* CenterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CenterViewController.h; sourceTree = ""; }; 79 | 4F0EFE5220284EEF003A2330 /* CommunityViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommunityViewController.m; sourceTree = ""; }; 80 | 4F0EFE5920285069003A2330 /* Home_demo_01.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Home_demo_01.png; sourceTree = ""; }; 81 | 4F0EFE5A20285069003A2330 /* Home_demo_02.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Home_demo_02.png; sourceTree = ""; }; 82 | 4F0EFE5B20285069003A2330 /* Home_demo_03.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Home_demo_03.png; sourceTree = ""; }; 83 | 4F0EFE5F20285087003A2330 /* HomeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeCell.h; sourceTree = ""; }; 84 | 4F0EFE6020285087003A2330 /* HomeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeCell.m; sourceTree = ""; }; 85 | 4F0EFE63202850A7003A2330 /* HomeDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeDetailViewController.h; sourceTree = ""; }; 86 | 4F0EFE64202850A7003A2330 /* HomeDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeDetailViewController.m; sourceTree = ""; }; 87 | 4F0EFE67202851AC003A2330 /* Define.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Define.h; sourceTree = ""; }; 88 | 4F0EFE6820285479003A2330 /* UILabel+Size.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Size.m"; sourceTree = ""; }; 89 | 4F0EFE6920285479003A2330 /* UIColor+ConvertColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+ConvertColor.h"; sourceTree = ""; }; 90 | 4F0EFE6A20285479003A2330 /* UILabel+Size.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Size.h"; sourceTree = ""; }; 91 | 4F0EFE6B20285479003A2330 /* UIColor+ConvertColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+ConvertColor.m"; sourceTree = ""; }; 92 | 4F0EFE6E202855B0003A2330 /* WBTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WBTool.h; sourceTree = ""; }; 93 | 4F0EFE6F202855B0003A2330 /* WBTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WBTool.m; sourceTree = ""; }; 94 | 4F0EFE71202856C7003A2330 /* Mine_photo_define@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Mine_photo_define@2x.png"; sourceTree = ""; }; 95 | 4F0EFE72202856C7003A2330 /* Mine_photo_define@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Mine_photo_define@3x.png"; sourceTree = ""; }; 96 | /* End PBXFileReference section */ 97 | 98 | /* Begin PBXFrameworksBuildPhase section */ 99 | 4F0EFE1120284E52003A2330 /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | /* End PBXFrameworksBuildPhase section */ 107 | 108 | /* Begin PBXGroup section */ 109 | 4F0EFE0B20284E52003A2330 = { 110 | isa = PBXGroup; 111 | children = ( 112 | 4F0EFE1620284E52003A2330 /* PushTransitionDemo */, 113 | 4F0EFE1520284E52003A2330 /* Products */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 4F0EFE1520284E52003A2330 /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 4F0EFE1420284E52003A2330 /* PushTransitionDemo.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 4F0EFE1620284E52003A2330 /* PushTransitionDemo */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 4F0EFE5820285069003A2330 /* HomeImage */, 129 | 4F0EFE4B20284EEF003A2330 /* HomeViewController.h */, 130 | 4F0EFE4F20284EEF003A2330 /* HomeViewController.m */, 131 | 4F0EFE5F20285087003A2330 /* HomeCell.h */, 132 | 4F0EFE6020285087003A2330 /* HomeCell.m */, 133 | 4F0EFE63202850A7003A2330 /* HomeDetailViewController.h */, 134 | 4F0EFE64202850A7003A2330 /* HomeDetailViewController.m */, 135 | 4F0EFE66202850AF003A2330 /* Others */, 136 | 4F0EFE2D20284E95003A2330 /* TabbarCostom */, 137 | 4F0EFE3220284E95003A2330 /* TabbarImage */, 138 | 4F0EFE1720284E52003A2330 /* AppDelegate.h */, 139 | 4F0EFE1820284E52003A2330 /* AppDelegate.m */, 140 | 4F0EFE1A20284E52003A2330 /* ViewController.h */, 141 | 4F0EFE1B20284E52003A2330 /* ViewController.m */, 142 | 4F0EFE67202851AC003A2330 /* Define.h */, 143 | 4F0EFE1D20284E52003A2330 /* Main.storyboard */, 144 | 4F0EFE2020284E52003A2330 /* Assets.xcassets */, 145 | 4F0EFE2220284E52003A2330 /* LaunchScreen.storyboard */, 146 | 4F0EFE2520284E52003A2330 /* Info.plist */, 147 | 4F0EFE2620284E52003A2330 /* main.m */, 148 | ); 149 | path = PushTransitionDemo; 150 | sourceTree = ""; 151 | }; 152 | 4F0EFE2D20284E95003A2330 /* TabbarCostom */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 4F0EFE2E20284E95003A2330 /* Tabbar.h */, 156 | 4F0EFE2F20284E95003A2330 /* Tabbar.m */, 157 | 4F0EFE3020284E95003A2330 /* TabBarController.h */, 158 | 4F0EFE3120284E95003A2330 /* TabBarController.m */, 159 | ); 160 | path = TabbarCostom; 161 | sourceTree = ""; 162 | }; 163 | 4F0EFE3220284E95003A2330 /* TabbarImage */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 4F0EFE3320284E95003A2330 /* homePage_saoyisao@2x.png */, 167 | 4F0EFE3420284E95003A2330 /* homePage_saoyisao@3x.png */, 168 | 4F0EFE3520284E95003A2330 /* TB_community_normal@3x.png */, 169 | 4F0EFE3620284E95003A2330 /* TB_community_press@3x.png */, 170 | 4F0EFE3720284E95003A2330 /* TB_function_normal@3x.png */, 171 | 4F0EFE3820284E95003A2330 /* TB_function_press@3x.png */, 172 | 4F0EFE3920284E95003A2330 /* TB_home_normal@3x.png */, 173 | 4F0EFE3A20284E95003A2330 /* TB_home_press@3x.png */, 174 | 4F0EFE3B20284E95003A2330 /* TB_mine_normal@3x.png */, 175 | 4F0EFE3C20284E95003A2330 /* TB_mine_press@3x.png */, 176 | ); 177 | path = TabbarImage; 178 | sourceTree = ""; 179 | }; 180 | 4F0EFE5820285069003A2330 /* HomeImage */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 4F0EFE71202856C7003A2330 /* Mine_photo_define@2x.png */, 184 | 4F0EFE72202856C7003A2330 /* Mine_photo_define@3x.png */, 185 | 4F0EFE5920285069003A2330 /* Home_demo_01.png */, 186 | 4F0EFE5A20285069003A2330 /* Home_demo_02.png */, 187 | 4F0EFE5B20285069003A2330 /* Home_demo_03.png */, 188 | ); 189 | path = HomeImage; 190 | sourceTree = ""; 191 | }; 192 | 4F0EFE66202850AF003A2330 /* Others */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 4F0EFE6E202855B0003A2330 /* WBTool.h */, 196 | 4F0EFE6F202855B0003A2330 /* WBTool.m */, 197 | 4F0EFE6920285479003A2330 /* UIColor+ConvertColor.h */, 198 | 4F0EFE6B20285479003A2330 /* UIColor+ConvertColor.m */, 199 | 4F0EFE6A20285479003A2330 /* UILabel+Size.h */, 200 | 4F0EFE6820285479003A2330 /* UILabel+Size.m */, 201 | 4F0EFE5120284EEF003A2330 /* CenterViewController.h */, 202 | 4F0EFE4A20284EEE003A2330 /* CenterViewController.m */, 203 | 4F0EFE4920284EEE003A2330 /* CommunityViewController.h */, 204 | 4F0EFE5220284EEF003A2330 /* CommunityViewController.m */, 205 | 4F0EFE4D20284EEF003A2330 /* FunctionViewController.h */, 206 | 4F0EFE4E20284EEF003A2330 /* FunctionViewController.m */, 207 | 4F0EFE4C20284EEF003A2330 /* MineViewController.h */, 208 | 4F0EFE5020284EEF003A2330 /* MineViewController.m */, 209 | ); 210 | path = Others; 211 | sourceTree = ""; 212 | }; 213 | /* End PBXGroup section */ 214 | 215 | /* Begin PBXNativeTarget section */ 216 | 4F0EFE1320284E52003A2330 /* PushTransitionDemo */ = { 217 | isa = PBXNativeTarget; 218 | buildConfigurationList = 4F0EFE2A20284E52003A2330 /* Build configuration list for PBXNativeTarget "PushTransitionDemo" */; 219 | buildPhases = ( 220 | 4F0EFE1020284E52003A2330 /* Sources */, 221 | 4F0EFE1120284E52003A2330 /* Frameworks */, 222 | 4F0EFE1220284E52003A2330 /* Resources */, 223 | ); 224 | buildRules = ( 225 | ); 226 | dependencies = ( 227 | ); 228 | name = PushTransitionDemo; 229 | productName = PushTransitionDemo; 230 | productReference = 4F0EFE1420284E52003A2330 /* PushTransitionDemo.app */; 231 | productType = "com.apple.product-type.application"; 232 | }; 233 | /* End PBXNativeTarget section */ 234 | 235 | /* Begin PBXProject section */ 236 | 4F0EFE0C20284E52003A2330 /* Project object */ = { 237 | isa = PBXProject; 238 | attributes = { 239 | LastUpgradeCheck = 0920; 240 | ORGANIZATIONNAME = sjimac01; 241 | TargetAttributes = { 242 | 4F0EFE1320284E52003A2330 = { 243 | CreatedOnToolsVersion = 9.2; 244 | ProvisioningStyle = Automatic; 245 | }; 246 | }; 247 | }; 248 | buildConfigurationList = 4F0EFE0F20284E52003A2330 /* Build configuration list for PBXProject "PushTransitionDemo" */; 249 | compatibilityVersion = "Xcode 8.0"; 250 | developmentRegion = en; 251 | hasScannedForEncodings = 0; 252 | knownRegions = ( 253 | en, 254 | Base, 255 | ); 256 | mainGroup = 4F0EFE0B20284E52003A2330; 257 | productRefGroup = 4F0EFE1520284E52003A2330 /* Products */; 258 | projectDirPath = ""; 259 | projectRoot = ""; 260 | targets = ( 261 | 4F0EFE1320284E52003A2330 /* PushTransitionDemo */, 262 | ); 263 | }; 264 | /* End PBXProject section */ 265 | 266 | /* Begin PBXResourcesBuildPhase section */ 267 | 4F0EFE1220284E52003A2330 /* Resources */ = { 268 | isa = PBXResourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 4F0EFE4420284E95003A2330 /* TB_function_press@3x.png in Resources */, 272 | 4F0EFE73202856C7003A2330 /* Mine_photo_define@2x.png in Resources */, 273 | 4F0EFE4120284E95003A2330 /* TB_community_normal@3x.png in Resources */, 274 | 4F0EFE5E20285069003A2330 /* Home_demo_03.png in Resources */, 275 | 4F0EFE74202856C7003A2330 /* Mine_photo_define@3x.png in Resources */, 276 | 4F0EFE2420284E52003A2330 /* LaunchScreen.storyboard in Resources */, 277 | 4F0EFE4320284E95003A2330 /* TB_function_normal@3x.png in Resources */, 278 | 4F0EFE5C20285069003A2330 /* Home_demo_01.png in Resources */, 279 | 4F0EFE4020284E95003A2330 /* homePage_saoyisao@3x.png in Resources */, 280 | 4F0EFE4620284E95003A2330 /* TB_home_press@3x.png in Resources */, 281 | 4F0EFE5D20285069003A2330 /* Home_demo_02.png in Resources */, 282 | 4F0EFE4520284E95003A2330 /* TB_home_normal@3x.png in Resources */, 283 | 4F0EFE2120284E52003A2330 /* Assets.xcassets in Resources */, 284 | 4F0EFE3F20284E95003A2330 /* homePage_saoyisao@2x.png in Resources */, 285 | 4F0EFE4820284E95003A2330 /* TB_mine_press@3x.png in Resources */, 286 | 4F0EFE4720284E95003A2330 /* TB_mine_normal@3x.png in Resources */, 287 | 4F0EFE1F20284E52003A2330 /* Main.storyboard in Resources */, 288 | 4F0EFE4220284E95003A2330 /* TB_community_press@3x.png in Resources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXResourcesBuildPhase section */ 293 | 294 | /* Begin PBXSourcesBuildPhase section */ 295 | 4F0EFE1020284E52003A2330 /* Sources */ = { 296 | isa = PBXSourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | 4F0EFE65202850A7003A2330 /* HomeDetailViewController.m in Sources */, 300 | 4F0EFE1C20284E52003A2330 /* ViewController.m in Sources */, 301 | 4F0EFE2720284E52003A2330 /* main.m in Sources */, 302 | 4F0EFE6D20285479003A2330 /* UIColor+ConvertColor.m in Sources */, 303 | 4F0EFE6120285087003A2330 /* HomeCell.m in Sources */, 304 | 4F0EFE5720284EEF003A2330 /* CommunityViewController.m in Sources */, 305 | 4F0EFE3E20284E95003A2330 /* TabBarController.m in Sources */, 306 | 4F0EFE5620284EEF003A2330 /* MineViewController.m in Sources */, 307 | 4F0EFE6C20285479003A2330 /* UILabel+Size.m in Sources */, 308 | 4F0EFE1920284E52003A2330 /* AppDelegate.m in Sources */, 309 | 4F0EFE3D20284E95003A2330 /* Tabbar.m in Sources */, 310 | 4F0EFE70202855B0003A2330 /* WBTool.m in Sources */, 311 | 4F0EFE5320284EEF003A2330 /* CenterViewController.m in Sources */, 312 | 4F0EFE5420284EEF003A2330 /* FunctionViewController.m in Sources */, 313 | 4F0EFE5520284EEF003A2330 /* HomeViewController.m in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXSourcesBuildPhase section */ 318 | 319 | /* Begin PBXVariantGroup section */ 320 | 4F0EFE1D20284E52003A2330 /* Main.storyboard */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | 4F0EFE1E20284E52003A2330 /* Base */, 324 | ); 325 | name = Main.storyboard; 326 | sourceTree = ""; 327 | }; 328 | 4F0EFE2220284E52003A2330 /* LaunchScreen.storyboard */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | 4F0EFE2320284E52003A2330 /* Base */, 332 | ); 333 | name = LaunchScreen.storyboard; 334 | sourceTree = ""; 335 | }; 336 | /* End PBXVariantGroup section */ 337 | 338 | /* Begin XCBuildConfiguration section */ 339 | 4F0EFE2820284E52003A2330 /* Debug */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ALWAYS_SEARCH_USER_PATHS = NO; 343 | CLANG_ANALYZER_NONNULL = YES; 344 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 345 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 346 | CLANG_CXX_LIBRARY = "libc++"; 347 | CLANG_ENABLE_MODULES = YES; 348 | CLANG_ENABLE_OBJC_ARC = YES; 349 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 350 | CLANG_WARN_BOOL_CONVERSION = YES; 351 | CLANG_WARN_COMMA = YES; 352 | CLANG_WARN_CONSTANT_CONVERSION = YES; 353 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 354 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 355 | CLANG_WARN_EMPTY_BODY = YES; 356 | CLANG_WARN_ENUM_CONVERSION = YES; 357 | CLANG_WARN_INFINITE_RECURSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 360 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 361 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 362 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 363 | CLANG_WARN_STRICT_PROTOTYPES = YES; 364 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 365 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 366 | CLANG_WARN_UNREACHABLE_CODE = YES; 367 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 368 | CODE_SIGN_IDENTITY = "iPhone Developer"; 369 | COPY_PHASE_STRIP = NO; 370 | DEBUG_INFORMATION_FORMAT = dwarf; 371 | ENABLE_STRICT_OBJC_MSGSEND = YES; 372 | ENABLE_TESTABILITY = YES; 373 | GCC_C_LANGUAGE_STANDARD = gnu11; 374 | GCC_DYNAMIC_NO_PIC = NO; 375 | GCC_NO_COMMON_BLOCKS = YES; 376 | GCC_OPTIMIZATION_LEVEL = 0; 377 | GCC_PREPROCESSOR_DEFINITIONS = ( 378 | "DEBUG=1", 379 | "$(inherited)", 380 | ); 381 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 382 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 383 | GCC_WARN_UNDECLARED_SELECTOR = YES; 384 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 385 | GCC_WARN_UNUSED_FUNCTION = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 388 | MTL_ENABLE_DEBUG_INFO = YES; 389 | ONLY_ACTIVE_ARCH = YES; 390 | SDKROOT = iphoneos; 391 | }; 392 | name = Debug; 393 | }; 394 | 4F0EFE2920284E52003A2330 /* Release */ = { 395 | isa = XCBuildConfiguration; 396 | buildSettings = { 397 | ALWAYS_SEARCH_USER_PATHS = NO; 398 | CLANG_ANALYZER_NONNULL = YES; 399 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 400 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 401 | CLANG_CXX_LIBRARY = "libc++"; 402 | CLANG_ENABLE_MODULES = YES; 403 | CLANG_ENABLE_OBJC_ARC = YES; 404 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 405 | CLANG_WARN_BOOL_CONVERSION = YES; 406 | CLANG_WARN_COMMA = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 410 | CLANG_WARN_EMPTY_BODY = YES; 411 | CLANG_WARN_ENUM_CONVERSION = YES; 412 | CLANG_WARN_INFINITE_RECURSION = YES; 413 | CLANG_WARN_INT_CONVERSION = YES; 414 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 415 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 416 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 417 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 418 | CLANG_WARN_STRICT_PROTOTYPES = YES; 419 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 420 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 421 | CLANG_WARN_UNREACHABLE_CODE = YES; 422 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 423 | CODE_SIGN_IDENTITY = "iPhone Developer"; 424 | COPY_PHASE_STRIP = NO; 425 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 426 | ENABLE_NS_ASSERTIONS = NO; 427 | ENABLE_STRICT_OBJC_MSGSEND = YES; 428 | GCC_C_LANGUAGE_STANDARD = gnu11; 429 | GCC_NO_COMMON_BLOCKS = YES; 430 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 431 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 432 | GCC_WARN_UNDECLARED_SELECTOR = YES; 433 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 434 | GCC_WARN_UNUSED_FUNCTION = YES; 435 | GCC_WARN_UNUSED_VARIABLE = YES; 436 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 437 | MTL_ENABLE_DEBUG_INFO = NO; 438 | SDKROOT = iphoneos; 439 | VALIDATE_PRODUCT = YES; 440 | }; 441 | name = Release; 442 | }; 443 | 4F0EFE2B20284E52003A2330 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | buildSettings = { 446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 447 | CODE_SIGN_STYLE = Automatic; 448 | DEVELOPMENT_TEAM = U6TUG4H42Y; 449 | INFOPLIST_FILE = PushTransitionDemo/Info.plist; 450 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 452 | PRODUCT_BUNDLE_IDENTIFIER = Yvan.PushTransitionDemo; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | TARGETED_DEVICE_FAMILY = "1,2"; 455 | }; 456 | name = Debug; 457 | }; 458 | 4F0EFE2C20284E52003A2330 /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CODE_SIGN_STYLE = Automatic; 463 | DEVELOPMENT_TEAM = U6TUG4H42Y; 464 | INFOPLIST_FILE = PushTransitionDemo/Info.plist; 465 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 466 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 467 | PRODUCT_BUNDLE_IDENTIFIER = Yvan.PushTransitionDemo; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | TARGETED_DEVICE_FAMILY = "1,2"; 470 | }; 471 | name = Release; 472 | }; 473 | /* End XCBuildConfiguration section */ 474 | 475 | /* Begin XCConfigurationList section */ 476 | 4F0EFE0F20284E52003A2330 /* Build configuration list for PBXProject "PushTransitionDemo" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 4F0EFE2820284E52003A2330 /* Debug */, 480 | 4F0EFE2920284E52003A2330 /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | 4F0EFE2A20284E52003A2330 /* Build configuration list for PBXNativeTarget "PushTransitionDemo" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 4F0EFE2B20284E52003A2330 /* Debug */, 489 | 4F0EFE2C20284E52003A2330 /* Release */, 490 | ); 491 | defaultConfigurationIsVisible = 0; 492 | defaultConfigurationName = Release; 493 | }; 494 | /* End XCConfigurationList section */ 495 | }; 496 | rootObject = 4F0EFE0C20284E52003A2330 /* Project object */; 497 | } 498 | -------------------------------------------------------------------------------- /PushTransitionDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PushTransitionDemo.xcodeproj/project.xcworkspace/xcuserdata/liuyufeng.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo.xcodeproj/project.xcworkspace/xcuserdata/liuyufeng.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /PushTransitionDemo.xcodeproj/xcuserdata/liuyufeng.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PushTransitionDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PushTransitionDemo.xcodeproj/xcuserdata/sjimac01.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PushTransitionDemo.xcodeproj/xcuserdata/sjimac01.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PushTransitionDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PushTransitionDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. 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 | -------------------------------------------------------------------------------- /PushTransitionDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "TabBarController.h" 11 | 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.backgroundColor = [UIColor whiteColor]; 23 | self.window.rootViewController = [[TabBarController alloc]initWithNibName:@"TabBarController" bundle:nil]; 24 | [self.window makeKeyAndVisible]; 25 | return YES; 26 | } 27 | 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application { 30 | // 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. 31 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 32 | } 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 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application { 42 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application { 47 | // 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. 48 | } 49 | 50 | 51 | - (void)applicationWillTerminate:(UIApplication *)application { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /PushTransitionDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /PushTransitionDemo/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 | -------------------------------------------------------------------------------- /PushTransitionDemo/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 | -------------------------------------------------------------------------------- /PushTransitionDemo/Define.h: -------------------------------------------------------------------------------- 1 | // 2 | // Define.h 3 | // WILLB 4 | // 5 | // Created by sjimac01 on 2017/11/24. 6 | // Copyright © 2017年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "UIColor+ConvertColor.h" 10 | #import "UILabel+Size.h" 11 | #import "WBTool.h" 12 | 13 | 14 | #pragma mark - 坐标 15 | 16 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 17 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 18 | #define SCREEN_BOUNDS [UIScreen mainScreen].bounds 19 | #define SCREEN_RATIO(x) (x*(SCREEN_WIDTH/375.0)) 20 | 21 | #define LINE_WIDTH 0.5 22 | 23 | #define INDUSTRY_RATIO 0.34 24 | 25 | #define VIEW_BORDER_RADIUS(View, Radius, Width, Color)\ 26 | \ 27 | [View.layer setCornerRadius:(Radius)];\ 28 | [View.layer setMasksToBounds:YES];\ 29 | [View.layer setBorderWidth:(Width)];\ 30 | [View.layer setBorderColor:[Color CGColor]] 31 | 32 | #pragma mark - 字体 33 | 34 | #define FONT_12 [UIFont systemFontOfSize:12.0f] 35 | #define FONT_13 [UIFont systemFontOfSize:13.0f] 36 | #define FONT_14 [UIFont systemFontOfSize:14.0f] 37 | #define FONT_15 [UIFont systemFontOfSize:15.0f] 38 | #define FONT_16 [UIFont systemFontOfSize:16.0f] 39 | #define FONT_17 [UIFont systemFontOfSize:17.0f] 40 | #define FONT_18 [UIFont systemFontOfSize:18.0f] 41 | #define FONT_19 [UIFont systemFontOfSize:19.0f] 42 | #define FONT_20 [UIFont systemFontOfSize:20.0f] 43 | #define FONT_21 [UIFont systemFontOfSize:21.0f] 44 | #define FONT_22 [UIFont systemFontOfSize:22.0f] 45 | #define FONT_23 [UIFont systemFontOfSize:23.0f] 46 | 47 | #define FONT_S(x) [UIFont systemFontOfSize:x] 48 | #define FONT_B(x) [UIFont boldSystemFontOfSize:x] 49 | #define FONT_S_R(x) [UIFont systemFontOfSize:(x*(SCREEN_WIDTH/375.0))] 50 | #define FONT_B_R(x) [UIFont boldSystemFontOfSize:(x*(SCREEN_WIDTH/375.0))] 51 | 52 | #define FONT_PF(x) [UIFont fontWithName:@"PingFangSC-Light" size:x] 53 | #define FONT_PF_R(x) [UIFont fontWithName:@"PingFangSC-Light" size:(x*(SCREEN_WIDTH/375.0))] 54 | 55 | 56 | #pragma mark - 颜色 57 | 58 | #define RGB(r,g,b) [UIColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1] 59 | #define RGB_A(r,g,b,a) [UIColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:a] 60 | #define COLOR_STR(str) [UIColor colorWithHexString:str] 61 | #define COLOR_WHITE [UIColor whiteColor] 62 | #define COLOR_BLACK [UIColor blackColor] 63 | #define COLOR_CLEAR [UIColor clearColor] 64 | #define COLOR_GRAY [UIColor colorWithHexString:@"B2B2B2"] 65 | 66 | #define COLOR_APP [UIColor colorWithHexString:@"0FB5BA"] 67 | #define COLOR_BG [UIColor colorWithHexString:@"F3F3F3"] 68 | #define COLOR_LINE [UIColor colorWithHexString:@"DFDFDF"] 69 | #define COLOR_3 [UIColor colorWithHexString:@"333333"] 70 | #define COLOR_6 [UIColor colorWithHexString:@"666666"] 71 | #define COLOR_9 [UIColor colorWithHexString:@"999999"] 72 | #define COLOR_57A [UIColor colorWithHexString:@"57575A"] 73 | #define COLOR_1A9 [UIColor colorWithHexString:@"1A1919"] 74 | #define COLOR_F7 [UIColor colorWithHexString:@"F7F7F7"] 75 | #define COLOR_45 [UIColor colorWithHexString:@"454545"] 76 | 77 | #define IPHONE_X ([[WBTool iphoneType] isEqualToString:@"iPhone X"] || [[WBTool iphoneType] isEqualToString:@"iPhone Simulator"]) 78 | 79 | 80 | #define HOME_TITLE @"Today" 81 | 82 | 83 | -------------------------------------------------------------------------------- /PushTransitionDemo/HomeCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeCell.h 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Define.h" 11 | @interface HomeCell : UITableViewCell 12 | 13 | @property (strong, nonatomic) UIImageView *bgimageView; // 图片 14 | @property (strong, nonatomic) UIView *bgView; // 背景 15 | @property (strong, nonatomic) UILabel *titleLabel; // 主标题 16 | @property (strong, nonatomic) UILabel *contentLabel; // 副标题 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /PushTransitionDemo/HomeCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeCell.m 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "HomeCell.h" 10 | 11 | @implementation HomeCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | 20 | } 21 | 22 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 23 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 24 | 25 | self.backgroundColor = COLOR_CLEAR; 26 | self.contentView.backgroundColor = COLOR_CLEAR; 27 | 28 | [self.contentView addSubview:self.bgView]; 29 | [self.bgView addSubview:self.bgimageView]; 30 | [self.bgView addSubview:self.titleLabel]; 31 | [self.bgView addSubview:self.contentLabel]; 32 | 33 | } 34 | return self; 35 | } 36 | 37 | - (UIImageView *)bgimageView { 38 | if (_bgimageView == nil) { 39 | _bgimageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-40, (SCREEN_WIDTH-40)*1.3)]; 40 | _bgimageView.layer.cornerRadius = 15; 41 | _bgimageView.layer.masksToBounds = YES; 42 | 43 | } 44 | return _bgimageView; 45 | } 46 | 47 | - (UIView *)bgView { 48 | if (_bgView == nil) { 49 | _bgView = [[UIView alloc]initWithFrame:CGRectMake(20, 0, SCREEN_WIDTH-40, (SCREEN_WIDTH-40)*1.3+25)]; 50 | 51 | _bgView.backgroundColor = COLOR_CLEAR; 52 | } 53 | return _bgView; 54 | } 55 | 56 | - (UILabel *)titleLabel { 57 | if (_titleLabel == nil) { 58 | _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 20, SCREEN_WIDTH-30, 30)]; 59 | _titleLabel.textColor = COLOR_WHITE; 60 | _titleLabel.textAlignment = NSTextAlignmentLeft; 61 | _titleLabel.font = FONT_B(25); 62 | } 63 | return _titleLabel; 64 | } 65 | 66 | - (UILabel *)contentLabel { 67 | if (_contentLabel == nil) { 68 | _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, (SCREEN_WIDTH-40)*1.3-30, SCREEN_WIDTH-44, 15)]; 69 | _contentLabel.font = FONT_PF(15); 70 | _contentLabel.alpha = 0.5; 71 | _contentLabel.textColor = COLOR_WHITE; 72 | _contentLabel.textAlignment = NSTextAlignmentLeft; 73 | } 74 | return _contentLabel; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /PushTransitionDemo/HomeDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeDetailViewController.h 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomeDetailViewController : UIViewController 12 | @property (strong, nonatomic) UIImage *bgImage; 13 | @property (strong, nonatomic) NSString *imageName; 14 | @property (strong, nonatomic) NSString *titles; 15 | @property (strong, nonatomic) NSString *titleTwo; 16 | @property (strong, nonatomic) NSString *content; 17 | @property (strong, nonatomic) NSIndexPath *selectIndexPath; 18 | @end 19 | -------------------------------------------------------------------------------- /PushTransitionDemo/HomeDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeDetailViewController.m 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "HomeDetailViewController.h" 10 | #import "Define.h" 11 | #import "HomeCell.h" 12 | #import "HomeViewController.h" 13 | #import "Tabbar.h" 14 | @interface HomeDetailViewController () 15 | @property (strong, nonatomic) UITableView *tableView; 16 | @property (strong, nonatomic) UIImageView *bgImageView; // 上个页面截图 17 | @property (strong, nonatomic) UILabel *contentLabel; // 内容 18 | @property (strong, nonatomic) UIImageView *headerImageView; // 大图 19 | @property (strong, nonatomic) UILabel *titleLabel; // 主标题 20 | @property (strong, nonatomic) UILabel *titleTwoLabel; // 副标题 21 | @end 22 | 23 | @implementation HomeDetailViewController 24 | { 25 | CGFloat cellHeight; 26 | CGFloat startPointX; 27 | CGFloat startPointY; 28 | CGFloat scale; 29 | BOOL isHorizontal; 30 | } 31 | 32 | - (void)viewWillAppear:(BOOL)animated { 33 | [super viewWillAppear:animated]; 34 | [UIView animateWithDuration:0.2 animations:^{ 35 | [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; 36 | }]; 37 | } 38 | 39 | - (void)viewDidLoad { 40 | [super viewDidLoad]; 41 | [self initData]; 42 | [self buildSubviews]; 43 | } 44 | 45 | 46 | #pragma mark - ==============================data============================ 47 | 48 | 49 | - (void)initData { 50 | self.view.backgroundColor = COLOR_WHITE; 51 | self.navigationController.delegate = self; 52 | scale = 1; 53 | } 54 | 55 | #pragma mark - ==============================UI============================ 56 | 57 | - (void)buildSubviews { 58 | // 背景图 59 | [self.view addSubview:self.bgImageView]; 60 | self.bgImageView.image = self.bgImage; 61 | // 背景毛玻璃 62 | UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 63 | UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect]; 64 | effectView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); 65 | [self.view addSubview:effectView]; 66 | 67 | [self.view addSubview:self.tableView]; 68 | self.tableView.tableHeaderView = [self tableViewHeaderView]; 69 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(pan:)]; 70 | [self.tableView addGestureRecognizer:pan]; 71 | pan.delegate = self; 72 | 73 | } 74 | 75 | - (UIView *)tableViewHeaderView { 76 | UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH*1.3)]; 77 | 78 | self.headerImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH*1.3); 79 | self.headerImageView.image = [UIImage imageNamed:self.imageName]; 80 | [headerView addSubview:self.headerImageView]; 81 | self.titleLabel.text =self.titles; 82 | self.titleTwoLabel.text = self.titleTwo; 83 | [headerView addSubview:self.titleLabel]; 84 | [headerView addSubview:self.titleTwoLabel]; 85 | return headerView; 86 | } 87 | 88 | 89 | #pragma mark - ==============================Delegate============================ 90 | 91 | 92 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 93 | return 1; 94 | } 95 | 96 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 97 | CGSize size = [UILabel withString:self.contentLabel.text font:self.contentLabel.font ViewWidth:SCREEN_WIDTH-36]; 98 | return 62+size.height; 99 | } 100 | 101 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 102 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WBHOMECELLID"]; 103 | if (!cell) { 104 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"WBHOMECELLID"]; 105 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 106 | cell.backgroundColor = COLOR_WHITE; 107 | cell.contentView.backgroundColor = COLOR_WHITE; 108 | } 109 | self.contentLabel.text = self.content; 110 | CGSize size = [UILabel withString:self.contentLabel.text font:self.contentLabel.font ViewWidth:SCREEN_WIDTH-36]; 111 | self.contentLabel.frame = CGRectMake(18,42, SCREEN_WIDTH-36, size.height); 112 | [cell.contentView addSubview:self.contentLabel]; 113 | return cell; 114 | } 115 | 116 | 117 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 118 | if (scrollView.contentOffset.y <= 0) { 119 | 120 | CGRect rectQ = self.headerImageView.frame; 121 | rectQ.origin.y = scrollView.contentOffset.y; 122 | self.headerImageView.frame = rectQ; 123 | 124 | CGRect rectT = _titleLabel.frame; 125 | rectT.origin.y = scrollView.contentOffset.y+30; 126 | _titleLabel.frame = rectT; 127 | 128 | CGRect rectC = _titleTwoLabel.frame; 129 | rectC.origin.y = scrollView.contentOffset.y +SCREEN_WIDTH*1.3-30; 130 | _titleTwoLabel.frame = rectC; 131 | } 132 | } 133 | 134 | #pragma mark - 下拉缩小,跳转 135 | 136 | - (void)pan:(UIPanGestureRecognizer *)pan { 137 | switch (pan.state) { 138 | case UIGestureRecognizerStateBegan: { // 手势开始 139 | CGPoint currentPoint =[pan locationInView:self.tableView]; 140 | startPointY = currentPoint.y; 141 | startPointX = currentPoint.x; 142 | // 确定是否可以横划,判断起始点位置 143 | if (startPointX>30) { 144 | isHorizontal = NO; 145 | } else { 146 | isHorizontal = YES; 147 | } 148 | } break; 149 | case UIGestureRecognizerStateChanged: { // 手势状态改变 150 | CGPoint currentPoint =[pan locationInView:self.tableView]; 151 | // 如果可以横划,判断是横划还是竖划 152 | if (isHorizontal) { 153 | if ((currentPoint.x-startPointX)>(currentPoint.y-startPointY)) { 154 | scale = (SCREEN_WIDTH-(currentPoint.x-startPointX))/SCREEN_WIDTH; 155 | } else { 156 | scale = (SCREEN_HEIGHT-(currentPoint.y-startPointY))/SCREEN_HEIGHT; 157 | } 158 | } else { 159 | scale = (SCREEN_HEIGHT-(currentPoint.y-startPointY))/SCREEN_HEIGHT; 160 | } 161 | if (scale > 1.0f) { 162 | scale = 1.0f; 163 | } else if (scale <=0.8f) { 164 | scale = 0.8f; 165 | 166 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.03 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 167 | [self.navigationController popViewControllerAnimated:YES]; 168 | }); 169 | 170 | } 171 | if (self.tableView.contentOffset.y<=0) { 172 | // 缩放 173 | self.tableView.transform = CGAffineTransformMakeScale(scale, scale); 174 | // 圆角 175 | self.tableView.layer.cornerRadius = 15 * (1-scale)*5*1.08; 176 | } 177 | 178 | if (scale < 0.99) { 179 | [self.tableView setScrollEnabled:NO]; 180 | } else { 181 | [self.tableView setScrollEnabled:YES]; 182 | } 183 | } break; 184 | case UIGestureRecognizerStateEnded: { // 手势结束 185 | NSLog(@"手势结束"); 186 | scale = 1; 187 | self.tableView.scrollEnabled = YES; 188 | if (scale>0.8) { 189 | [UIView animateWithDuration:0.2 animations:^{ 190 | self.tableView.layer.cornerRadius = 0; 191 | self.tableView.transform = CGAffineTransformMakeScale(1, 1); 192 | }]; 193 | } 194 | 195 | } break; 196 | default: 197 | break; 198 | } 199 | } 200 | 201 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 202 | if ([otherGestureRecognizer.view isKindOfClass:[UITableView class]]) { 203 | return YES; 204 | } 205 | return NO; 206 | } 207 | 208 | 209 | #pragma mark - UINavigationControllerDelegate 210 | 211 | - (id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC 212 | { 213 | return self; 214 | } 215 | 216 | #pragma mark - UIViewControllerAnimatedTransitioning 217 | 218 | - (NSTimeInterval)transitionDuration:(id)transitionContext 219 | { 220 | return 1.0f; 221 | } 222 | 223 | 224 | #pragma mark - 重写pop动画 225 | 226 | - (void)animateTransition:(id)transitionContext { 227 | 228 | HomeViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 229 | HomeDetailViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 230 | UIView *containerView = [transitionContext containerView]; 231 | UIView *fromView = [fromVC valueForKeyPath:@"headerImageView"]; 232 | toVC.view.frame = [transitionContext finalFrameForViewController:toVC]; 233 | HomeCell *cell = (HomeCell *)[toVC.tableView cellForRowAtIndexPath:self.selectIndexPath]; 234 | UIView *originView = cell.bgimageView; 235 | 236 | UIView *snapShotView = [fromView snapshotViewAfterScreenUpdates:NO]; 237 | snapShotView.layer.masksToBounds = YES; 238 | snapShotView.layer.cornerRadius = 15; 239 | snapShotView.frame = [containerView convertRect:fromView.frame fromView:fromView.superview]; 240 | 241 | fromView.hidden = YES; 242 | originView.hidden = YES; 243 | 244 | [containerView insertSubview:toVC.view belowSubview:fromVC.view]; 245 | [containerView addSubview:snapShotView]; 246 | UILabel *titleLabel = [[UILabel alloc]init]; 247 | titleLabel.textColor = COLOR_WHITE; 248 | titleLabel.textAlignment = NSTextAlignmentLeft; 249 | titleLabel.font = FONT_B(25); 250 | titleLabel.text = self.titles; 251 | 252 | UILabel *contentLabel = [[UILabel alloc]init]; 253 | contentLabel.font = FONT_PF(15); 254 | contentLabel.textColor = COLOR_WHITE; 255 | contentLabel.textAlignment = NSTextAlignmentLeft; 256 | contentLabel.text =self.titleTwo; 257 | contentLabel.alpha = 0.5; 258 | titleLabel.frame = CGRectMake(22, 20, SCREEN_WIDTH-30, 30); 259 | contentLabel.frame = CGRectMake(22, SCREEN_WIDTH*1.3-30, SCREEN_WIDTH*1.3-44, 15); 260 | [snapShotView addSubview:titleLabel]; 261 | [snapShotView addSubview:contentLabel]; 262 | 263 | [UIView animateWithDuration:[self transitionDuration:transitionContext] delay:0 usingSpringWithDamping:0.5f initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ 264 | [containerView layoutIfNeeded]; 265 | fromVC.view.alpha = 0.0f; 266 | snapShotView.layer.cornerRadius = 15; 267 | self.tableView.frame = CGRectMake(self.tableView.frame.origin.x, self.tableView.frame.origin.y, self.tableView.frame.size.width,SCREEN_WIDTH*1.3*0.8); 268 | self.tableView.layer.cornerRadius = 15; 269 | snapShotView.frame = [containerView convertRect:originView.frame fromView:originView.superview]; 270 | titleLabel.frame = CGRectMake(15, 20, SCREEN_WIDTH-30, 30); 271 | contentLabel.frame = CGRectMake(15, (SCREEN_WIDTH-40)*1.3-30, SCREEN_WIDTH-44, 15); 272 | Tabbar *tabBar = (Tabbar *)self.tabBarController.tabBar; 273 | if (IPHONE_X) { 274 | tabBar.frame = CGRectMake(0, SCREEN_HEIGHT-83, SCREEN_WIDTH, 83); 275 | } else { 276 | tabBar.frame = CGRectMake(0, SCREEN_HEIGHT-49, SCREEN_WIDTH, 49); 277 | } 278 | 279 | 280 | } completion:^(BOOL finished) { 281 | fromView.hidden = YES; 282 | [snapShotView removeFromSuperview]; 283 | originView.hidden = NO; 284 | [transitionContext completeTransition:![transitionContext transitionWasCancelled]]; 285 | }]; 286 | } 287 | 288 | 289 | #pragma mark - ==============================实例化============================ 290 | 291 | 292 | - (UITableView *)tableView { 293 | if (_tableView == nil) { 294 | _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain]; 295 | _tableView.delegate = self; 296 | _tableView.dataSource = self; 297 | _tableView.backgroundColor = COLOR_WHITE; 298 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 299 | _tableView.showsVerticalScrollIndicator = NO; 300 | } 301 | return _tableView; 302 | } 303 | 304 | - (UILabel *)titleLabel { 305 | if (_titleLabel == nil) { 306 | _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(22, 30, SCREEN_WIDTH-30, 30)]; 307 | _titleLabel.textColor = COLOR_WHITE; 308 | _titleLabel.textAlignment = NSTextAlignmentLeft; 309 | _titleLabel.font = FONT_B(25); 310 | } 311 | return _titleLabel; 312 | } 313 | 314 | - (UILabel *)titleTwoLabel { 315 | if (_titleTwoLabel == nil) { 316 | _titleTwoLabel = [[UILabel alloc]initWithFrame:CGRectMake(22, SCREEN_WIDTH*1.3-30, SCREEN_WIDTH*1.3-44, 15)]; 317 | _titleTwoLabel.font = FONT_PF(15); 318 | _titleTwoLabel.textColor = COLOR_WHITE; 319 | _titleTwoLabel.alpha = 0.5; 320 | _titleTwoLabel.textAlignment = NSTextAlignmentLeft; 321 | } 322 | return _titleTwoLabel; 323 | } 324 | 325 | - (UILabel *)contentLabel { 326 | if (_contentLabel == nil) { 327 | _contentLabel = [[UILabel alloc]init]; 328 | _contentLabel.font = FONT_PF(17); 329 | _contentLabel.textColor = COLOR_STR(@"7f7f82"); 330 | _contentLabel.textAlignment = NSTextAlignmentLeft; 331 | _contentLabel.numberOfLines = 0; 332 | } 333 | return _contentLabel; 334 | } 335 | 336 | - (UIImageView *)headerImageView { 337 | if (_headerImageView == nil) { 338 | _headerImageView = [[UIImageView alloc]init]; 339 | _headerImageView.userInteractionEnabled = YES; 340 | } 341 | return _headerImageView; 342 | } 343 | 344 | - (UIImageView *)bgImageView { 345 | if (_bgImageView == nil) { 346 | _bgImageView = [[UIImageView alloc]initWithFrame:self.view.bounds]; 347 | } 348 | return _bgImageView; 349 | } 350 | @end 351 | -------------------------------------------------------------------------------- /PushTransitionDemo/HomeImage/Home_demo_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/HomeImage/Home_demo_01.png -------------------------------------------------------------------------------- /PushTransitionDemo/HomeImage/Home_demo_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/HomeImage/Home_demo_02.png -------------------------------------------------------------------------------- /PushTransitionDemo/HomeImage/Home_demo_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/HomeImage/Home_demo_03.png -------------------------------------------------------------------------------- /PushTransitionDemo/HomeImage/Mine_photo_define@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/HomeImage/Mine_photo_define@2x.png -------------------------------------------------------------------------------- /PushTransitionDemo/HomeImage/Mine_photo_define@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/HomeImage/Mine_photo_define@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/HomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomeViewController : UIViewController 12 | @property (strong, nonatomic) UITableView *tableView; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /PushTransitionDemo/HomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "HomeViewController.h" 10 | #import "Define.h" 11 | #import "HomeCell.h" 12 | #import "HomeDetailViewController.h" 13 | #import "TabBarController.h" 14 | #import "Tabbar.h" 15 | @interface HomeViewController () 16 | 17 | @property (strong, nonatomic) NSMutableArray *dataSource; // 图片数组 18 | @property (strong, nonatomic) NSMutableArray *titles; // 主标题数组 19 | @property (strong, nonatomic) NSMutableArray *titleTwos; // 副标题数组 20 | @property (strong, nonatomic) NSMutableArray *contents; // 内容数组 21 | 22 | @property (strong, nonatomic) UIView *headerView; // 头部 23 | @property (strong, nonatomic) UILabel *timeLabel; // 时间 24 | @property (strong, nonatomic) UILabel *titleLabel; // Today 25 | @property (strong, nonatomic) UIButton *userButton; // 26 | 27 | @end 28 | 29 | @implementation HomeViewController 30 | { 31 | NSIndexPath *selectIndexPath; 32 | } 33 | 34 | - (void)viewWillAppear:(BOOL)animated { 35 | [super viewWillAppear:animated]; 36 | // 隐藏导航条 37 | [self.navigationController setNavigationBarHidden:YES animated:NO]; 38 | 39 | // 设置navigaitonControllerDelegate 40 | self.navigationController.delegate = self; 41 | // 隐藏状态栏 42 | [UIView animateWithDuration:0.2 animations:^{ 43 | [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide]; 44 | }]; 45 | } 46 | 47 | - (void)viewDidLoad { 48 | [super viewDidLoad]; 49 | [self initData]; 50 | [self.view addSubview:self.tableView]; 51 | self.tableView.tableHeaderView = [self buildHeaderView]; 52 | } 53 | 54 | #pragma mark - Today 头像 UI 55 | 56 | - (UIView *)buildHeaderView { 57 | 58 | // header 59 | self.headerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 115); 60 | // 日期 61 | self.timeLabel.frame = CGRectMake(SCREEN_RATIO(22), 30, SCREEN_WIDTH/2, 14); 62 | self.timeLabel.text = [self getWeekDay]; 63 | // 标题 64 | self.titleLabel.frame = CGRectMake(SCREEN_RATIO(22),55 , (SCREEN_WIDTH/3)*2, 30); 65 | 66 | // 登录按钮 67 | self.userButton.frame = CGRectMake(SCREEN_WIDTH-44-SCREEN_RATIO(22), 38, 44, 44); 68 | self.userButton.layer.masksToBounds = YES; 69 | self.userButton.layer.cornerRadius = 22; 70 | [self.userButton addTarget:self action:@selector(userButtonClick) forControlEvents:UIControlEventTouchUpInside]; 71 | [self.userButton setImage:[UIImage imageNamed:@"Mine_photo_define"] forState:UIControlStateNormal]; 72 | [self.headerView addSubview:self.timeLabel]; 73 | [self.headerView addSubview:self.titleLabel]; 74 | [self.headerView addSubview:self.userButton]; 75 | 76 | return self.headerView; 77 | } 78 | 79 | 80 | #pragma mark - ==============================Click============================ 81 | 82 | 83 | - (void)userButtonClick { 84 | 85 | } 86 | 87 | #pragma mark - 获取当前时间,日期 88 | 89 | - (NSString*)getWeekDay { 90 | 91 | NSDate*date =[NSDate date]; 92 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 93 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 94 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 95 | [formatter setDateFormat:@"MM月dd日"]; 96 | NSString *dateTime = [formatter stringFromDate:date]; 97 | NSArray*weekdays = [NSArray arrayWithObjects: [NSNull null],@"星期日",@"星期一",@"星期二",@"星期三",@"星期四",@"星期五",@"星期六",nil]; 98 | NSCalendar*calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 99 | NSTimeZone*timeZone = [[NSTimeZone alloc]initWithName:@"Asia/Shanghai"]; 100 | [calendar setTimeZone: timeZone]; 101 | NSCalendarUnit calendarUnit =NSCalendarUnitWeekday; 102 | NSDateComponents*theComponents = [calendar components:calendarUnit fromDate:date]; 103 | NSString *weekTime = [weekdays objectAtIndex:theComponents.weekday]; 104 | return [NSString stringWithFormat:@"%@ %@",dateTime,weekTime]; 105 | } 106 | #pragma mark - 截屏 107 | 108 | - (UIImage *)imageFromView { 109 | 110 | UIGraphicsBeginImageContext(self.view.frame.size); 111 | CGContextRef context = UIGraphicsGetCurrentContext(); 112 | [self.view.layer renderInContext:context]; 113 | UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext(); 114 | UIGraphicsEndImageContext(); 115 | 116 | return theImage; 117 | } 118 | 119 | 120 | #pragma mark - ==============================Data============================ 121 | 122 | 123 | - (void)initData { 124 | [self.dataSource addObjectsFromArray:@[@"Home_demo_01",@"Home_demo_02",@"Home_demo_03"]]; 125 | 126 | [self.titles addObject:@"哈弗H6Coupe震撼上市"]; 127 | [self.titles addObject:@"黑天鹅蛋糕 "]; 128 | [self.titles addObject:@"高端健身会所入驻园区"]; 129 | 130 | [self.titleTwos addObject:@"体验“中国芯”动力新哈弗H6 Coupe"]; 131 | [self.titleTwos addObject:@"“我的一生,为美而感动,为美而存在”"]; 132 | [self.titleTwos addObject:@"让运动助力工作生活"]; 133 | 134 | [self.contents addObject:@"前卫设计动感十足 体验“中国芯”动力新哈弗H6 Coupe\n新哈弗H6 Coupe是长城公司采用全新设计语言开发的一款具有酷颜值,酷动力,酷装备的SUV。此次新哈弗H6 Coupe由内而外的全面升级,必将引来大众的追捧,开创哈弗SUV新篇章...\n1.5GDIT发动机应用CVVL、缸内直喷等前沿技术,动力响应快、燃油经济性好,最大功率124kW,1400转爆发最大扭矩285N·m,百公里加速9.7s,百公里油耗仅6.8L,荣获“中国心”2017十佳发动机;\n7DCT湿式双离合变速器采用最先进的摩擦材料,速比范围高达8.0,换挡平顺、可靠性高,提升燃油经济性,荣获2018届世界十佳变速器。\n整车采用超刚性一体式安全结构车身;\n配备奥托立夫6安全气囊、帘式气囊贯穿前后,保护面积更宽泛;\n盲点侦测,保证行车安全;\n配备360环视影像系统、LED组合前灯,驾乘更安全。\n外观采用钻石形体光学设计,车身线条硬朗连贯,更动感;\n内饰采用大面贯穿式整体设计,断面式仪表板极具立体感,打造科技及尊享兼备的体验。"]; 135 | [self.contents addObject:@"一兆韦德健身管理有限公司目前有员工3000多人,拥有超过一百家健身会所。公司大力倡导绿色环保和时尚健身运动。凭借先进的管理理念、丰富的行业经验、完善的管理体系和管理团队,业已成为业内发展速度快、分店数量多、会员数量众多的健身连锁机构。公司多次通过权威机构认证,目前由国际著名投资公司——新加坡淡马锡集团注资,2015年更是获得了上海市著名商标,是健身行业内首个获得该荣誉的企业。公司希望通过全体员工的努力为社会提供有价值的健康生活服务,成为具世界竞争力的连锁健身企业之一。公司将打造更多的绿色生态会馆、为美好的城市生活贡献更多力量。"]; 136 | [self.contents addObject:@"黑天鹅 \n隶属于北京黑天鹅餐饮管理有限公司,公司主要打造国内品质卓越,美味安心的蛋糕。黑天鹅蛋糕源于黄金比例的配方,精选世界各地优质食材,让您和朋友轻松享受精品蛋糕。\n用新锐的艺术理念和国际化的视野,带领团队重塑品牌,开启了黑天鹅与全球顶尖的甜品大师、设计大师和顶级原料商全面合作的阶段,让黑天鹅的产品和形象获得蜕变和飞跃,迅速跻身于国际一流烘焙品牌的行列。\n黑天鹅蛋糕推出以来,一直以一种“昂贵、奢华、精美”的形象示人,北京的首家实体店铺,自然要延续这个风格。先站在门口拍一张,这种风格的铺面,在蛋糕店里绝对令人耳目一新。"]; 137 | 138 | } 139 | 140 | 141 | 142 | #pragma mark - ==============================Delegate============================ 143 | 144 | 145 | 146 | 147 | #pragma mark - UITableViewDelegate,UITableViewDataSource 148 | 149 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 150 | return 1; 151 | } 152 | 153 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 154 | return (SCREEN_WIDTH-40)*1.3+25; 155 | } 156 | 157 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 158 | return self.dataSource.count; 159 | } 160 | 161 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 162 | HomeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HOMECELLID"]; 163 | if (cell == nil) { 164 | cell = [[HomeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"HOMECELLID"]; 165 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 166 | cell.shouldGroupAccessibilityChildren = YES; 167 | } 168 | cell.titleLabel.text = self.titles[indexPath.row]; 169 | cell.contentLabel.text = self.titleTwos[indexPath.row]; 170 | cell.bgimageView.image = [UIImage imageNamed:self.dataSource[indexPath.row]]; 171 | cell.transform = CGAffineTransformMakeScale(1, 1); 172 | 173 | return cell; 174 | 175 | } 176 | // TODO: 即将进入高亮状态 177 | - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath { 178 | selectIndexPath = indexPath; 179 | UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 180 | [UIView animateWithDuration:0.2 animations:^{ 181 | cell.transform = CGAffineTransformMakeScale(0.9, 0.9); 182 | }]; 183 | 184 | return YES; 185 | } 186 | // TODO: 结束高亮状态 187 | - (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath { 188 | UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 189 | NSLog(@"%u",cell.selected); 190 | 191 | if ([selectIndexPath isEqual:indexPath]) { 192 | [UIView animateWithDuration:0.2 animations:^{ 193 | cell.transform = CGAffineTransformMakeScale(1, 1); 194 | return; 195 | }]; 196 | } 197 | 198 | 199 | } 200 | 201 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 202 | 203 | HomeCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 204 | cell.transform = CGAffineTransformMakeScale(0.9, 0.9); 205 | HomeDetailViewController *detail = [[HomeDetailViewController alloc]init]; 206 | detail.selectIndexPath = indexPath; 207 | detail.bgImage = [self imageFromView]; 208 | detail.titles = self.titles[indexPath.row]; 209 | detail.titleTwo = self.titleTwos[indexPath.row]; 210 | detail.content = self.contents[indexPath.row]; 211 | detail.imageName = self.dataSource[indexPath.row]; 212 | [self.navigationController pushViewController:detail animated:YES]; 213 | } 214 | 215 | 216 | #pragma mark - UIViewControllerAnimatedTransitioning 217 | // MARK: 设置代理 218 | - (id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC { 219 | return self; 220 | } 221 | 222 | // MARK: 设置动画时间 223 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 224 | return 1.0f; 225 | } 226 | 227 | - (void)animateTransition:(id)transitionContext { 228 | 229 | HomeCell *cell = (HomeCell *)[self.tableView cellForRowAtIndexPath:[self.tableView indexPathForSelectedRow]]; 230 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 231 | UIView *toView = [toVC valueForKeyPath:@"headerImageView"]; 232 | UIView *fromView = cell.bgView; 233 | UIView *containerView = [transitionContext containerView]; 234 | UIView *snapShotView = [[UIImageView alloc]initWithImage:cell.bgimageView.image]; 235 | snapShotView.frame = [containerView convertRect:fromView.frame fromView:fromView.superview]; 236 | 237 | fromView.hidden = YES; 238 | 239 | toVC.view.frame = [transitionContext finalFrameForViewController:toVC]; 240 | toVC.view.alpha = 0; 241 | toView.hidden = YES; 242 | 243 | UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 20, SCREEN_WIDTH-30, 30)]; 244 | titleLabel.textColor = COLOR_WHITE; 245 | titleLabel.textAlignment = NSTextAlignmentLeft; 246 | titleLabel.font = FONT_B(25); 247 | titleLabel.text = cell.titleLabel.text; 248 | 249 | UILabel *contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, (SCREEN_WIDTH-40)*1.3-30, SCREEN_WIDTH-44, 15)]; 250 | contentLabel.font = FONT_PF(15); 251 | contentLabel.textColor = COLOR_WHITE; 252 | contentLabel.textAlignment = NSTextAlignmentLeft; 253 | contentLabel.alpha = 0.5; 254 | contentLabel.text =cell.contentLabel.text; 255 | [snapShotView addSubview:titleLabel]; 256 | [snapShotView addSubview:contentLabel]; 257 | [containerView addSubview:toVC.view]; 258 | [containerView addSubview:snapShotView]; 259 | 260 | [UIView animateWithDuration:[self transitionDuration:transitionContext] delay:0.0f usingSpringWithDamping:0.6f initialSpringVelocity:1.0f options:UIViewAnimationOptionCurveLinear animations:^{ 261 | [containerView layoutIfNeeded]; 262 | toVC.view.alpha = 1.0f; 263 | Tabbar*tabBar = (Tabbar *)self.tabBarController.tabBar; 264 | if (IPHONE_X) { 265 | tabBar.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, 83); 266 | } else { 267 | tabBar.frame = CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, 49); 268 | } 269 | snapShotView.frame = [containerView convertRect:toView.frame fromView:toView.superview]; 270 | titleLabel.frame = CGRectMake(22, 30, SCREEN_WIDTH-30, 30); 271 | contentLabel.frame = CGRectMake(22, SCREEN_WIDTH*1.3-30, SCREEN_WIDTH*1.3-44, 15); 272 | 273 | } completion:^(BOOL finished) { 274 | 275 | toView.hidden = NO; 276 | fromView.hidden = NO; 277 | [snapShotView removeFromSuperview]; 278 | [self.tableView reloadData]; 279 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 280 | }]; 281 | 282 | } 283 | 284 | 285 | #pragma mark - ==============================实例化============================ 286 | 287 | 288 | 289 | - (UITableView *)tableView { 290 | if (_tableView == nil) { 291 | _tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain]; 292 | _tableView.delegate = self; 293 | _tableView.dataSource = self; 294 | _tableView.backgroundColor = COLOR_CLEAR; 295 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 296 | } 297 | return _tableView; 298 | } 299 | 300 | - (NSMutableArray *)dataSource { 301 | if (_dataSource == nil) { 302 | _dataSource = [[NSMutableArray alloc]init]; 303 | } 304 | return _dataSource; 305 | } 306 | 307 | - (UIView *)headerView { 308 | if (_headerView == nil) { 309 | _headerView = [[UIView alloc]init]; 310 | _headerView.backgroundColor = COLOR_CLEAR; 311 | 312 | } 313 | return _headerView; 314 | } 315 | 316 | - (UILabel *)timeLabel { 317 | if (_timeLabel == nil) { 318 | _timeLabel = [[UILabel alloc]init]; 319 | _timeLabel.font = FONT_14; 320 | _timeLabel.textColor = COLOR_6; 321 | _timeLabel.textAlignment = NSTextAlignmentLeft; 322 | } 323 | return _timeLabel; 324 | } 325 | 326 | - (UILabel *)titleLabel { 327 | if (_titleLabel == nil) { 328 | _titleLabel = [[UILabel alloc]init]; 329 | _titleLabel.font = FONT_B(30); 330 | _titleLabel.textAlignment = NSTextAlignmentLeft; 331 | _titleLabel.textColor = COLOR_3; 332 | _titleLabel.text = HOME_TITLE; 333 | } 334 | return _titleLabel; 335 | } 336 | 337 | - (UIButton *)userButton { 338 | if (_userButton == nil) { 339 | _userButton = [UIButton buttonWithType:UIButtonTypeCustom]; 340 | _userButton.backgroundColor = COLOR_CLEAR; 341 | } 342 | return _userButton; 343 | } 344 | 345 | - (NSMutableArray *)titles { 346 | if (_titles == nil) { 347 | _titles = [[NSMutableArray alloc]init]; 348 | } 349 | return _titles; 350 | } 351 | 352 | - (NSMutableArray *)titleTwos { 353 | if (_titleTwos == nil) { 354 | _titleTwos = [[NSMutableArray alloc]init]; 355 | } 356 | return _titleTwos; 357 | } 358 | 359 | - (NSMutableArray *)contents { 360 | if (_contents == nil) { 361 | _contents = [[NSMutableArray alloc]init]; 362 | } 363 | return _contents; 364 | } 365 | 366 | @end 367 | -------------------------------------------------------------------------------- /PushTransitionDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationLandscapeLeft 34 | UIInterfaceOrientationLandscapeRight 35 | UIInterfaceOrientationPortrait 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/CenterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CenterViewController.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CenterViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/CenterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CenterViewController.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "CenterViewController.h" 10 | 11 | @interface CenterViewController () 12 | 13 | @end 14 | 15 | @implementation CenterViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor grayColor]; 20 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(Tap:)]; 21 | [self.view addGestureRecognizer:tap]; 22 | } 23 | 24 | - (void)Tap:(UITapGestureRecognizer *)tap { 25 | [self dismissViewControllerAnimated:YES completion:nil]; 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/CommunityViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommunityViewController.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CommunityViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/CommunityViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CommunityViewController.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "CommunityViewController.h" 10 | 11 | @interface CommunityViewController () 12 | 13 | @end 14 | 15 | @implementation CommunityViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | } 20 | 21 | - (void)didReceiveMemoryWarning { 22 | [super didReceiveMemoryWarning]; 23 | } 24 | 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/FunctionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FunctionViewController.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FunctionViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/FunctionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FunctionViewController.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "FunctionViewController.h" 10 | 11 | @interface FunctionViewController () 12 | 13 | @end 14 | 15 | @implementation FunctionViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/MineViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MineViewController.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MineViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/MineViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MineViewController.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "MineViewController.h" 10 | 11 | @interface MineViewController () 12 | 13 | @end 14 | 15 | @implementation MineViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | /* 28 | #pragma mark - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 32 | // Get the new view controller using [segue destinationViewController]. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/UIColor+ConvertColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+ConvertColor.h 3 | // NewChannelInternal 4 | // 5 | // Created by Lichaowei on 13-11-13. 6 | // Copyright (c) 2013年 李 沛然. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (ConvertColor) 12 | + (UIColor *) colorWithHexString: (NSString *)color; 13 | @end 14 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/UIColor+ConvertColor.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+ConvertColor.m 3 | // NewChannelInternal 4 | // 5 | // Created by Lichaowei on 13-11-13. 6 | // Copyright (c) 2013年 李 沛然. All rights reserved. 7 | // 8 | 9 | #import "UIColor+ConvertColor.h" 10 | 11 | @implementation UIColor (ConvertColor) 12 | 13 | + (UIColor *) colorWithHexString: (NSString *)color 14 | { 15 | NSString *cString = [[color stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; 16 | 17 | // String should be 6 or 8 characters 18 | if ([cString length] < 6) { 19 | return [UIColor clearColor]; 20 | } 21 | // strip 0X if it appears 22 | if ([cString hasPrefix:@"0X"]) 23 | cString = [cString substringFromIndex:2]; 24 | if ([cString hasPrefix:@"#"]) 25 | cString = [cString substringFromIndex:1]; 26 | if ([cString length] != 6) 27 | return [UIColor clearColor]; 28 | // Separate into r, g, b substrings 29 | NSRange range; 30 | range.location = 0; 31 | range.length = 2; 32 | //r 33 | NSString *rString = [cString substringWithRange:range]; 34 | //g 35 | range.location = 2; 36 | NSString *gString = [cString substringWithRange:range]; 37 | //b 38 | range.location = 4; 39 | NSString *bString = [cString substringWithRange:range]; 40 | // Scan values 41 | unsigned int r, g, b; 42 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 43 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 44 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 45 | // //nslog(@"%d %d %d",r,g,b); 46 | return [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:1.0f]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/UILabel+Size.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Size.h 3 | // EasyPoints 4 | // 5 | // Created by 马克鑫 on 16/8/1. 6 | // Copyright © 2016年 L. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UILabel (Size) 12 | +(CGSize)withString:(NSString *)string font:(UIFont *)font; 13 | 14 | +(CGSize)withString:(NSString *)string font:(UIFont *)font ViewWidth:(float)Width; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/UILabel+Size.m: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Size.m 3 | // EasyPoints 4 | // 5 | // Created by 马克鑫 on 16/8/1. 6 | // Copyright © 2016年 L. All rights reserved. 7 | // 8 | 9 | #import "UILabel+Size.h" 10 | 11 | @implementation UILabel (Size) 12 | +(CGSize)withString:(NSString *)string font:(UIFont *)font 13 | { 14 | 15 | CGSize LabelSize; 16 | if ([UIDevice currentDevice].systemVersion.floatValue>=7.0) 17 | { 18 | LabelSize=[string boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesFontLeading|NSStringDrawingTruncatesLastVisibleLine |NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size; 19 | } 20 | else 21 | { 22 | //ios7 以下版本 23 | LabelSize=[string sizeWithFont:font constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT)]; 24 | } 25 | 26 | return LabelSize; 27 | } 28 | 29 | +(CGSize)withString:(NSString *)string font:(UIFont *)font ViewWidth:(float)Width 30 | { 31 | CGSize LabelSize; 32 | if ([UIDevice currentDevice].systemVersion.floatValue>=7.0) 33 | { 34 | LabelSize=[string boundingRectWithSize:CGSizeMake(Width, MAXFLOAT) options:NSStringDrawingUsesFontLeading|NSStringDrawingTruncatesLastVisibleLine |NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size; 35 | } 36 | else 37 | { 38 | //ios7 以下版本 39 | LabelSize=[string sizeWithFont:font constrainedToSize:CGSizeMake(Width, MAXFLOAT)]; 40 | } 41 | 42 | return LabelSize; 43 | 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/WBTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBTool.h 3 | // WILLB 4 | // 5 | // Created by sjimac01 on 2017/11/29. 6 | // Copyright © 2017年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | @interface WBTool : NSObject 13 | 14 | 15 | /** 16 | 验证手机号是否合法 17 | 18 | @param mobileNum 手机号 19 | @return YES NO 20 | */ 21 | + (BOOL)isMobileNumber:(NSString *)mobileNum; 22 | 23 | /** 24 | 检查是否含有大写字母 25 | 26 | @param capital 检查字符串 27 | @return YES 有 NO 没有 28 | */ 29 | + (BOOL)isCapital:(NSString *)capital; 30 | 31 | /** 32 | 检查时候含有小写字母 33 | 34 | @param letter 检查字符串 35 | @return YES 有 NO 没有 36 | */ 37 | + (BOOL)isLetter:(NSString *)letter; 38 | 39 | /** 40 | 检查是否含有数字 41 | 42 | @param number 检查字符串 43 | @return YES 有 NO 没有 44 | */ 45 | + (BOOL)isNumber:(NSString *)number; 46 | 47 | /** 48 | 检查是否含有特殊字符 49 | 50 | @param character 检查字符串 51 | @return YES 有 NO 没有 52 | */ 53 | + (BOOL)isCharacter:(NSString *)character; 54 | 55 | /** 56 | 检查密码是否合法 57 | 58 | @param passwordLength 密码字符串 59 | @return YES 通过 NO 不通过 60 | */ 61 | + (BOOL)isPasswordLength:(NSString *)passwordLength; 62 | 63 | /** 64 | 检查用户名是否合法 65 | 66 | @param nickname 用户名 67 | @return YES 合法 NO 不合法 68 | */ 69 | + (BOOL)isNickname:(NSString *)nickname; 70 | 71 | /** 72 | 检查邮箱是否合法 73 | 74 | @param email 邮箱字符串 75 | @return YES 合法 NO 不合法 76 | */ 77 | + (BOOL)isValidateEmail:(NSString *)email; 78 | 79 | 80 | /** 81 | 判断手机版本 82 | 83 | @return 手机版本号 84 | */ 85 | + (NSString*)iphoneType; 86 | 87 | 88 | /** 89 | 获取wifi名字 90 | 91 | @return wifi名字 92 | */ 93 | + (NSString *)getWifiName; 94 | 95 | /** 96 | 时间戳转换时间 mm:ss 97 | 98 | @param time 时间戳 99 | @return 返回hh:kk 100 | */ 101 | + (NSString *)getTimeWithTimeInterval:(NSString *)time; 102 | 103 | 104 | /** 105 | 时间戳转换日期 yyyy.mm.ss 106 | 107 | @param time 时间戳 108 | @return 返回yyyy.mm.ss 109 | */ 110 | + (NSString *)getDateWithTimeInterval:(NSString *)time; 111 | 112 | /** 113 | 时间戳转换日期 yyyy-MM-dd HH:mm:ss 114 | 115 | @param time 时间戳 116 | @return 返回yyyy.mm.ss 117 | */ 118 | + (NSString *)getDateWithTimeInterval2:(NSString *)time; 119 | 120 | 121 | /** 122 | 截取图片 123 | 124 | @param imgSize 尺寸 125 | @param view 要截取的view 126 | @return 图片 127 | */ 128 | + (UIImage *)screenImageWithSize:(CGSize )imgSize View:(UIView *)view; 129 | 130 | 131 | /** 132 | 多少天前 133 | 134 | @param oldTime 过去时间 135 | @param newTime 当前时间 136 | @return 多少天前 137 | */ 138 | + (NSString *)timeConversionWithOldTime:(NSString *)oldTime NewTime:(NSString *)newTime; 139 | 140 | /** 141 | 多少天前 142 | 143 | @param time 时间戳 144 | @return 多少天前 145 | */ 146 | + (NSString *)timeConversionWithTime:(NSString *)time; 147 | 148 | /** 149 | 两个时间戳(234231342314)计算时间差 (int)xxxx 分钟 150 | 151 | @param startDate 开始时间 时间戳 152 | @param endDate 结束时间 时间戳 153 | @return 时间差 154 | */ 155 | + (int)minutesWithStartDate:(NSString *)startDate endDate:(NSString *)endDate; 156 | 157 | 158 | /** 159 | 两个时间(hh:mm)计算时间差 xxxx分钟 160 | 161 | @param startDate 开始时间 hh:mm 162 | @param endDate 结束时间 hh:mm 163 | @return 时间差 164 | */ 165 | + (int)minutesWithStartTime:(NSString *)startDate endTime:(NSString *)endDate; 166 | 167 | /** 168 | 两个时间计算时间差 xx小时xx分钟 169 | 170 | @param startDate xx:xx 171 | @param endDate xx:xx 172 | @return xx小时xx分钟 173 | */ 174 | + (NSString *)hoursWithStartDate:(NSString *)startDate endDate:(NSString *)endDate; 175 | 176 | 177 | 178 | /** 179 | 日期加星期 xxxx-xx-xx(xxx) 180 | 181 | @param timeInterval 时间戳 182 | @return xxxx-xx-xx(xxx) 183 | */ 184 | + (NSString *)getWeekDateWithTimeInterval:(NSString *)timeInterval; 185 | 186 | 187 | /** 188 | 获取当前时间戳 189 | 190 | @return 时间戳 191 | */ 192 | + (NSString *)getNowTimeTimestamp; 193 | 194 | 195 | /** 196 | 字符串去(null) 197 | 198 | @param str 输入 199 | @return 输出 200 | */ 201 | + (NSString *)stringWithString:(id)str; 202 | 203 | 204 | /** 205 | 颜色转图片 206 | 207 | @param color 颜色 208 | @return 图片 209 | */ 210 | + (UIImage*)createImageWithColor:(UIColor*)color; 211 | 212 | 213 | /** 214 | 颜色转图片带size 215 | 216 | @param color 颜色 217 | @param size size 218 | @return 图片 219 | */ 220 | + (UIImage*)createImageWithColor:(UIColor*)color size:(CGSize)size; 221 | 222 | @end 223 | -------------------------------------------------------------------------------- /PushTransitionDemo/Others/WBTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // WBTool.m 3 | // WILLB 4 | // 5 | // Created by sjimac01 on 2017/11/29. 6 | // Copyright © 2017年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "WBTool.h" 10 | #import 11 | @implementation WBTool 12 | 13 | #pragma mark - 检测是否是手机号码 14 | + (BOOL)isMobileNumber:(NSString *)mobileNum 15 | { 16 | NSString *MOBILE = @"^1(3[0-9]|4[579]|5[0-35-9]|7[0135-8]|8[0-9])\\d{8}$"; 17 | 18 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE]; 19 | 20 | return [regextestmobile evaluateWithObject:mobileNum]; 21 | } 22 | 23 | #pragma mark - 检验是否含有大写字母 24 | + (BOOL)isCapital:(NSString *)capital 25 | { 26 | NSString *CAPITAL = @"[A-Z]+"; 27 | 28 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CAPITAL]; 29 | 30 | BOOL isyes = [regextestmobile evaluateWithObject:capital]; 31 | 32 | return isyes; 33 | } 34 | 35 | #pragma mark - 检验是否含有小写字母 36 | + (BOOL)isLetter:(NSString *)letter 37 | { 38 | NSString *LETTER = @"[a-z]+"; 39 | 40 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", LETTER]; 41 | 42 | return [regextestmobile evaluateWithObject:letter]; 43 | } 44 | 45 | #pragma mark - 检验是否含有数字 46 | + (BOOL)isNumber:(NSString *)number 47 | { 48 | NSString *NUMBER = @"[0-9]+"; 49 | 50 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", NUMBER]; 51 | 52 | return [regextestmobile evaluateWithObject:number]; 53 | } 54 | 55 | #pragma mark - 检验是否含有特殊字符 56 | + (BOOL)isCharacter:(NSString *)character 57 | { 58 | NSString *CHARACTER = @"[^%&',;=?$\x22]+"; 59 | 60 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CHARACTER]; 61 | 62 | return [regextestmobile evaluateWithObject:character]; 63 | } 64 | 65 | #pragma mark - 检验密码长度 66 | + (BOOL)isPasswordLength:(NSString *)passwordLength 67 | { 68 | //NSString *PASSWORD = @"^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{8,12}$"; 69 | NSString *PASSWORD = @"^(?![0-9]+$)(?![a-zA-Z]+$)[a-zA-Z0-9]{8,12}"; 70 | 71 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", PASSWORD]; 72 | 73 | 74 | return [regextestmobile evaluateWithObject:passwordLength]; 75 | } 76 | 77 | #pragma mark - 检验用户名 78 | + (BOOL)isNickname:(NSString *)nickname 79 | { 80 | NSString *NICKNAME = @"^[a-zA-Z0-9\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]{1,16}$"; 81 | 82 | NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", NICKNAME]; 83 | 84 | 85 | return [regextestmobile evaluateWithObject:nickname]; 86 | } 87 | 88 | #pragma mark - 检验邮箱 89 | + (BOOL)isValidateEmail:(NSString *)email{ 90 | NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 91 | NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 92 | return [emailTest evaluateWithObject:email]; 93 | } 94 | 95 | 96 | + (NSString*)iphoneType { 97 | 98 | //需要导入头文件:#import 99 | 100 | struct utsname systemInfo; 101 | 102 | uname(&systemInfo); 103 | 104 | NSString*platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding]; 105 | if([platform isEqualToString:@"iPhone1,1"]) return@"iPhone 2G"; 106 | if([platform isEqualToString:@"iPhone1,2"]) return@"iPhone 3G"; 107 | if([platform isEqualToString:@"iPhone2,1"]) return@"iPhone 3GS"; 108 | if([platform isEqualToString:@"iPhone3,1"]) return@"iPhone 4"; 109 | if([platform isEqualToString:@"iPhone3,2"]) return@"iPhone 4"; 110 | if([platform isEqualToString:@"iPhone3,3"]) return@"iPhone 4"; 111 | if([platform isEqualToString:@"iPhone4,1"]) return@"iPhone 4S"; 112 | if([platform isEqualToString:@"iPhone5,1"]) return@"iPhone 5"; 113 | if([platform isEqualToString:@"iPhone5,2"]) return@"iPhone 5"; 114 | if([platform isEqualToString:@"iPhone5,3"]) return@"iPhone 5c"; 115 | if([platform isEqualToString:@"iPhone5,4"]) return@"iPhone 5c"; 116 | if([platform isEqualToString:@"iPhone6,1"]) return@"iPhone 5s"; 117 | if([platform isEqualToString:@"iPhone6,2"]) return@"iPhone 5s"; 118 | if([platform isEqualToString:@"iPhone7,1"]) return@"iPhone 6 Plus"; 119 | if([platform isEqualToString:@"iPhone7,2"]) return@"iPhone 6"; 120 | if([platform isEqualToString:@"iPhone8,1"]) return@"iPhone 6s"; 121 | if([platform isEqualToString:@"iPhone8,2"]) return@"iPhone 6s Plus"; 122 | if([platform isEqualToString:@"iPhone8,4"]) return@"iPhone SE"; 123 | if([platform isEqualToString:@"iPhone9,1"]) return@"iPhone 7"; 124 | if([platform isEqualToString:@"iPhone9,2"]) return@"iPhone 7 Plus"; 125 | if([platform isEqualToString:@"iPhone10,1"]) return@"iPhone 8"; 126 | if([platform isEqualToString:@"iPhone10,4"]) return@"iPhone 8"; 127 | if([platform isEqualToString:@"iPhone10,2"]) return@"iPhone 8 Plus"; 128 | if([platform isEqualToString:@"iPhone10,5"]) return@"iPhone 8 Plus"; 129 | if([platform isEqualToString:@"iPhone10,3"]) return@"iPhone X"; 130 | if([platform isEqualToString:@"iPhone10,6"]) return@"iPhone X"; 131 | if([platform isEqualToString:@"iPod1,1"]) return@"iPod Touch 1G"; 132 | if([platform isEqualToString:@"iPod2,1"]) return@"iPod Touch 2G"; 133 | if([platform isEqualToString:@"iPod3,1"]) return@"iPod Touch 3G"; 134 | if([platform isEqualToString:@"iPod4,1"]) return@"iPod Touch 4G"; 135 | if([platform isEqualToString:@"iPod5,1"]) return@"iPod Touch 5G"; 136 | if([platform isEqualToString:@"iPad1,1"]) return@"iPad 1G"; 137 | if([platform isEqualToString:@"iPad2,1"]) return@"iPad 2"; 138 | if([platform isEqualToString:@"iPad2,2"]) return@"iPad 2"; 139 | if([platform isEqualToString:@"iPad2,3"]) return@"iPad 2"; 140 | if([platform isEqualToString:@"iPad2,4"]) return@"iPad 2"; 141 | if([platform isEqualToString:@"iPad2,5"]) return@"iPad Mini 1G"; 142 | if([platform isEqualToString:@"iPad2,6"]) return@"iPad Mini 1G"; 143 | if([platform isEqualToString:@"iPad2,7"]) return@"iPad Mini 1G"; 144 | if([platform isEqualToString:@"iPad3,1"]) return@"iPad 3"; 145 | if([platform isEqualToString:@"iPad3,2"]) return@"iPad 3"; 146 | if([platform isEqualToString:@"iPad3,3"]) return@"iPad 3"; 147 | if([platform isEqualToString:@"iPad3,4"]) return@"iPad 4"; 148 | if([platform isEqualToString:@"iPad3,5"]) return@"iPad 4"; 149 | if([platform isEqualToString:@"iPad3,6"]) return@"iPad 4"; 150 | if([platform isEqualToString:@"iPad4,1"]) return@"iPad Air"; 151 | if([platform isEqualToString:@"iPad4,2"]) return@"iPad Air"; 152 | if([platform isEqualToString:@"iPad4,3"]) return@"iPad Air"; 153 | if([platform isEqualToString:@"iPad4,4"]) return@"iPad Mini 2G"; 154 | if([platform isEqualToString:@"iPad4,5"]) return@"iPad Mini 2G"; 155 | if([platform isEqualToString:@"iPad4,6"]) return@"iPad Mini 2G"; 156 | if([platform isEqualToString:@"iPad4,7"]) return@"iPad Mini 3"; 157 | if([platform isEqualToString:@"iPad4,8"]) return@"iPad Mini 3"; 158 | if([platform isEqualToString:@"iPad4,9"]) return@"iPad Mini 3"; 159 | if([platform isEqualToString:@"iPad5,1"]) return@"iPad Mini 4"; 160 | if([platform isEqualToString:@"iPad5,2"]) return@"iPad Mini 4"; 161 | if([platform isEqualToString:@"iPad5,3"]) return@"iPad Air 2"; 162 | if([platform isEqualToString:@"iPad5,4"]) return@"iPad Air 2"; 163 | if([platform isEqualToString:@"iPad6,3"]) return@"iPad Pro 9.7"; 164 | if([platform isEqualToString:@"iPad6,4"]) return@"iPad Pro 9.7"; 165 | if([platform isEqualToString:@"iPad6,7"]) return@"iPad Pro 12.9"; 166 | if([platform isEqualToString:@"iPad6,8"]) return@"iPad Pro 12.9"; 167 | 168 | if([platform isEqualToString:@"i386"]) return@"iPhone Simulator"; 169 | if([platform isEqualToString:@"x86_64"]) return@"iPhone Simulator"; 170 | return platform; 171 | 172 | } 173 | 174 | 175 | #pragma mark - 获取wifi名字 176 | 177 | + (NSString *)getWifiName { 178 | NSString *wifiName = nil; 179 | CFArrayRef wifiInterfaces = CNCopySupportedInterfaces(); 180 | if (!wifiInterfaces) { 181 | return nil; 182 | } 183 | NSArray *interfaces = (__bridge NSArray *)wifiInterfaces; 184 | for (NSString *interfaceName in interfaces) { 185 | CFDictionaryRef dictRef = CNCopyCurrentNetworkInfo((__bridge CFStringRef)(interfaceName)); 186 | if (dictRef) { 187 | NSDictionary *networkInfo = (__bridge NSDictionary *)dictRef; 188 | wifiName = [networkInfo objectForKey:(__bridge NSString *)kCNNetworkInfoKeySSID]; 189 | CFRelease(dictRef); 190 | } 191 | } 192 | CFRelease(wifiInterfaces); 193 | return wifiName; 194 | } 195 | 196 | + (NSString *)getTimeWithTimeInterval:(NSString *)time { 197 | // 格式化时间 198 | NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; 199 | formatter.timeZone = [NSTimeZone timeZoneWithName:@"beijing"]; 200 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 201 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 202 | [formatter setDateFormat:@"HH:mm"]; 203 | 204 | // 毫秒值转化为秒 205 | NSDate* date = [NSDate dateWithTimeIntervalSince1970:[time doubleValue]/ 1000.0]; 206 | NSString* dateString = [formatter stringFromDate:date]; 207 | return dateString; 208 | } 209 | 210 | + (NSString *)getDateWithTimeInterval:(NSString *)time { 211 | // 格式化时间 212 | NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; 213 | formatter.timeZone = [NSTimeZone timeZoneWithName:@"beijing"]; 214 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 215 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 216 | [formatter setDateFormat:@"yyyy.MM.dd"]; 217 | 218 | // 毫秒值转化为秒 219 | NSDate* date = [NSDate dateWithTimeIntervalSince1970:[time doubleValue]/ 1000.0]; 220 | NSString* dateString = [formatter stringFromDate:date]; 221 | return dateString; 222 | } 223 | 224 | + (NSString *)getDateWithTimeInterval2:(NSString *)time { 225 | // 格式化时间 226 | NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; 227 | formatter.timeZone = [NSTimeZone timeZoneWithName:@"beijing"]; 228 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 229 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 230 | [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 231 | 232 | // 毫秒值转化为秒 233 | NSDate* date = [NSDate dateWithTimeIntervalSince1970:[time doubleValue]/ 1000.0]; 234 | NSString* dateString = [formatter stringFromDate:date]; 235 | return dateString; 236 | } 237 | 238 | + (UIImage *)screenImageWithSize:(CGSize )imgSize View:(UIView *)view { 239 | UIGraphicsBeginImageContext(imgSize); 240 | CGContextRef context = UIGraphicsGetCurrentContext(); 241 | [view.layer renderInContext:context]; 242 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); 243 | UIGraphicsEndImageContext(); 244 | return img; 245 | } 246 | 247 | + (NSString *)timeConversionWithOldTime:(NSString *)oldTime NewTime:(NSString *)newTime { 248 | 249 | NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init]; 250 | [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 251 | NSDate * lastDate = [dateFormatter dateFromString:oldTime]; 252 | NSDate * nowDate = [dateFormatter dateFromString:newTime]; 253 | 254 | NSTimeInterval time = [nowDate timeIntervalSinceDate:lastDate]; 255 | NSTimeInterval retTime; 256 | if (time < 3600) {//小于一小时 257 | retTime = time/60; 258 | return (retTime<1.0)?@"刚刚":[NSString stringWithFormat:@"%.0f分钟前",retTime]; 259 | } else if (time < 3600*24) {//小于一天 260 | retTime = time/3600; 261 | return (retTime < 1)?@"1小时前":[NSString stringWithFormat:@"%.0f小时前",retTime]; 262 | } else if (time < 3600*24*30) { 263 | retTime = time/(3600*24); 264 | return [NSString stringWithFormat:@"%.0f天前",retTime]; 265 | } else { 266 | return @"30天前"; 267 | } 268 | } 269 | 270 | + (NSString *)timeConversionWithTime:(NSString *)oldTime { 271 | 272 | NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init]; 273 | [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 274 | NSDate * lastDate = [dateFormatter dateFromString:[self getDateWithTimeInterval2:oldTime]]; 275 | NSDate * nowDate = [NSDate date]; 276 | 277 | NSTimeInterval time = [nowDate timeIntervalSinceDate:lastDate]; 278 | NSTimeInterval retTime; 279 | if (time < 3600) {//小于一小时 280 | retTime = time/60; 281 | return (retTime<1.0)?@"刚刚":[NSString stringWithFormat:@"%.0f分钟前",retTime]; 282 | } else if (time < 3600*24) {//小于一天 283 | retTime = time/3600; 284 | return (retTime < 1)?@"1小时前":[NSString stringWithFormat:@"%.0f小时前",retTime]; 285 | } else if (time < 3600*24*30) { 286 | retTime = time/(3600*24); 287 | return [NSString stringWithFormat:@"%.0f天前",retTime]; 288 | } else { 289 | return @"30天前"; 290 | } 291 | } 292 | 293 | + (int)minutesWithStartDate:(NSString *)startDate endDate:(NSString *)endDate { 294 | 295 | NSString * start = [self getTimeWithTimeInterval: startDate]; 296 | NSString * end = [self getTimeWithTimeInterval: endDate]; 297 | NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; 298 | fmt.dateFormat = @"mm:ss"; 299 | NSDate *date1 = [fmt dateFromString:start]; 300 | NSDate *date2 = [fmt dateFromString:end]; 301 | NSTimeInterval time = [date2 timeIntervalSinceDate:date1]; 302 | 303 | return time; 304 | } 305 | 306 | + (int)minutesWithStartTime:(NSString *)startDate endTime:(NSString *)endDate { 307 | 308 | NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; 309 | fmt.dateFormat = @"mm:ss"; 310 | NSDate *date1 = [fmt dateFromString:startDate]; 311 | NSDate *date2 = [fmt dateFromString:endDate]; 312 | NSTimeInterval time = [date2 timeIntervalSinceDate:date1]; 313 | return time; 314 | } 315 | 316 | 317 | + (NSString *)getWeekDateWithTimeInterval:(NSString *)timeInterval { 318 | 319 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 320 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 321 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 322 | [formatter setDateFormat:@"YYYY-MM-dd"]; 323 | NSDate* date = [NSDate dateWithTimeIntervalSince1970:[timeInterval doubleValue]/ 1000.0]; 324 | NSString *dateTime = [formatter stringFromDate:date]; 325 | NSArray*weekdays = [NSArray arrayWithObjects: [NSNull null],@"星期日",@"星期一",@"星期二",@"星期三",@"星期四",@"星期五",@"星期六",nil]; 326 | NSCalendar*calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; 327 | NSTimeZone*timeZone = [[NSTimeZone alloc]initWithName:@"Asia/Shanghai"]; 328 | [calendar setTimeZone: timeZone]; 329 | NSCalendarUnit calendarUnit =NSCalendarUnitWeekday; 330 | NSDateComponents*theComponents = [calendar components:calendarUnit fromDate:date]; 331 | NSString *weekTime = [weekdays objectAtIndex:theComponents.weekday]; 332 | return [NSString stringWithFormat:@"%@(%@)",dateTime,weekTime]; 333 | } 334 | 335 | + (NSString *)hoursWithStartDate:(NSString *)startDate endDate:(NSString *)endDate { 336 | NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; 337 | fmt.dateFormat = @"mm:ss"; 338 | NSDate *date1 = [fmt dateFromString:startDate]; 339 | NSDate *date2 = [fmt dateFromString:endDate]; 340 | NSTimeInterval time = [date2 timeIntervalSinceDate:date1]; 341 | int hour = time/60; 342 | int miunte = (int)time%60; 343 | if (miunte == 0 ) return [NSString stringWithFormat:@"%d小时",hour]; 344 | return [NSString stringWithFormat:@"%d小时%d分钟",hour,miunte]; 345 | } 346 | 347 | 348 | 349 | 350 | + (NSString *)getNowTimeTimestamp { 351 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ; 352 | [formatter setDateStyle:NSDateFormatterMediumStyle]; 353 | [formatter setTimeStyle:NSDateFormatterShortStyle]; 354 | [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 355 | //设置时区,这个对于时间的处理有时很重要 356 | NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; 357 | [formatter setTimeZone:timeZone]; 358 | NSDate *datenow = [NSDate date];//现在时间,你可以输出来看下是什么格式 359 | NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[datenow timeIntervalSince1970]]; 360 | return timeSp; 361 | } 362 | 363 | + (NSString *)stringWithString:(id)str { 364 | NSString *temp = [NSString stringWithFormat:@"%@",str]; 365 | temp = [temp stringByReplacingOccurrencesOfString:@"(null)" withString:@""]; 366 | temp = [temp stringByReplacingOccurrencesOfString:@"" withString:@""]; 367 | return temp; 368 | } 369 | 370 | 371 | + (UIImage*)createImageWithColor:(UIColor*)color { 372 | 373 | CGRect rect=CGRectMake(0.0f,0.0f,1.0f,1.0f); 374 | UIGraphicsBeginImageContext(rect.size); 375 | CGContextRef context=UIGraphicsGetCurrentContext(); 376 | CGContextSetFillColorWithColor(context, [color CGColor]); 377 | CGContextFillRect(context, rect); 378 | UIImage*theImage=UIGraphicsGetImageFromCurrentImageContext(); 379 | UIGraphicsEndImageContext(); 380 | 381 | 382 | return theImage; 383 | } 384 | 385 | + (UIImage*)createImageWithColor:(UIColor*)color size:(CGSize)size { 386 | 387 | UIGraphicsBeginImageContextWithOptions(size, false, [UIScreen mainScreen].scale); 388 | CGContextRef context = UIGraphicsGetCurrentContext(); 389 | [color setFill]; 390 | CGContextAddRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, size.width, size.height)); 391 | CGContextDrawPath(context,kCGPathFill); 392 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 393 | UIGraphicsEndImageContext(); 394 | 395 | return image; 396 | } 397 | 398 | @end 399 | -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarCostom/TabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TabBarController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarCostom/TabBarController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "TabBarController.h" 10 | #import "HomeViewController.h" 11 | #import "FunctionViewController.h" 12 | #import "CenterViewController.h" 13 | #import "CommunityViewController.h" 14 | #import "MineViewController.h" 15 | #import "Tabbar.h" 16 | @interface TabBarController () 17 | @property (strong, nonatomic) Tabbar *customTabbar; 18 | 19 | @end 20 | 21 | @implementation TabBarController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | 26 | // 首页 27 | HomeViewController *homeVC = [[HomeViewController alloc]init]; 28 | [self setViewController:homeVC title:@"首页" image:@"TB_home_normal" selectImage:@"TB_home_press"]; 29 | // 功能 30 | FunctionViewController *funcVC = [[FunctionViewController alloc]init]; 31 | [self setViewController:funcVC title:@"功能" image:@"TB_function_normal" selectImage:@"TB_function_press"]; 32 | // 社区 33 | CommunityViewController *commVC = [[CommunityViewController alloc]init]; 34 | [self setViewController:commVC title:@"社区" image:@"TB_community_normal" selectImage:@"TB_community_press"]; 35 | // 我的 36 | MineViewController *mineVC = [[MineViewController alloc]init]; 37 | [self setViewController:mineVC title:@"我的" image:@"TB_mine_normal" selectImage:@"TB_mine_press"]; 38 | 39 | self.customTabbar = [[Tabbar alloc]initWithCenterImage:@"homePage_saoyisao" selectImage:@"homePage_saoyisao" target:self action:@selector(CenterButtonClick)]; 40 | [self setValue:self.customTabbar forKey:@"tabBar"]; 41 | } 42 | 43 | #pragma mark - 添加子控制器 44 | -(void)setViewController:(UIViewController *)viewController title:(NSString *)title image:(NSString *)image selectImage:(NSString *)selectImage { 45 | static NSInteger index = 0; 46 | viewController.tabBarItem.title = title; 47 | viewController.title = title; 48 | viewController.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 49 | viewController.tabBarItem.selectedImage = [[UIImage imageNamed:selectImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 50 | viewController.tabBarItem.tag = index; 51 | index++; 52 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewController]; 53 | [self addChildViewController:nav]; 54 | } 55 | 56 | - (void)CenterButtonClick { 57 | CenterViewController *centerVC = [[CenterViewController alloc]init]; 58 | [self presentViewController:centerVC animated:YES completion:nil]; 59 | } 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarCostom/Tabbar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tabbar.h 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | #define RGB_S(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 9 | 10 | #import 11 | 12 | @interface Tabbar : UITabBar 13 | @property (strong, nonatomic) UIButton *centerButton; 14 | 15 | - (instancetype)initWithCenterImage:(NSString *)centerImage selectImage:(NSString *)selectImage target:(id)target action:(SEL)action; 16 | 17 | 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarCostom/Tabbar.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tabbar.m 3 | // TabBarControllerCustomDemo 4 | // 5 | // Created by sjimac01 on 2018/1/24. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "Tabbar.h" 10 | 11 | @implementation Tabbar 12 | 13 | - (instancetype)initWithCenterImage:(NSString *)centerImage selectImage:(NSString *)selectImage target:(id)target action:(SEL)action { 14 | if (self = [super init]) { 15 | self.userInteractionEnabled = YES; 16 | self.tintColor = RGB_S(0x0FB5BA); 17 | self.translucent = YES; 18 | [self.centerButton setBackgroundImage:[UIImage imageNamed:centerImage] forState:UIControlStateNormal]; 19 | [self.centerButton setBackgroundImage:[UIImage imageNamed:selectImage] forState:UIControlStateHighlighted]; 20 | [self.centerButton setBackgroundImage:[UIImage imageNamed:selectImage] forState:UIControlStateSelected]; 21 | [self.centerButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; 22 | [self addSubview:self.centerButton]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)layoutSubviews { 28 | [super layoutSubviews]; 29 | 30 | CGFloat centerW = self.centerButton.currentBackgroundImage.size.width; 31 | CGFloat centerH = self.centerButton.currentBackgroundImage.size.height; 32 | 33 | self.centerButton.frame = CGRectMake((self.frame.size.width-centerW)/2, 0, centerW, centerH); 34 | CGFloat itemW = self.frame.size.width / 5; 35 | CGFloat itemIndex = 0; 36 | // 计算每个item位置 37 | for (UIView *child in self.subviews) { 38 | Class class = NSClassFromString(@"UITabBarButton"); 39 | if ([child isKindOfClass:class]) { 40 | child.frame = CGRectMake(itemIndex *itemW, child.frame.origin.y, itemW, child.frame.size.height); 41 | itemIndex ++; 42 | if (itemIndex == 2) { 43 | itemIndex ++; 44 | } 45 | } 46 | } 47 | } 48 | 49 | 50 | #pragma mark - 重写hitTest方法 51 | // TODO: 如果不重写此方法,centerButton超出tabbar的部分点击无效 52 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 53 | // 1. isHidden==NO 表示当前在tabbar页面 54 | if (self.isHidden == NO) { 55 | // 1.1 获取触摸点坐标系转化到centerButton上的CGPoint 56 | CGPoint newPoint = [self convertPoint:point toView:self.centerButton]; 57 | // 1.2 判断point是否在centerButton上,如果在,centerButton来处理点击事件 58 | if ( [self.centerButton pointInside:newPoint withEvent:event]) { 59 | return self.centerButton; 60 | } 61 | // 1.3 如不在,系统自行处理 62 | else{ 63 | return [super hitTest:point withEvent:event]; 64 | } 65 | } 66 | // 2. 不在tabbar页面,系统自行处理点击事件 67 | else { 68 | return [super hitTest:point withEvent:event]; 69 | } 70 | } 71 | 72 | 73 | - (UIButton *)centerButton { 74 | if (_centerButton == nil) { 75 | _centerButton = [UIButton buttonWithType:UIButtonTypeCustom]; 76 | } 77 | return _centerButton; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_community_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_community_normal@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_community_press@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_community_press@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_function_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_function_normal@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_function_press@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_function_press@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_home_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_home_normal@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_home_press@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_home_press@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_mine_normal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_mine_normal@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/TB_mine_press@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/TB_mine_press@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/homePage_saoyisao@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/homePage_saoyisao@2x.png -------------------------------------------------------------------------------- /PushTransitionDemo/TabbarImage/homePage_saoyisao@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/PushTransitionDemo/TabbarImage/homePage_saoyisao@3x.png -------------------------------------------------------------------------------- /PushTransitionDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /PushTransitionDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /PushTransitionDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PushTransitionDemo 4 | // 5 | // Created by sjimac01 on 2018/2/5. 6 | // Copyright © 2018年 sjimac01. 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PushTransitionDemo 2 | [仿App Store Today转场效果视频演示](http://v.youku.com/v_show/id_XMzM4MTA2Njk5Mg==.html?spm=a2h3j.8428770.3416059.1) 3 | 4 | 仿 App Store 首页 Today 转场动画 5 | ![image](https://github.com/YvanLiu/PushTransitionDemo/blob/master/pushDemoImage.png) 6 | -------------------------------------------------------------------------------- /pushDemoImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YvanLiu/PushTransitionDemo/53576b1d7729e15cdefb869acacbdfd629b21f4a/pushDemoImage.png --------------------------------------------------------------------------------