├── .gitignore ├── JhtNewsChannel.podspec ├── JhtNewsChannelDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ ├── Jht.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── JhtNewsChannelDemo.xcscheme │ │ └── xcschememanagement.plist │ └── zl.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── JhtNewsChannelDemo.xcscheme │ └── xcschememanagement.plist ├── JhtNewsChannelDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── ios-template-120.png │ │ ├── ios-template-121.png │ │ ├── ios-template-180.png │ │ ├── ios-template-58.png │ │ ├── ios-template-80.png │ │ └── ios-template-87.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── JhtNewsChannel.framework │ ├── Headers │ │ ├── JhtChannelBarAndSlideViewConnect.h │ │ ├── JhtChannelBarAndSlideViewConnectParamModel.h │ │ ├── JhtChannelBarAndSlideViewSpaceAndFrameModel.h │ │ ├── JhtChannelBarColorAndFontModel.h │ │ ├── JhtChannelBarTailBtnModel.h │ │ ├── JhtNewsChannelItemEditBackgroundColorModel.h │ │ ├── JhtNewsChannelItemEditDistanceModel.h │ │ ├── JhtNewsChannelItemEditParamModel.h │ │ ├── JhtNewsChannelItemEditTextColorModel.h │ │ ├── JhtNewsChannelItemEditTextModel.h │ │ ├── JhtNewsChannelItemEditView.h │ │ ├── JhtNewsChannelItemModel.h │ │ ├── JhtNewsChannelSDK.h │ │ └── JhtTotalSlideView.h │ ├── Info.plist │ └── JhtNewsChannel ├── ViewController │ ├── JhtBaseViewController │ │ ├── JhtBaseViewController.h │ │ └── JhtBaseViewController.m │ ├── JhtNewsChannelViewController │ │ ├── JhtNewsChannelViewController.h │ │ └── JhtNewsChannelViewController.m │ ├── JhtNewsViewController │ │ ├── JhtNewsViewController.h │ │ └── JhtNewsViewController.m │ ├── JhtSortViewDemoVC │ │ ├── JhtSortViewDemoVC.h │ │ └── JhtSortViewDemoVC.m │ └── JhtTabBarController │ │ ├── JhtTabBarController.h │ │ └── JhtTabBarController.m └── main.m ├── JhtNewsChannel_SDK ├── JhtNewsChannel.framework │ ├── Headers │ │ ├── JhtChannelBarAndSlideViewConnect.h │ │ ├── JhtChannelBarAndSlideViewConnectParamModel.h │ │ ├── JhtChannelBarAndSlideViewSpaceAndFrameModel.h │ │ ├── JhtChannelBarColorAndFontModel.h │ │ ├── JhtChannelBarTailBtnModel.h │ │ ├── JhtNewsChannelItemEditBackgroundColorModel.h │ │ ├── JhtNewsChannelItemEditDistanceModel.h │ │ ├── JhtNewsChannelItemEditParamModel.h │ │ ├── JhtNewsChannelItemEditTextColorModel.h │ │ ├── JhtNewsChannelItemEditTextModel.h │ │ ├── JhtNewsChannelItemEditView.h │ │ ├── JhtNewsChannelItemModel.h │ │ ├── JhtNewsChannelSDK.h │ │ ├── JhtNewsChannel_Define.h │ │ ├── JhtTotalSlideView.h │ │ └── JhtTotalSlideViewDelegate.h │ ├── Info.plist │ └── JhtNewsChannel └── JhtNewsChannelImages.bundle │ ├── behindMask@2x.png │ ├── behindMask@3x.png │ ├── deletIcon.png │ ├── frontMask@2x.png │ ├── frontMask@3x.png │ └── more.png ├── LICENSE ├── README.md └── ReadMEImages ├── Gif ├── deleteAndAdd.gif ├── redPoint.gif ├── shake.gif └── slide.gif ├── ModelStructureDiagram ├── connectParamModel.png └── editParamModel.png └── Stationary.PNG /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build 4 | /*.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | !default.xcworkspace 13 | xcuserdata 14 | *.moved-aside 15 | *.mobileprovision 16 | DerivedData 17 | .idea/ 18 | # Pods - for those of you who use CocoaPods 19 | Pods 20 | Podfile 21 | Podfile.lock 22 | *.xcworkspace -------------------------------------------------------------------------------- /JhtNewsChannel.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'JhtNewsChannel' 4 | s.version = '1.0.2' 5 | s.summary = '新闻频道栏/滚动栏' 6 | s.homepage = 'https://github.com/jinht/NewsChannel' 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.author = { 'Jinht' => 'jinjob@icloud.com' } 9 | s.social_media_url = 'https://blog.csdn.net/Anticipate91' 10 | s.platform = :ios 11 | s.ios.deployment_target = '8.0' 12 | s.source = { :git => 'https://github.com/jinht/NewsChannel.git', :tag => s.version } 13 | s.resource = 'JhtNewsChannel_SDK/JhtNewsChannelImages.bundle' 14 | s.ios.vendored_frameworks = 'JhtNewsChannel_SDK/JhtNewsChannel.framework' 15 | s.frameworks = 'UIKit' 16 | 17 | end 18 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8EC6892D21C7DDD900B4AB3D /* JhtNewsChannelImages.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8EC6892B21C7DDD900B4AB3D /* JhtNewsChannelImages.bundle */; }; 11 | 8EC6892E21C7DDD900B4AB3D /* JhtNewsChannel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8EC6892C21C7DDD900B4AB3D /* JhtNewsChannel.framework */; }; 12 | A516FA541E8123270051173E /* JhtTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = A516FA531E8123270051173E /* JhtTabBarController.m */; }; 13 | A54D45581F2D839100CBD1DF /* JhtSortViewDemoVC.m in Sources */ = {isa = PBXBuildFile; fileRef = A54D45571F2D839100CBD1DF /* JhtSortViewDemoVC.m */; }; 14 | A57C4AE21D5893F500E258DB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A57C4AE11D5893F500E258DB /* main.m */; }; 15 | A57C4AE51D5893F500E258DB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A57C4AE41D5893F500E258DB /* AppDelegate.m */; }; 16 | A57C4AEB1D5893F500E258DB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A57C4AE91D5893F500E258DB /* Main.storyboard */; }; 17 | A57C4AED1D5893F500E258DB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A57C4AEC1D5893F500E258DB /* Assets.xcassets */; }; 18 | A57C4AF01D5893F500E258DB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A57C4AEE1D5893F500E258DB /* LaunchScreen.storyboard */; }; 19 | A5D05FF11D5D631C00A6E424 /* JhtBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5D05FF01D5D631C00A6E424 /* JhtBaseViewController.m */; }; 20 | A5D05FF81D5D63C600A6E424 /* JhtNewsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5D05FF71D5D63C600A6E424 /* JhtNewsViewController.m */; }; 21 | A5D05FFC1D5D686800A6E424 /* JhtNewsChannelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5D05FFB1D5D686800A6E424 /* JhtNewsChannelViewController.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | A57C4AF71D5893F600E258DB /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = A57C4AD51D5893F500E258DB /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = A57C4ADC1D5893F500E258DB; 30 | remoteInfo = JhtNewsChannelDemo; 31 | }; 32 | A57C4B021D5893F600E258DB /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = A57C4AD51D5893F500E258DB /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = A57C4ADC1D5893F500E258DB; 37 | remoteInfo = JhtNewsChannelDemo; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 8EC6892B21C7DDD900B4AB3D /* JhtNewsChannelImages.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = JhtNewsChannelImages.bundle; sourceTree = ""; }; 43 | 8EC6892C21C7DDD900B4AB3D /* JhtNewsChannel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JhtNewsChannel.framework; sourceTree = ""; }; 44 | A516FA521E8123270051173E /* JhtTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JhtTabBarController.h; sourceTree = ""; }; 45 | A516FA531E8123270051173E /* JhtTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JhtTabBarController.m; sourceTree = ""; }; 46 | A54D45561F2D839100CBD1DF /* JhtSortViewDemoVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JhtSortViewDemoVC.h; sourceTree = ""; }; 47 | A54D45571F2D839100CBD1DF /* JhtSortViewDemoVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JhtSortViewDemoVC.m; sourceTree = ""; }; 48 | A57C4ADD1D5893F500E258DB /* JhtNewsChannelDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JhtNewsChannelDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | A57C4AE11D5893F500E258DB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | A57C4AE31D5893F500E258DB /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | A57C4AE41D5893F500E258DB /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | A57C4AEA1D5893F500E258DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | A57C4AEC1D5893F500E258DB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | A57C4AEF1D5893F500E258DB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | A57C4AF11D5893F500E258DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | A57C4AF61D5893F600E258DB /* JhtNewsChannelDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JhtNewsChannelDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | A57C4B011D5893F600E258DB /* JhtNewsChannelDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JhtNewsChannelDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | A5D05FEF1D5D631C00A6E424 /* JhtBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JhtBaseViewController.h; sourceTree = ""; }; 59 | A5D05FF01D5D631C00A6E424 /* JhtBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JhtBaseViewController.m; sourceTree = ""; }; 60 | A5D05FF61D5D63C600A6E424 /* JhtNewsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JhtNewsViewController.h; sourceTree = ""; }; 61 | A5D05FF71D5D63C600A6E424 /* JhtNewsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JhtNewsViewController.m; sourceTree = ""; }; 62 | A5D05FFA1D5D686800A6E424 /* JhtNewsChannelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JhtNewsChannelViewController.h; sourceTree = ""; }; 63 | A5D05FFB1D5D686800A6E424 /* JhtNewsChannelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JhtNewsChannelViewController.m; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | A57C4ADA1D5893F500E258DB /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | 8EC6892E21C7DDD900B4AB3D /* JhtNewsChannel.framework in Frameworks */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | A57C4AF31D5893F600E258DB /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | A57C4AFE1D5893F600E258DB /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | ); 87 | runOnlyForDeploymentPostprocessing = 0; 88 | }; 89 | /* End PBXFrameworksBuildPhase section */ 90 | 91 | /* Begin PBXGroup section */ 92 | 8EC6892A21C7DDD900B4AB3D /* JhtNewsChannel_SDK */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 8EC6892B21C7DDD900B4AB3D /* JhtNewsChannelImages.bundle */, 96 | 8EC6892C21C7DDD900B4AB3D /* JhtNewsChannel.framework */, 97 | ); 98 | path = JhtNewsChannel_SDK; 99 | sourceTree = ""; 100 | }; 101 | A516FA511E8123270051173E /* JhtTabBarController */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | A516FA521E8123270051173E /* JhtTabBarController.h */, 105 | A516FA531E8123270051173E /* JhtTabBarController.m */, 106 | ); 107 | path = JhtTabBarController; 108 | sourceTree = ""; 109 | }; 110 | A54D45551F2D839100CBD1DF /* JhtSortViewDemoVC */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | A54D45561F2D839100CBD1DF /* JhtSortViewDemoVC.h */, 114 | A54D45571F2D839100CBD1DF /* JhtSortViewDemoVC.m */, 115 | ); 116 | path = JhtSortViewDemoVC; 117 | sourceTree = ""; 118 | }; 119 | A57C4AD41D5893F500E258DB = { 120 | isa = PBXGroup; 121 | children = ( 122 | 8EC6892A21C7DDD900B4AB3D /* JhtNewsChannel_SDK */, 123 | A57C4ADF1D5893F500E258DB /* JhtNewsChannelDemo */, 124 | A57C4ADE1D5893F500E258DB /* Products */, 125 | ); 126 | sourceTree = ""; 127 | }; 128 | A57C4ADE1D5893F500E258DB /* Products */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | A57C4ADD1D5893F500E258DB /* JhtNewsChannelDemo.app */, 132 | A57C4AF61D5893F600E258DB /* JhtNewsChannelDemoTests.xctest */, 133 | A57C4B011D5893F600E258DB /* JhtNewsChannelDemoUITests.xctest */, 134 | ); 135 | name = Products; 136 | sourceTree = ""; 137 | }; 138 | A57C4ADF1D5893F500E258DB /* JhtNewsChannelDemo */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | A57C4AE31D5893F500E258DB /* AppDelegate.h */, 142 | A57C4AE41D5893F500E258DB /* AppDelegate.m */, 143 | A5D05FE01D5CAF7000A6E424 /* ViewController */, 144 | A57C4AE91D5893F500E258DB /* Main.storyboard */, 145 | A57C4AEC1D5893F500E258DB /* Assets.xcassets */, 146 | A57C4AEE1D5893F500E258DB /* LaunchScreen.storyboard */, 147 | A57C4AF11D5893F500E258DB /* Info.plist */, 148 | A57C4AE01D5893F500E258DB /* Supporting Files */, 149 | ); 150 | path = JhtNewsChannelDemo; 151 | sourceTree = ""; 152 | }; 153 | A57C4AE01D5893F500E258DB /* Supporting Files */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | A57C4AE11D5893F500E258DB /* main.m */, 157 | ); 158 | name = "Supporting Files"; 159 | sourceTree = ""; 160 | }; 161 | A5D05FE01D5CAF7000A6E424 /* ViewController */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | A5D05FEB1D5D62D800A6E424 /* JhtBaseViewController */, 165 | A516FA511E8123270051173E /* JhtTabBarController */, 166 | A5D05FF91D5D686800A6E424 /* JhtNewsChannelViewController */, 167 | A5D05FF51D5D63B900A6E424 /* JhtNewsViewController */, 168 | A54D45551F2D839100CBD1DF /* JhtSortViewDemoVC */, 169 | ); 170 | path = ViewController; 171 | sourceTree = ""; 172 | }; 173 | A5D05FEB1D5D62D800A6E424 /* JhtBaseViewController */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | A5D05FEF1D5D631C00A6E424 /* JhtBaseViewController.h */, 177 | A5D05FF01D5D631C00A6E424 /* JhtBaseViewController.m */, 178 | ); 179 | path = JhtBaseViewController; 180 | sourceTree = ""; 181 | }; 182 | A5D05FF51D5D63B900A6E424 /* JhtNewsViewController */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | A5D05FF61D5D63C600A6E424 /* JhtNewsViewController.h */, 186 | A5D05FF71D5D63C600A6E424 /* JhtNewsViewController.m */, 187 | ); 188 | path = JhtNewsViewController; 189 | sourceTree = ""; 190 | }; 191 | A5D05FF91D5D686800A6E424 /* JhtNewsChannelViewController */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | A5D05FFA1D5D686800A6E424 /* JhtNewsChannelViewController.h */, 195 | A5D05FFB1D5D686800A6E424 /* JhtNewsChannelViewController.m */, 196 | ); 197 | path = JhtNewsChannelViewController; 198 | sourceTree = ""; 199 | }; 200 | /* End PBXGroup section */ 201 | 202 | /* Begin PBXNativeTarget section */ 203 | A57C4ADC1D5893F500E258DB /* JhtNewsChannelDemo */ = { 204 | isa = PBXNativeTarget; 205 | buildConfigurationList = A57C4B0A1D5893F600E258DB /* Build configuration list for PBXNativeTarget "JhtNewsChannelDemo" */; 206 | buildPhases = ( 207 | A57C4AD91D5893F500E258DB /* Sources */, 208 | A57C4ADA1D5893F500E258DB /* Frameworks */, 209 | A57C4ADB1D5893F500E258DB /* Resources */, 210 | ); 211 | buildRules = ( 212 | ); 213 | dependencies = ( 214 | ); 215 | name = JhtNewsChannelDemo; 216 | productName = JhtNewsChannelDemo; 217 | productReference = A57C4ADD1D5893F500E258DB /* JhtNewsChannelDemo.app */; 218 | productType = "com.apple.product-type.application"; 219 | }; 220 | A57C4AF51D5893F600E258DB /* JhtNewsChannelDemoTests */ = { 221 | isa = PBXNativeTarget; 222 | buildConfigurationList = A57C4B0D1D5893F600E258DB /* Build configuration list for PBXNativeTarget "JhtNewsChannelDemoTests" */; 223 | buildPhases = ( 224 | A57C4AF21D5893F600E258DB /* Sources */, 225 | A57C4AF31D5893F600E258DB /* Frameworks */, 226 | A57C4AF41D5893F600E258DB /* Resources */, 227 | ); 228 | buildRules = ( 229 | ); 230 | dependencies = ( 231 | A57C4AF81D5893F600E258DB /* PBXTargetDependency */, 232 | ); 233 | name = JhtNewsChannelDemoTests; 234 | productName = JhtNewsChannelDemoTests; 235 | productReference = A57C4AF61D5893F600E258DB /* JhtNewsChannelDemoTests.xctest */; 236 | productType = "com.apple.product-type.bundle.unit-test"; 237 | }; 238 | A57C4B001D5893F600E258DB /* JhtNewsChannelDemoUITests */ = { 239 | isa = PBXNativeTarget; 240 | buildConfigurationList = A57C4B101D5893F600E258DB /* Build configuration list for PBXNativeTarget "JhtNewsChannelDemoUITests" */; 241 | buildPhases = ( 242 | A57C4AFD1D5893F600E258DB /* Sources */, 243 | A57C4AFE1D5893F600E258DB /* Frameworks */, 244 | A57C4AFF1D5893F600E258DB /* Resources */, 245 | ); 246 | buildRules = ( 247 | ); 248 | dependencies = ( 249 | A57C4B031D5893F600E258DB /* PBXTargetDependency */, 250 | ); 251 | name = JhtNewsChannelDemoUITests; 252 | productName = JhtNewsChannelDemoUITests; 253 | productReference = A57C4B011D5893F600E258DB /* JhtNewsChannelDemoUITests.xctest */; 254 | productType = "com.apple.product-type.bundle.ui-testing"; 255 | }; 256 | /* End PBXNativeTarget section */ 257 | 258 | /* Begin PBXProject section */ 259 | A57C4AD51D5893F500E258DB /* Project object */ = { 260 | isa = PBXProject; 261 | attributes = { 262 | LastUpgradeCheck = 0730; 263 | ORGANIZATIONNAME = JhtNewsChannelDemo; 264 | TargetAttributes = { 265 | A57C4ADC1D5893F500E258DB = { 266 | CreatedOnToolsVersion = 7.3.1; 267 | DevelopmentTeam = Q67TW3T8PL; 268 | }; 269 | A57C4AF51D5893F600E258DB = { 270 | CreatedOnToolsVersion = 7.3.1; 271 | TestTargetID = A57C4ADC1D5893F500E258DB; 272 | }; 273 | A57C4B001D5893F600E258DB = { 274 | CreatedOnToolsVersion = 7.3.1; 275 | TestTargetID = A57C4ADC1D5893F500E258DB; 276 | }; 277 | }; 278 | }; 279 | buildConfigurationList = A57C4AD81D5893F500E258DB /* Build configuration list for PBXProject "JhtNewsChannelDemo" */; 280 | compatibilityVersion = "Xcode 3.2"; 281 | developmentRegion = English; 282 | hasScannedForEncodings = 0; 283 | knownRegions = ( 284 | English, 285 | en, 286 | Base, 287 | ); 288 | mainGroup = A57C4AD41D5893F500E258DB; 289 | productRefGroup = A57C4ADE1D5893F500E258DB /* Products */; 290 | projectDirPath = ""; 291 | projectRoot = ""; 292 | targets = ( 293 | A57C4ADC1D5893F500E258DB /* JhtNewsChannelDemo */, 294 | A57C4AF51D5893F600E258DB /* JhtNewsChannelDemoTests */, 295 | A57C4B001D5893F600E258DB /* JhtNewsChannelDemoUITests */, 296 | ); 297 | }; 298 | /* End PBXProject section */ 299 | 300 | /* Begin PBXResourcesBuildPhase section */ 301 | A57C4ADB1D5893F500E258DB /* Resources */ = { 302 | isa = PBXResourcesBuildPhase; 303 | buildActionMask = 2147483647; 304 | files = ( 305 | A57C4AF01D5893F500E258DB /* LaunchScreen.storyboard in Resources */, 306 | 8EC6892D21C7DDD900B4AB3D /* JhtNewsChannelImages.bundle in Resources */, 307 | A57C4AED1D5893F500E258DB /* Assets.xcassets in Resources */, 308 | A57C4AEB1D5893F500E258DB /* Main.storyboard in Resources */, 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | }; 312 | A57C4AF41D5893F600E258DB /* Resources */ = { 313 | isa = PBXResourcesBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | ); 317 | runOnlyForDeploymentPostprocessing = 0; 318 | }; 319 | A57C4AFF1D5893F600E258DB /* Resources */ = { 320 | isa = PBXResourcesBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | /* End PBXResourcesBuildPhase section */ 327 | 328 | /* Begin PBXSourcesBuildPhase section */ 329 | A57C4AD91D5893F500E258DB /* Sources */ = { 330 | isa = PBXSourcesBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | A516FA541E8123270051173E /* JhtTabBarController.m in Sources */, 334 | A5D05FF11D5D631C00A6E424 /* JhtBaseViewController.m in Sources */, 335 | A57C4AE51D5893F500E258DB /* AppDelegate.m in Sources */, 336 | A54D45581F2D839100CBD1DF /* JhtSortViewDemoVC.m in Sources */, 337 | A5D05FFC1D5D686800A6E424 /* JhtNewsChannelViewController.m in Sources */, 338 | A5D05FF81D5D63C600A6E424 /* JhtNewsViewController.m in Sources */, 339 | A57C4AE21D5893F500E258DB /* main.m in Sources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | A57C4AF21D5893F600E258DB /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | A57C4AFD1D5893F600E258DB /* Sources */ = { 351 | isa = PBXSourcesBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | /* End PBXSourcesBuildPhase section */ 358 | 359 | /* Begin PBXTargetDependency section */ 360 | A57C4AF81D5893F600E258DB /* PBXTargetDependency */ = { 361 | isa = PBXTargetDependency; 362 | target = A57C4ADC1D5893F500E258DB /* JhtNewsChannelDemo */; 363 | targetProxy = A57C4AF71D5893F600E258DB /* PBXContainerItemProxy */; 364 | }; 365 | A57C4B031D5893F600E258DB /* PBXTargetDependency */ = { 366 | isa = PBXTargetDependency; 367 | target = A57C4ADC1D5893F500E258DB /* JhtNewsChannelDemo */; 368 | targetProxy = A57C4B021D5893F600E258DB /* PBXContainerItemProxy */; 369 | }; 370 | /* End PBXTargetDependency section */ 371 | 372 | /* Begin PBXVariantGroup section */ 373 | A57C4AE91D5893F500E258DB /* Main.storyboard */ = { 374 | isa = PBXVariantGroup; 375 | children = ( 376 | A57C4AEA1D5893F500E258DB /* Base */, 377 | ); 378 | name = Main.storyboard; 379 | sourceTree = ""; 380 | }; 381 | A57C4AEE1D5893F500E258DB /* LaunchScreen.storyboard */ = { 382 | isa = PBXVariantGroup; 383 | children = ( 384 | A57C4AEF1D5893F500E258DB /* Base */, 385 | ); 386 | name = LaunchScreen.storyboard; 387 | sourceTree = ""; 388 | }; 389 | /* End PBXVariantGroup section */ 390 | 391 | /* Begin XCBuildConfiguration section */ 392 | A57C4B081D5893F600E258DB /* Debug */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_ANALYZER_NONNULL = YES; 397 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 398 | CLANG_CXX_LIBRARY = "libc++"; 399 | CLANG_ENABLE_MODULES = YES; 400 | CLANG_ENABLE_OBJC_ARC = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_CONSTANT_CONVERSION = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_UNREACHABLE_CODE = YES; 409 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 410 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 411 | COPY_PHASE_STRIP = NO; 412 | DEBUG_INFORMATION_FORMAT = dwarf; 413 | ENABLE_STRICT_OBJC_MSGSEND = YES; 414 | ENABLE_TESTABILITY = YES; 415 | GCC_C_LANGUAGE_STANDARD = gnu99; 416 | GCC_DYNAMIC_NO_PIC = NO; 417 | GCC_NO_COMMON_BLOCKS = YES; 418 | GCC_OPTIMIZATION_LEVEL = 0; 419 | GCC_PREPROCESSOR_DEFINITIONS = ( 420 | "DEBUG=1", 421 | "$(inherited)", 422 | ); 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 430 | MTL_ENABLE_DEBUG_INFO = YES; 431 | ONLY_ACTIVE_ARCH = YES; 432 | SDKROOT = iphoneos; 433 | }; 434 | name = Debug; 435 | }; 436 | A57C4B091D5893F600E258DB /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | ALWAYS_SEARCH_USER_PATHS = NO; 440 | CLANG_ANALYZER_NONNULL = YES; 441 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 442 | CLANG_CXX_LIBRARY = "libc++"; 443 | CLANG_ENABLE_MODULES = YES; 444 | CLANG_ENABLE_OBJC_ARC = YES; 445 | CLANG_WARN_BOOL_CONVERSION = YES; 446 | CLANG_WARN_CONSTANT_CONVERSION = YES; 447 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 448 | CLANG_WARN_EMPTY_BODY = YES; 449 | CLANG_WARN_ENUM_CONVERSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 452 | CLANG_WARN_UNREACHABLE_CODE = YES; 453 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 454 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 455 | COPY_PHASE_STRIP = NO; 456 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 457 | ENABLE_NS_ASSERTIONS = NO; 458 | ENABLE_STRICT_OBJC_MSGSEND = YES; 459 | GCC_C_LANGUAGE_STANDARD = gnu99; 460 | GCC_NO_COMMON_BLOCKS = YES; 461 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 462 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 463 | GCC_WARN_UNDECLARED_SELECTOR = YES; 464 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 465 | GCC_WARN_UNUSED_FUNCTION = YES; 466 | GCC_WARN_UNUSED_VARIABLE = YES; 467 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 468 | MTL_ENABLE_DEBUG_INFO = NO; 469 | SDKROOT = iphoneos; 470 | VALIDATE_PRODUCT = YES; 471 | }; 472 | name = Release; 473 | }; 474 | A57C4B0B1D5893F600E258DB /* Debug */ = { 475 | isa = XCBuildConfiguration; 476 | buildSettings = { 477 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 478 | CODE_SIGN_IDENTITY = "iPhone Developer"; 479 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 480 | DEVELOPMENT_TEAM = Q67TW3T8PL; 481 | FRAMEWORK_SEARCH_PATHS = ( 482 | "$(inherited)", 483 | "$(PROJECT_DIR)/JhtNewsChannelSDK", 484 | "$(PROJECT_DIR)/JhtNewsChannel_SDK", 485 | ); 486 | HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/JhtNewsChannelSDK/JhtNewsChannel.framework/Headers"; 487 | INFOPLIST_FILE = JhtNewsChannelDemo/Info.plist; 488 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 490 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 491 | PRODUCT_BUNDLE_IDENTIFIER = jht.JhtNewsChannelDemo; 492 | PRODUCT_NAME = "$(TARGET_NAME)"; 493 | PROVISIONING_PROFILE = ""; 494 | }; 495 | name = Debug; 496 | }; 497 | A57C4B0C1D5893F600E258DB /* Release */ = { 498 | isa = XCBuildConfiguration; 499 | buildSettings = { 500 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 501 | CODE_SIGN_IDENTITY = "iPhone Developer"; 502 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 503 | DEVELOPMENT_TEAM = Q67TW3T8PL; 504 | FRAMEWORK_SEARCH_PATHS = ( 505 | "$(inherited)", 506 | "$(PROJECT_DIR)/JhtNewsChannelSDK", 507 | "$(PROJECT_DIR)/JhtNewsChannel_SDK", 508 | ); 509 | HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/JhtNewsChannelSDK/JhtNewsChannel.framework/Headers"; 510 | INFOPLIST_FILE = JhtNewsChannelDemo/Info.plist; 511 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 512 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 513 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 514 | PRODUCT_BUNDLE_IDENTIFIER = jht.JhtNewsChannelDemo; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | PROVISIONING_PROFILE = ""; 517 | }; 518 | name = Release; 519 | }; 520 | A57C4B0E1D5893F600E258DB /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | BUNDLE_LOADER = "$(TEST_HOST)"; 524 | INFOPLIST_FILE = JhtNewsChannelDemoTests/Info.plist; 525 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 526 | PRODUCT_BUNDLE_IDENTIFIER = com.jht.JhtNewsChannelDemoTests; 527 | PRODUCT_NAME = "$(TARGET_NAME)"; 528 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JhtNewsChannelDemo.app/JhtNewsChannelDemo"; 529 | }; 530 | name = Debug; 531 | }; 532 | A57C4B0F1D5893F600E258DB /* Release */ = { 533 | isa = XCBuildConfiguration; 534 | buildSettings = { 535 | BUNDLE_LOADER = "$(TEST_HOST)"; 536 | INFOPLIST_FILE = JhtNewsChannelDemoTests/Info.plist; 537 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 538 | PRODUCT_BUNDLE_IDENTIFIER = com.jht.JhtNewsChannelDemoTests; 539 | PRODUCT_NAME = "$(TARGET_NAME)"; 540 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JhtNewsChannelDemo.app/JhtNewsChannelDemo"; 541 | }; 542 | name = Release; 543 | }; 544 | A57C4B111D5893F600E258DB /* Debug */ = { 545 | isa = XCBuildConfiguration; 546 | buildSettings = { 547 | INFOPLIST_FILE = JhtNewsChannelDemoUITests/Info.plist; 548 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 549 | PRODUCT_BUNDLE_IDENTIFIER = com.jht.JhtNewsChannelDemoUITests; 550 | PRODUCT_NAME = "$(TARGET_NAME)"; 551 | TEST_TARGET_NAME = JhtNewsChannelDemo; 552 | }; 553 | name = Debug; 554 | }; 555 | A57C4B121D5893F600E258DB /* Release */ = { 556 | isa = XCBuildConfiguration; 557 | buildSettings = { 558 | INFOPLIST_FILE = JhtNewsChannelDemoUITests/Info.plist; 559 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 560 | PRODUCT_BUNDLE_IDENTIFIER = com.jht.JhtNewsChannelDemoUITests; 561 | PRODUCT_NAME = "$(TARGET_NAME)"; 562 | TEST_TARGET_NAME = JhtNewsChannelDemo; 563 | }; 564 | name = Release; 565 | }; 566 | /* End XCBuildConfiguration section */ 567 | 568 | /* Begin XCConfigurationList section */ 569 | A57C4AD81D5893F500E258DB /* Build configuration list for PBXProject "JhtNewsChannelDemo" */ = { 570 | isa = XCConfigurationList; 571 | buildConfigurations = ( 572 | A57C4B081D5893F600E258DB /* Debug */, 573 | A57C4B091D5893F600E258DB /* Release */, 574 | ); 575 | defaultConfigurationIsVisible = 0; 576 | defaultConfigurationName = Release; 577 | }; 578 | A57C4B0A1D5893F600E258DB /* Build configuration list for PBXNativeTarget "JhtNewsChannelDemo" */ = { 579 | isa = XCConfigurationList; 580 | buildConfigurations = ( 581 | A57C4B0B1D5893F600E258DB /* Debug */, 582 | A57C4B0C1D5893F600E258DB /* Release */, 583 | ); 584 | defaultConfigurationIsVisible = 0; 585 | defaultConfigurationName = Release; 586 | }; 587 | A57C4B0D1D5893F600E258DB /* Build configuration list for PBXNativeTarget "JhtNewsChannelDemoTests" */ = { 588 | isa = XCConfigurationList; 589 | buildConfigurations = ( 590 | A57C4B0E1D5893F600E258DB /* Debug */, 591 | A57C4B0F1D5893F600E258DB /* Release */, 592 | ); 593 | defaultConfigurationIsVisible = 0; 594 | defaultConfigurationName = Release; 595 | }; 596 | A57C4B101D5893F600E258DB /* Build configuration list for PBXNativeTarget "JhtNewsChannelDemoUITests" */ = { 597 | isa = XCConfigurationList; 598 | buildConfigurations = ( 599 | A57C4B111D5893F600E258DB /* Debug */, 600 | A57C4B121D5893F600E258DB /* Release */, 601 | ); 602 | defaultConfigurationIsVisible = 0; 603 | defaultConfigurationName = Release; 604 | }; 605 | /* End XCConfigurationList section */ 606 | }; 607 | rootObject = A57C4AD51D5893F500E258DB /* Project object */; 608 | } 609 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/xcuserdata/Jht.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/xcuserdata/Jht.xcuserdatad/xcschemes/JhtNewsChannelDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/xcuserdata/Jht.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JhtNewsChannelDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A57C4ADC1D5893F500E258DB 16 | 17 | primary 18 | 19 | 20 | A57C4AF51D5893F600E258DB 21 | 22 | primary 23 | 24 | 25 | A57C4B001D5893F600E258DB 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/xcuserdata/zl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/xcuserdata/zl.xcuserdatad/xcschemes/JhtNewsChannelDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo.xcodeproj/xcuserdata/zl.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JhtNewsChannelDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A57C4ADC1D5893F500E258DB 16 | 17 | primary 18 | 19 | 20 | A57C4AF51D5893F600E258DB 21 | 22 | primary 23 | 24 | 25 | A57C4B001D5893F600E258DB 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JhtNewsChannelDemo 4 | // 5 | // Created by Jht on 16/8/8. 6 | // Copyright © 2016年 JhtNewsChannelDemo. 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 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JhtNewsChannelDemo 4 | // 5 | // Created by Jht on 16/8/8. 6 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "JhtSortViewDemoVC.h" 11 | #import "JhtTabBarController.h" 12 | #import "JhtNewsChannelViewController.h" 13 | 14 | @interface AppDelegate () 15 | 16 | @end 17 | 18 | 19 | @implementation AppDelegate 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | JhtNewsChannelViewController *newsChannel = [[JhtNewsChannelViewController alloc ] init]; 23 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:newsChannel]; 24 | 25 | /** // 含有TabBar的情况 26 | JhtTabBarController *VC = [[JhtTabBarController alloc] init]; 27 | self.window.rootViewController = VC; 28 | */ 29 | 30 | /** // 单独使用排序View 31 | JhtSortViewDemoVC *sort = [[JhtSortViewDemoVC alloc] init]; 32 | self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:sort]; 33 | */ 34 | 35 | return YES; 36 | } 37 | 38 | - (void)applicationWillResignActive:(UIApplication *)application { 39 | // 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. 40 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 41 | } 42 | 43 | - (void)applicationDidEnterBackground:(UIApplication *)application { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | } 47 | 48 | - (void)applicationWillEnterForeground:(UIApplication *)application { 49 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | - (void)applicationWillTerminate:(UIApplication *)application { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "ios-template-58.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "ios-template-87.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "ios-template-80.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "ios-template-120.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "ios-template-121.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "ios-template-180.png", 37 | "scale" : "3x" 38 | } 39 | ], 40 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-120.png -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-121.png -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-180.png -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-58.png -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-80.png -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/Assets.xcassets/AppIcon.appiconset/ios-template-87.png -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtChannelBarAndSlideViewConnect.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarAndSlideViewConnect.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/18. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtTotalSlideView.h" 13 | @class JhtNewsChannelItemEditParamModel; 14 | @class JhtChannelBarAndSlideViewConnectParamModel; 15 | 16 | /** 所在类是否含有NavigationBar || TabBar_枚举 */ 17 | typedef NS_ENUM(NSUInteger, Jht_IsExist_NT) { 18 | // 只含有NavigationBar(Default) 19 | NT_OnlyHave_N, 20 | // 只含有TabBar 21 | NT_OnlyHave_T, 22 | // NavigationBar && TabBar都含有 23 | NT_Have, 24 | // NavigationBar && TabBar都不含有 25 | NT_None 26 | }; 27 | 28 | 29 | /** 频道栏和下边滚动View的结合体 */ 30 | @interface JhtChannelBarAndSlideViewConnect : JhtTotalSlideView 31 | #pragma mark - property 32 | /** 缓存总数 */ 33 | @property (nonatomic, assign) NSInteger cacheCount; 34 | /** 频道数组 */ 35 | @property (nonatomic, strong) NSMutableArray *channelArray; 36 | /** 上级传过来,装有ChannelModel 待添加的数组 */ 37 | @property (nonatomic, strong) NSMutableArray *toAddItemArray; 38 | 39 | /** 是否添加频道栏尾部的加号Btn */ 40 | @property (nonatomic, assign) BOOL isAddTailBtn; 41 | /** 频道栏尾部的Btn */ 42 | @property (nonatomic, strong) UIButton *channelBarTailBtn; 43 | 44 | /** 排序界面View */ 45 | @property (nonatomic, strong) UIView *sortView; 46 | /** 不能移动的名字数组 */ 47 | @property (nonatomic, strong) NSMutableArray *notMoveNameArray; 48 | /** 是否存在删除btn yes是存在删除 */ 49 | @property (nonatomic, assign) BOOL isExistDelete; 50 | 51 | /** 轨道栏前边的阴影 */ 52 | @property (nonatomic, strong) UIImageView *frontImageView; 53 | /** 轨道栏后边的阴影 */ 54 | @property (nonatomic, strong) UIImageView *behindImageView; 55 | /** 频道栏之间横向间距 */ 56 | @property (nonatomic, assign) CGFloat itemSpace; 57 | /** 底部的线 */ 58 | @property (nonatomic, strong) UIView *lowLineView; 59 | /** 用于排序界面参数model */ 60 | @property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel; 61 | 62 | /** 整体距离顶部的高度 63 | * 注:只适用于NT_OnlyHave_T || NT_None 两种形式(即不存在navigationBar),default = [[UIApplication sharedApplication] statusBarFrame].size.height 64 | */ 65 | @property (nonatomic, assign) CGFloat connectToTopSpace; 66 | 67 | 68 | 69 | #pragma mark - Public Method 70 | /** 创建ChannelBarAndSliderView和排序删除界面 71 | * barAndSlideModel:用于设置sliderView和bar参数model(含有部分属性默认值) 72 | * itemEditModel:用于排序界面的参数设置(含有部分属性默认值) 73 | * withIsExistNavOrTab:是否含有NavigationBar || TabBar_枚举 74 | * channelArray:已经添加的频道数组 存储JhtNewsChannelItemModel (必要参数,并且是存储JhtNewsChannelItemModel的数组) 75 | * baseViewController:所处于的VC 76 | * delegate:委托 77 | */ 78 | - (id)initSlideViewAndItemEditViewWithBarAndSlideModel:(JhtChannelBarAndSlideViewConnectParamModel *)barAndSlideModel withNewsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel withIsExistNavOrTab:(Jht_IsExist_NT)isExistType withChanelArray:(NSMutableArray *)channelArray withBaseViewController:(id)baseViewController withDelegte:(id)delegate; 79 | 80 | /** 根据名字数组,得到新的频道栏model */ 81 | - (NSMutableArray *)getNewChannelItemModelWithNameArray:(NSArray *)nameArray; 82 | 83 | /** 判断频道栏尾部按钮是否可以被点击 84 | * enable:YES--可以被点击 85 | */ 86 | - (void)judgeChannelBarTailBtnIsEnableClick:(BOOL)enable; 87 | 88 | /** 隐藏或者出现小红点 89 | * hidden:YES--隐藏 90 | * index:topBar 中频道栏的index 91 | */ 92 | - (void)redPonitIsHidden:(BOOL)hidden withIndex:(NSInteger)index; 93 | 94 | /** 是否展示“排序拖拽”按钮 95 | * hidden:YES--隐藏 96 | */ 97 | - (void)isHiddenTopEditItemBtn:(BOOL)hidden; 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtChannelBarAndSlideViewConnectParamModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarAndSlideViewConnectModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/30. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | #import "JhtNewsChannelItemModel.h" 14 | #import "JhtChannelBarTailBtnModel.h" 15 | #import "JhtChannelBarColorAndFontModel.h" 16 | #import "JhtChannelBarAndSlideViewSpaceAndFrameModel.h" 17 | 18 | /** JhtChannelBarAndSlideViewConnect_参数model */ 19 | @interface JhtChannelBarAndSlideViewConnectParamModel : NSObject 20 | 21 | #pragma mark required 22 | /** 缓存的页数 */ 23 | @property (nonatomic, assign) NSInteger cacheCount; 24 | /** 选中的索引值 */ 25 | @property (nonatomic, assign) NSInteger selectedIndex; 26 | 27 | /** 待添加的数组 */ 28 | @property (nonatomic, strong) NSMutableArray *toAddItemArray; 29 | /** 不能移动删除频道的名字数组 */ 30 | @property (nonatomic, strong) NSMutableArray *notMoveNameArray; 31 | 32 | /** 频道栏_尾部加号按钮_参数model */ 33 | @property (nonatomic, strong) JhtChannelBarTailBtnModel *channelTailBtnModel; 34 | 35 | 36 | #pragma mark optional 37 | /** 频道栏_颜色和字号类_参数model */ 38 | @property (nonatomic, strong) JhtChannelBarColorAndFontModel *channelColorAndFontModel; 39 | /** 频道栏&&sliderView_间距和坐标_参数model */ 40 | @property (nonatomic, strong) JhtChannelBarAndSlideViewSpaceAndFrameModel *channelSpaceAndRectModel; 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtChannelBarAndSlideViewSpaceAndFrameModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarAndSlideViewSpaceAndFrameModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 频道栏&&sliderView_间距和坐标_参数model */ 15 | @interface JhtChannelBarAndSlideViewSpaceAndFrameModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 顶部频道栏的坐标 19 | * default:CGRectMake(0, 0, FrameW, (90 / 2.0)) || CGRectMake(0, 0, FrameW - 40, (90 / 2.0)) 20 | */ 21 | @property (nonatomic, assign) CGRect topBarFrame; 22 | 23 | /** 频道栏之间横向间距 24 | * default:25 25 | */ 26 | @property (nonatomic, assign) CGFloat itemSpace; 27 | /** 频道栏与VC之间的距离 28 | * default:0 29 | */ 30 | @property (nonatomic, assign) CGFloat channelBarBottomSpace; 31 | /** 频道栏两边空白距离 32 | * default:0 33 | */ 34 | @property (nonatomic, assign) CGFloat itemTopBarSpace; 35 | 36 | /** 小红点的宽度 37 | * default:8 38 | */ 39 | @property (nonatomic, assign) CGFloat itemRedWidth; 40 | /** 小红点和字之间的距离 41 | * default:1 42 | */ 43 | @property (nonatomic, assign) CGFloat itemLabelToRedSpace; 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtChannelBarColorAndFontModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarColorAndFontModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | #import 12 | 13 | /** 频道栏_颜色和字号类_参数model */ 14 | @interface JhtChannelBarColorAndFontModel : NSObject 15 | 16 | #pragma mark optional 17 | /** 频道常规颜色 18 | * default:UIColorFromRGB(0x666666) 19 | */ 20 | @property (nonatomic, strong) UIColor *itemNormalColor; 21 | /** 频道被选中的颜色 22 | * default:UIColorFromRGB(0x61cbf5) 23 | */ 24 | @property (nonatomic, strong) UIColor *itemSelectedColor; 25 | 26 | /** 轨道颜色 27 | * default:UIColorFromRGB(0x61cbf5) 28 | */ 29 | @property (nonatomic, strong) UIColor *trackColor; 30 | 31 | /** 未选中的 字号 32 | * default:[UIFont systemFontOfSize:14] 33 | */ 34 | @property (nonatomic, strong) UIFont *itemNormalFont; 35 | /** 选中的字号 36 | * default:[UIFont systemFontOfSize:16] 37 | */ 38 | @property (nonatomic, strong) UIFont *itemSelectedFont; 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtChannelBarTailBtnModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarTailBtnModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 频道栏_尾部加号按钮_参数model */ 15 | @interface JhtChannelBarTailBtnModel : NSObject 16 | 17 | #pragma mark required 18 | /** 是否添加频道栏尾部的加号Btn */ 19 | @property (nonatomic, assign) BOOL isAddTailBtn; 20 | 21 | 22 | #pragma mark optional 23 | /** 尾部用于排序的加号按钮的坐标 24 | * default:CGRectMake(self.channelBar.frame.size.width, 0, FrameW - self.channelBar.frame.size.width, self.channelBar.frame.size.height) 25 | */ 26 | @property (nonatomic, assign) CGRect channelBarTailBtnFrame; 27 | /** 尾部用于排序的加号按钮 的图片 28 | * default:[UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"JhtNewsChannelImages.bundle/more"]] 29 | */ 30 | @property (nonatomic, strong) UIImage *channelBarTailBtnAddImageViewImage; 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditBackgroundColorModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditBackgroundColorModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_背景颜色_参数model */ 15 | @interface JhtNewsChannelItemEditBackgroundColorModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 频道栏 编辑背景颜色(整体背景) 19 | * default:[UIColor colorWithRed:1 green:1 blue:1 alpha:0.96] 20 | */ 21 | @property (nonatomic, strong) UIColor *itemEditBackgroundColor; 22 | /** 频道栏 顶部栏目的背景 23 | * default:[UIColor whiteColor] 24 | */ 25 | @property (nonatomic, strong) UIColor *itemEditTopPartBackgroundColor; 26 | /** 每一个占位背景的颜色 27 | * default:[UIColor colorWithRed:0.96f green:0.93f blue:0.91f alpha:1.00f] 28 | */ 29 | @property (nonatomic, strong) UIColor *itemEditPlaceholderViewBgColor; 30 | /** 已选 和 未选 中间标签的 背景颜色 31 | * default:[UIColor colorWithRed:0.93f green:0.95f blue:0.96f alpha:1.00f] 32 | */ 33 | @property (nonatomic, strong) UIColor *itemMiddleBackgroundColor; 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditDistanceModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditDistanceModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_距离_参数model */ 15 | @interface JhtNewsChannelItemEditDistanceModel : NSObject 16 | 17 | #pragma mark required 18 | /** 顶部空余的透明层,默认就和外层保持一致(正常使用默认值,不做任何设置) 19 | * default:[[UIApplication sharedApplication] statusBarFrame].size.height || 64 20 | */ 21 | @property (nonatomic, assign) CGFloat itemEditTransparentHeight; 22 | 23 | 24 | #pragma mark optional 25 | /** 排序界面总高度 26 | * default:FrameH 27 | */ 28 | @property (nonatomic, assign) CGFloat itemEditTotalHeight; 29 | 30 | /** 顶部条(顶部排序删除按钮部分)高度 31 | * default:90 / 2.0 32 | */ 33 | @property (nonatomic, assign) CGFloat itemEditTopPartHeight; 34 | /** 中间已选和未选部分中间view 高度 35 | * default:60 / 2.0 36 | */ 37 | @property (nonatomic, assign) CGFloat itemEditAddTipViewPartHeight; 38 | 39 | /** 每个频道的 宽度 40 | * default:78 41 | */ 42 | @property (nonatomic, assign) CGFloat itemEditChannelItemW; 43 | /** 每个频道的 高度 44 | * default:32 45 | */ 46 | @property (nonatomic, assign) CGFloat itemEditChannelItemH; 47 | 48 | /** 频道间 纵向间距 49 | * default:15 50 | */ 51 | @property (nonatomic, assign) CGFloat itemEditChannelMarginH; 52 | /** 每行的 频道个数 53 | * default:4 54 | */ 55 | @property (nonatomic, assign) NSInteger itemEditRowChannelItemNum; 56 | /** 频道按钮的弧度 57 | * default:32 / 2.0 58 | */ 59 | @property (nonatomic, assign) CGFloat itemEditChannelBtnCornerRadius; 60 | 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditParamModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditParamModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/30. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtNewsChannelItemEditTextModel.h" 13 | #import "JhtNewsChannelItemEditDistanceModel.h" 14 | #import "JhtNewsChannelItemEditTextColorModel.h" 15 | #import "JhtNewsChannelItemEditBackgroundColorModel.h" 16 | 17 | /** 排序界面_参数model */ 18 | @interface JhtNewsChannelItemEditParamModel : NSObject 19 | 20 | #pragma mark required 21 | /** 是否存在删除btn(排序删除,或者只有排序没有删除) Yes:存在删除 */ 22 | @property (nonatomic, assign) BOOL isExistDelete; 23 | 24 | 25 | #pragma mark optional 26 | /** 排序界面_背景颜色_参数model */ 27 | @property (nonatomic, strong) JhtNewsChannelItemEditBackgroundColorModel *backgroundColorItemModel; 28 | /** 排序界面_文字颜色_参数model */ 29 | @property (nonatomic, strong) JhtNewsChannelItemEditTextColorModel *textColorItemModel; 30 | /** 排序界面_距离_参数model */ 31 | @property (nonatomic, strong) JhtNewsChannelItemEditDistanceModel *distanceItemModel; 32 | /** 排序界面_文字类_设置参数model */ 33 | @property (nonatomic, strong) JhtNewsChannelItemEditTextModel *textTitleItemModel; 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditTextColorModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditTextColorModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_文字颜色_参数model */ 15 | @interface JhtNewsChannelItemEditTextColorModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 排序界面 顶部删除完成按钮圆角 cornerRadius 19 | * defalut: CGRectGetHeight(self.confirmButton.frame) / 2 20 | */ 21 | @property (nonatomic, assign) CGFloat itemEditConfirmButtonCornerRadius; 22 | /** 排序界面 顶部删除完成按钮 borderColor 颜色 23 | * default:[UIColor redColor] 24 | */ 25 | @property (nonatomic, strong) UIColor *itemEditConfirmButtonBorderColor; 26 | /** 排序界面 顶部删除完成按钮 文字颜色 颜色 27 | * default:[UIColor redColor] 28 | */ 29 | @property (nonatomic, strong) UIColor *itemEditConfirmButtonTitleColor; 30 | 31 | /** 排序界面 @"栏目切换" 文字颜色 32 | * default:[UIColor blackColor] 33 | */ 34 | @property (nonatomic, strong) UIColor *itemEditTipsLabelTextColor; 35 | /** 排序界面 @"点击添加更多栏目" 文字颜色 36 | * default:[UIColor colorWithRed:0.07f green:0.07f blue:0.07f alpha:1.00f] 37 | */ 38 | @property (nonatomic, strong) UIColor *itemEditAddTipViewTextColor; 39 | 40 | /** 选中频道Btn title的颜色 41 | * default:[UIColor redColor] 42 | */ 43 | @property (nonatomic, strong) UIColor *itemEditChannelBtnSelectedBtnTitleColor; 44 | /** 未选中频道Btn title的颜色 45 | * default:[UIColor grayColor] 46 | */ 47 | @property (nonatomic, strong) UIColor *itemEditChannelBtnNormalBtnTitleColor; 48 | 49 | /** 每一个频道 边框颜色(最好与删除按钮颜色相同) 50 | * default:[UIColor colorWithRed:0.64f green:0.64f blue:0.64f alpha:1.00f] 51 | */ 52 | @property (nonatomic, strong) UIColor *itemBtnBorderColor; 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditTextModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditTextModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_文字类_设置参数model */ 15 | @interface JhtNewsChannelItemEditTextModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 频道栏编辑的时删除最后一个频道的提示语 19 | * default:@"就一个了,你别给我删除了啊,好歹留一个啊!😜" 20 | */ 21 | @property (nonatomic, strong) NSString *itemEditDeleteLastChannelItemHint; 22 | /** 排序界面 已选 和 未选 中间标签的 文字 23 | * default:@"点击添加更多栏目" 24 | */ 25 | @property (nonatomic, strong) NSString *itemMiddleText; 26 | /** 排序界面 顶部排序 左上角标题 27 | * default:@"栏目切换" 28 | */ 29 | @property (nonatomic, strong) NSString *itemTopTitleText; 30 | /** 排序界面 右上角 完成 文字 31 | * default:@"完成" 32 | */ 33 | @property (nonatomic, strong) NSString *itemSortCompletedText; 34 | /** 排序界面 不存在频道删除功能时 频道栏右上角 显示的 文字 35 | * default:@"拖拽排序" 36 | */ 37 | @property (nonatomic, strong) NSString *itemSortNotExistDeleteText; 38 | /** 排序界面 存在频道删除功能时 频道栏右上角 显示的 文字 39 | * default:@"排序删除" 40 | */ 41 | @property (nonatomic, strong) NSString *itemSortIsExistDeleteText; 42 | 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemSortView.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/9. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | @class JhtNewsChannelItemModel; 14 | @class JhtNewsChannelItemEditParamModel; 15 | 16 | /** 频道栏编辑View */ 17 | @interface JhtNewsChannelItemEditView : UIView 18 | #pragma mark - Block 19 | /** 返回上级页面的 回调 20 | * modelArr:已添加(上部分)的modelArr 21 | * toAddNewModelArr:未添加(下部分)的modelArr 22 | * selectIndex:选中的index 23 | */ 24 | typedef void(^SortViewPop)(NSArray *modelArr, NSArray *nameArray, NSInteger selectIndex, NSArray *toAddNewModelArr); 25 | 26 | /** 用于选中通知的block */ 27 | typedef void(^NoticeBlock)(); 28 | 29 | 30 | 31 | #pragma mark - Property 32 | /** scrollView */ 33 | @property (nonatomic, strong) UIScrollView *sortBigScrollView; 34 | /** 透明view */ 35 | @property (nonatomic, strong) UIButton *sortBackViewBtn; 36 | /** 上级传过来的,装有ChannelModel的数组 */ 37 | @property (nonatomic, strong) NSMutableArray *topBarItemArray; 38 | /** 上级传过来,装有ChannelModel 待添加的数组 */ 39 | @property (nonatomic, strong) NSMutableArray *toAddItemModelArray; 40 | /** 选中的名字 */ 41 | @property (nonatomic, strong) NSString *selecteName; 42 | /** 顶部栏的背景View */ 43 | @property (nonatomic, strong) UIView *topPartBackView; 44 | /** @"栏目切换"Label */ 45 | @property (nonatomic, strong) UILabel *tipsLabel; 46 | /** 排序删除按钮 */ 47 | @property (nonatomic, strong) UIButton *confirmButton; 48 | /** 固定位置频道名字的数组 */ 49 | @property (nonatomic, strong) NSArray *notMoveNameArr; 50 | /** 是否存在删除btn yes是存在删除 */ 51 | @property (nonatomic, assign) BOOL isExistDelete; 52 | /** 用于排序界面参数model */ 53 | @property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel; 54 | 55 | 56 | 57 | #pragma mark - Public Method 58 | /** 初始化 59 | * block:用于返回上级页面的 回调 60 | * noticeBlock:用于选中通知的block 61 | * topBarItemArray:装有ChannelModel的数组 62 | * name:选中的名字 63 | * notMoveArr:不能移动的名字数组 64 | * isExistDelete:是否存在删除按钮 yes是存在删除 65 | * ToAddItemArray:待添加的数组 66 | * itemEditModel:用于排序界面的参数设置 67 | */ 68 | - (id)initWithTopBarItemArray:(NSArray *)topBarItemArray withToAddItemArray:(NSArray *)toAddItemArray withSelectedName:(NSString *)name withNotMoveNameArray:(NSArray *)notMoveArr isExistDeleteBtn:(BOOL)isExistDelete withNewsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel withSortBlock:(SortViewPop)block withNoticeBlock:(NoticeBlock)noticeBlock; 69 | 70 | /** 收起自己 */ 71 | - (void)packUpSelf; 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelItemModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/7/18. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | @protocol JhtNewsChannelItemModel 15 | 16 | @end 17 | 18 | 19 | /** 频道Model */ 20 | @interface JhtNewsChannelItemModel : NSObject 21 | 22 | #pragma mark required 23 | /** title */ 24 | @property (nonatomic, strong) NSString *titleName; 25 | /** 是否显示小红点 */ 26 | @property (nonatomic, assign) BOOL isShowRedPoint; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtNewsChannelSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelSDK.h 3 | // JhtNewsChannelSDK 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/29. 9 | // Copyright © 2016年 Jht. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | 15 | #import "JhtTotalSlideView.h" 16 | #import "JhtChannelBarAndSlideViewConnect.h" 17 | 18 | #import "JhtNewsChannelItemModel.h" 19 | #import "JhtNewsChannelItemEditParamModel.h" 20 | #import "JhtChannelBarAndSlideViewConnectParamModel.h" -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Headers/JhtTotalSlideView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtTotalSlideView.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/17. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | @class JhtTotalSlideView; 14 | @class JhtNewsChannelItemModel; 15 | 16 | /** 排序页面显示枚举 */ 17 | typedef NS_ENUM(NSUInteger, Jht_SortView_state) { 18 | // 将要展示排序页面 19 | sortView_willShow, 20 | // 已经展示出排序页面 21 | sortView_DidShow, 22 | }; 23 | 24 | 25 | #pragma mark - protocol 26 | @protocol JhtTotalSlideViewDelegate 27 | @required 28 | /** VC总数量 */ 29 | - (NSInteger)numberOfTabsInJhtTotalSlideView:(JhtTotalSlideView *)sender; 30 | /** 当前index下的VC */ 31 | - (UIViewController *)JhtTotalSlideView:(JhtTotalSlideView *)sender controllerAt:(NSInteger)index; 32 | 33 | @optional 34 | /** 点击VC的index */ 35 | - (void)JhtTotalSlideView:(JhtTotalSlideView *)sender didSelectedAt:(NSInteger)index; 36 | 37 | /** 排序之后的操作 38 | * modelArr:已添加数组 39 | * nameArray:频道名字数组 40 | * selectedIndex:选中的index 41 | * toAddModelArr:未添加数组 42 | */ 43 | - (void)JhtTotalSlideViewWithSortModelArr:(NSArray *)modelArr withNameArray:(NSArray *)nameArray withSelectIndex:(NSInteger)selectedIndex withToAddModelArr:(NSArray *)toAddModelArr; 44 | 45 | /** 排序页面显示状态 46 | * showState:排序页面展示状态 47 | */ 48 | - (void)JhtSortViewShowState:(Jht_SortView_state)showState; 49 | 50 | @end 51 | 52 | 53 | 54 | /** 总的滚动View(频道栏+主View) */ 55 | @interface JhtTotalSlideView : UIView 56 | #pragma mark - property 57 | /** 频道栏与VC之间的距离 */ 58 | @property (nonatomic, assign) CGFloat channelBarBottomSpace; 59 | /** 主View */ 60 | @property (nonatomic, strong) UIView *slideView; 61 | /** 主View上的VC */ 62 | @property (nonatomic, weak) UIViewController *baseViewController; 63 | /** 选中的索引值 */ 64 | @property (nonatomic, assign) NSInteger selectedIndex; 65 | /** 频道栏 */ 66 | @property (nonatomic, strong) UIView *channelBar; 67 | /** 缓存代理 */ 68 | @property (nonatomic, strong) id cache; 69 | 70 | @property (nonatomic, weak) id delegate; 71 | 72 | 73 | 74 | #pragma mark - Public Method 75 | /** 奔跑吧 */ 76 | - (void)running; 77 | 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/JhtNewsChannel.framework/Info.plist -------------------------------------------------------------------------------- /JhtNewsChannelDemo/JhtNewsChannel.framework/JhtNewsChannel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannelDemo/JhtNewsChannel.framework/JhtNewsChannel -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtBaseViewController/JhtBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtBaseViewController.h 3 | // JhtTools 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/12. 9 | // Copyright © 2016年 JhtTools. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** VC父类 */ 15 | @interface JhtBaseViewController : UIViewController 16 | 17 | /** 创建Navigationbar的TitleView */ 18 | - (void)createNavigationBarTitleViewWithLabelTitle:(NSString *)title; 19 | 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtBaseViewController/JhtBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JhtBaseViewController.m 3 | // JhtTools 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/12. 9 | // Copyright © 2016年 JhtTools. All rights reserved. 10 | // 11 | 12 | #import "JhtBaseViewController.h" 13 | 14 | @implementation JhtBaseViewController 15 | 16 | - (void)viewDidLoad { 17 | [super viewDidLoad]; 18 | 19 | self.view.backgroundColor = [UIColor whiteColor]; 20 | } 21 | 22 | /** 创建Navigationbar的TitleView */ 23 | - (void)createNavigationBarTitleViewWithLabelTitle:(NSString *)title { 24 | UILabel *navigationBarTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 44, 80)]; 25 | navigationBarTitleLabel.text = title; 26 | navigationBarTitleLabel.font = [UIFont boldSystemFontOfSize:18]; 27 | navigationBarTitleLabel.textAlignment = NSTextAlignmentCenter; 28 | navigationBarTitleLabel.textColor = [UIColor colorWithRed:0.30f green:0.77f blue:0.98f alpha:1.00f]; 29 | self.navigationItem.titleView = navigationBarTitleLabel; 30 | } 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtNewsChannelViewController/JhtNewsChannelViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelViewController.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/12. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtBaseViewController.h" 13 | 14 | /** 频道栏大框类 */ 15 | @interface JhtNewsChannelViewController : JhtBaseViewController 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtNewsChannelViewController/JhtNewsChannelViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelViewController.m 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/12. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtNewsChannelViewController.h" 13 | #import "JhtNewsViewController.h" 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | 20 | /** 顶部滑动的条高度 */ 21 | static CGFloat KTopSCHeight = (90 / 2.0); 22 | /** 顶部滑动的条宽度*/ 23 | #define KTopSCWidth (FrameW - 40) 24 | 25 | @interface JhtNewsChannelViewController () { 26 | // 滑动的当前页 27 | NSInteger _currentPageIndex; 28 | 29 | // 界面是否正在刷新 30 | BOOL _isRefreshing; 31 | } 32 | /** 大框 */ 33 | @property (nonatomic, strong) JhtChannelBarAndSlideViewConnect *slideView; 34 | 35 | /** JhtChannelBarAndSlideViewConnect_参数model */ 36 | @property (nonatomic, strong)JhtChannelBarAndSlideViewConnectParamModel *barAndSlideModel; 37 | /** 用于排序界面参数model */ 38 | @property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel; 39 | 40 | /** 频道数组 */ 41 | @property (nonatomic, strong) NSMutableArray *channelArray; 42 | /** 装有ChannelModel 待添加的数组 */ 43 | @property (nonatomic, strong) NSMutableArray *toAddItemArray; 44 | 45 | @end 46 | 47 | 48 | @implementation JhtNewsChannelViewController 49 | 50 | - (void)viewWillAppear:(BOOL)animated { 51 | [super viewWillAppear:animated]; 52 | 53 | // 隐藏导航栏 54 | // [self.navigationController setNavigationBarHidden:YES animated:YES]; 55 | } 56 | 57 | - (void)viewDidLoad { 58 | [super viewDidLoad]; 59 | self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.95f green:0.86f blue:0.79f alpha:1.00f]; 60 | 61 | // 导航栏设置 62 | [self ncSetNav]; 63 | 64 | // 初始化 65 | _currentPageIndex = 0; 66 | // 建立导航条 67 | [self ncCreateTopScrollView]; 68 | } 69 | 70 | 71 | #pragma mark - Nav 72 | /** 导航栏设置 */ 73 | - (void)ncSetNav { 74 | self.navigationController.navigationBar.translucent = NO; 75 | 76 | [self createNavigationBarTitleViewWithLabelTitle:@"JhtNewsChannel"]; 77 | } 78 | 79 | 80 | #pragma mark - TopBar 81 | /** 建立滑动条 */ 82 | - (void)ncCreateTopScrollView { 83 | if (_slideView) { 84 | [_slideView removeFromSuperview]; 85 | } 86 | _slideView = [[[JhtChannelBarAndSlideViewConnect alloc] init] initSlideViewAndItemEditViewWithBarAndSlideModel:self.barAndSlideModel withNewsChannelItemEditModel:self.itemEditModel isExistNavOrTab:NT_OnlyHave_N withChanelArray:self.channelArray baseViewController:self delegte:self]; 87 | 88 | // 只适用于NT_OnlyHave_T || NT_None 两种形式(即不存在navigationBar),default = 20.0 89 | // _slideView.connectToTopSpace = 30; 90 | 91 | [self.view addSubview:self.slideView]; 92 | } 93 | 94 | 95 | #pragma mark - Getter 96 | - (JhtNewsChannelItemEditParamModel *)itemEditModel { 97 | if (!_itemEditModel) { 98 | _itemEditModel = [[JhtNewsChannelItemEditParamModel alloc] init]; 99 | // 是否存在删除(排序删除,或者只有排序没有删除) 100 | _itemEditModel.isExistDelete = YES; 101 | 102 | // 用于排序界面中 背景颜色 等相关设置参数model 103 | JhtNewsChannelItemEditBackgroundColorModel *backgroundColorItemModel = [[JhtNewsChannelItemEditBackgroundColorModel alloc] init]; 104 | // 用于排序界面中 文字颜色 等相关设置参数model 105 | JhtNewsChannelItemEditTextColorModel *textColorItemModel = [[JhtNewsChannelItemEditTextColorModel alloc] init]; 106 | // 用于排序界面中 距离,高宽 等相关设置参数model 107 | JhtNewsChannelItemEditDistanceModel *distanceItemModel = [[JhtNewsChannelItemEditDistanceModel alloc] init]; 108 | // 用于排序界面中 文字 等相关设置参数model 109 | JhtNewsChannelItemEditTextModel *textTitleItemModel = [[JhtNewsChannelItemEditTextModel alloc] init]; 110 | 111 | distanceItemModel.itemEditTotalHeight = FrameH; 112 | distanceItemModel.itemEditTopPartHeight = 90 / 2.0; 113 | distanceItemModel.itemEditAddTipViewPartHeight = 60 / 2.0; 114 | distanceItemModel.itemEditChannelItemW = 78; 115 | distanceItemModel.itemEditChannelItemH = 32; 116 | distanceItemModel.itemEditChannelMarginH = 15; 117 | distanceItemModel.itemEditRowChannelItemNum = 4; 118 | distanceItemModel.itemEditChannelBtnCornerRadius = 32 / 2.0; 119 | 120 | textColorItemModel.itemBtnBorderColor = [UIColor colorWithRed:0.64f green:0.64f blue:0.64f alpha:1.00f]; 121 | textColorItemModel.itemEditConfirmButtonBorderColor = [UIColor redColor]; 122 | textColorItemModel.itemEditConfirmButtonTitleColor = [UIColor redColor]; 123 | textColorItemModel.itemEditTipsLabelTextColor = [UIColor blackColor]; 124 | textColorItemModel.itemEditAddTipViewTextColor = [UIColor colorWithRed:0.07f green:0.07f blue:0.07f alpha:1.00f]; 125 | textColorItemModel.itemEditChannelBtnSelectedBtnTitleColor = [UIColor redColor]; 126 | textColorItemModel.itemEditChannelBtnNormalBtnTitleColor = [UIColor grayColor]; 127 | 128 | backgroundColorItemModel.itemEditBackgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.96]; 129 | backgroundColorItemModel.itemEditTopPartBackgroundColor = [UIColor whiteColor]; 130 | backgroundColorItemModel.itemEditPlaceholderViewBgColor = [UIColor colorWithRed:0.96f green:0.93f blue:0.91f alpha:1.00f]; 131 | backgroundColorItemModel.itemMiddleBackgroundColor = [UIColor colorWithRed:0.93f green:0.95f blue:0.96f alpha:1.00f]; 132 | 133 | textTitleItemModel.itemEditDeleteLastChannelItemHint = @"就一个了,你别给我删除了啊,好歹留一个啊!😜"; 134 | textTitleItemModel.itemMiddleText = @"点击添加更多栏目"; 135 | textTitleItemModel.itemTopTitleText = @"栏目切换"; 136 | textTitleItemModel.itemSortCompletedText = @"完成"; 137 | textTitleItemModel.itemSortNotExistDeleteText = @"拖拽排序"; 138 | textTitleItemModel.itemSortIsExistDeleteText = @"排序删除"; 139 | // textColorItemModel.itemEditConfirmButtonCornerRadius = 15.0; 140 | _itemEditModel.backgroundColorItemModel = backgroundColorItemModel; 141 | _itemEditModel.textColorItemModel = textColorItemModel; 142 | _itemEditModel.distanceItemModel = distanceItemModel; 143 | _itemEditModel.textTitleItemModel = textTitleItemModel; 144 | } 145 | 146 | return _itemEditModel; 147 | } 148 | 149 | - (JhtChannelBarAndSlideViewConnectParamModel *)barAndSlideModel { 150 | if (!_barAndSlideModel) { 151 | // 生成频道栏name数组 152 | NSMutableArray *channelNameArr = [[NSMutableArray alloc] init]; 153 | for (NSInteger i = 0; i < self.channelArray.count; i ++) { 154 | JhtNewsChannelItemModel *model = self.channelArray[i]; 155 | [channelNameArr addObject:model.titleName]; 156 | } 157 | _barAndSlideModel = [[JhtChannelBarAndSlideViewConnectParamModel alloc] init]; 158 | 159 | // 用于切换频道栏 尾部加号按钮 设置的参数model 160 | JhtChannelBarTailBtnModel *channelTailBtnModel = [[JhtChannelBarTailBtnModel alloc] init]; 161 | _barAndSlideModel.channelTailBtnModel = channelTailBtnModel; 162 | 163 | channelTailBtnModel.isAddTailBtn = YES; 164 | _barAndSlideModel.cacheCount = [channelNameArr count] > 6 ? 6 : [channelNameArr count]; 165 | _barAndSlideModel.toAddItemArray = self.toAddItemArray; 166 | _barAndSlideModel.notMoveNameArray = [[NSMutableArray alloc] initWithArray: @[@"NO.15", @"这是特殊情况"]]; 167 | _barAndSlideModel.selectedIndex = _currentPageIndex; 168 | 169 | /* 170 | * 以下内容为个性配置,可根据需求进行配置 171 | * 172 | // 用于切换频道栏 颜色和坐标 设置的参数model 173 | JhtChannelBarColorAndFontModel *channelColorAndFontModel = [[JhtChannelBarColorAndFontModel alloc] init]; 174 | _barAndSlideModel.channelColorAndFontModel = channelColorAndFontModel; 175 | // 用于切换频道栏 距离和坐标 设置的参数model 176 | JhtChannelBarAndSlideViewSpaceAndFrameModel *channelSpaceAndRectModel = [[JhtChannelBarAndSlideViewSpaceAndFrameModel alloc] init]; 177 | _barAndSlideModel.channelSpaceAndRectModel = channelSpaceAndRectModel; 178 | 179 | // 顶部频道条的坐标 180 | channelSpaceAndRectModel.topBarFrame = CGRectMake(0, 0, KTopSCWidth, KTopSCHeight); 181 | 182 | // 整个topbar频道条两边空白距离 183 | channelSpaceAndRectModel.itemTopBarSpace = 0; 184 | // 小红点的宽度 185 | channelSpaceAndRectModel.itemRedWidth = 8; 186 | // 小红点和字之间的距离 187 | channelSpaceAndRectModel.itemLabelToRedSpace = 1; 188 | // 频道栏之间横向间距 189 | channelSpaceAndRectModel.itemSpace = 25 * WidthScale375; 190 | // 频道栏与VC之间的距离 191 | channelSpaceAndRectModel.channelBarBottomSpace = 0; 192 | 193 | // 频道颜色 194 | channelColorAndFontModel.itemNormalColor = UIColorFromRGB(0x666666); 195 | channelColorAndFontModel.itemSelectedColor = UIColorFromRGB(0x61cbf5); 196 | // 未选中的字号 197 | channelColorAndFontModel.itemNormalFont = [UIFont systemFontOfSize:14]; 198 | // 选中的字号 199 | channelColorAndFontModel.itemSelectedFont = [UIFont systemFontOfSize:16]; 200 | // 轨道颜色 201 | channelColorAndFontModel.trackColor = UIColorFromRGB(0x61cbf5); 202 | // 设置旋转的加号的图标,不设置就用默认的 203 | // channelTailBtnModel.channelBarTailBtnAddImageViewImage = [UIImage imageNamed:@""]; 204 | // 旋转加号的frame 可以设置也可以不设置,不设置就是默认的 205 | // channelSpaceAndRectModel.channelBarTailBtnFrame = CGRectMake(KGHTopSCWidth, 0, FrameW - KGHTopSCWidth, KGHTopSCHeight); 206 | */ 207 | } 208 | 209 | return _barAndSlideModel; 210 | } 211 | 212 | - (NSMutableArray *)channelArray { 213 | if (!_channelArray) { 214 | _channelArray = [[NSMutableArray alloc] init]; 215 | for (NSInteger i = 0; i < 15; i ++) { 216 | JhtNewsChannelItemModel *model = [[JhtNewsChannelItemModel alloc] init]; 217 | model.titleName = [NSString stringWithFormat:@"NO.%ld", i + 1]; 218 | // 模拟添加频道小红点 219 | if (i == 5) { 220 | model.isShowRedPoint = YES; 221 | } else { 222 | model.isShowRedPoint = NO; 223 | } 224 | if (i == 1) { 225 | model.titleName = [NSString stringWithFormat:@"这是特殊情况"]; 226 | } 227 | if (i == 2) { 228 | model.titleName = [NSString stringWithFormat:@"这是五个字"]; 229 | } 230 | [_channelArray addObject:model]; 231 | } 232 | } 233 | 234 | return _channelArray; 235 | } 236 | 237 | - (NSMutableArray *)toAddItemArray { 238 | if (!_toAddItemArray) { 239 | _toAddItemArray = [[NSMutableArray alloc] init]; 240 | 241 | // 待添加的数组 242 | for (NSInteger i = 0; i < 10; i ++) { 243 | JhtNewsChannelItemModel *model2 = [[JhtNewsChannelItemModel alloc] init]; 244 | model2.titleName = [NSString stringWithFormat:@"New.%ld", i + 1]; 245 | [_toAddItemArray addObject:model2]; 246 | } 247 | } 248 | 249 | return _toAddItemArray; 250 | } 251 | 252 | 253 | #pragma mark - JhtTotalSlideViewDelegate 254 | /** VC总数量 */ 255 | - (NSInteger)numberOfTabsInJhtTotalSlideView:(JhtTotalSlideView *)sender { 256 | return _channelArray.count; 257 | } 258 | 259 | /** 当前index下的VC */ 260 | - (UIViewController *)JhtTotalSlideView:(JhtTotalSlideView *)sender controllerAt:(NSInteger)index { 261 | JhtNewsChannelItemModel *model = _channelArray[index]; 262 | JhtNewsViewController *newsVC = [[JhtNewsViewController alloc] init]; 263 | newsVC.titleName = model.titleName; 264 | newsVC.delegate = self; 265 | return newsVC; 266 | } 267 | 268 | /** VC总数量 */ 269 | - (void)JhtTotalSlideView:(JhtTotalSlideView *)sender didSelectedAt:(NSInteger)index { 270 | _currentPageIndex = index; 271 | NSString *key = [NSString stringWithFormat:@"%ld", (long)_currentPageIndex]; 272 | JhtNewsChannelItemModel *model = _channelArray[index]; 273 | id vc = [self.slideView.cache objectForKey:key]; 274 | 275 | if ([vc isKindOfClass:[JhtNewsViewController class]] && model.isShowRedPoint) { 276 | JhtNewsViewController *news = vc; 277 | [news headerRefresh]; 278 | _isRefreshing = YES; 279 | } 280 | if (_isRefreshing) { 281 | // 刷新的时候,尾巴按钮不可以被点击,刷新结束才允许排序界面出现 282 | [self.slideView judgeChannelBarTailBtnIsEnableClick:NO]; 283 | } else { 284 | // 刷新结束才允许,尾巴按钮可以被点击,可以出现排序界面出现 285 | [self.slideView judgeChannelBarTailBtnIsEnableClick:YES]; 286 | } 287 | } 288 | 289 | /** 排序之后的操作 290 | * modelArr: 已添加数组 291 | * nameArray: 频道名字数组 292 | * selectedIndex: 选中的index 293 | * toAddModelArr: 未添加数组 294 | */ 295 | - (void)JhtTotalSlideViewWithSortModelArr:(NSArray *)modelArr nameArray:(NSArray *)nameArray selectIndex:(NSInteger)selectedIndex toAddModelArr:(NSArray *)toAddModelArr { 296 | self.channelArray = [[NSMutableArray alloc] initWithArray:modelArr]; 297 | _currentPageIndex = selectedIndex; 298 | self.toAddItemArray = [[NSMutableArray alloc] initWithArray:toAddModelArr]; 299 | // NSLog(@"%@", self.toAddItemArray); 300 | } 301 | 302 | /** 排序页面显示状态 303 | * showState: 排序页面展示状态 304 | */ 305 | - (void)JhtSortViewShowState:(Jht_SortView_state)showState { 306 | NSLog(@"showState: %ld", showState); 307 | 308 | // if (showState == sortView_DidShow) { 309 | // [self.slideView isHiddenTopEditItemBtn:YES]; 310 | // } 311 | } 312 | 313 | 314 | #pragma mark - JhtNewsViewControllerDelegate 315 | /** 刷新结束后调用 */ 316 | - (void)refreshOver:(id)sender { 317 | // 让哪一页刷新了 318 | NSString *titleName = [(JhtNewsViewController *)sender titleName]; 319 | // 隐藏小红点 320 | [self ncHiddenRedBadgeWithName:titleName isHidden:YES]; 321 | } 322 | 323 | /** 根据名字找到数组 */ 324 | - (NSInteger)ncGetIndexWithName:(NSString *)titleName { 325 | for (NSInteger i = 0; i < self.channelArray.count; i ++) { 326 | JhtNewsChannelItemModel *model = self.channelArray[i]; 327 | if ([model.titleName isEqualToString:titleName]) { 328 | return i; 329 | } 330 | } 331 | // 没有找到 332 | return -1; 333 | } 334 | 335 | /** 显示/隐藏小红点 336 | * isHidden: 区分显示/隐藏 337 | */ 338 | - (void)ncHiddenRedBadgeWithName:(NSString *)titleName isHidden:(BOOL)isHidden { 339 | // 根据名字找到数组 340 | NSInteger index = [self ncGetIndexWithName:titleName]; 341 | if (index >= 0) { 342 | JhtNewsChannelItemModel *model = self.channelArray[index]; 343 | model.isShowRedPoint = !isHidden; 344 | // 隐藏或者出现小红点 345 | [self.slideView redPonitIsHidden:isHidden index:index]; 346 | self.slideView.channelArray = self.channelArray; 347 | } 348 | _isRefreshing = NO; 349 | // 刷新结束才允许,尾巴按钮可以被点击,可以出现排序界面出现 350 | [self.slideView judgeChannelBarTailBtnIsEnableClick:YES]; 351 | } 352 | 353 | 354 | #pragma mark - Tools 355 | /** 计算Label的高度 */ 356 | - (CGSize)ncGetCurrentLabelSizeWithContent:(NSString *)content WithTextFont:(UIFont *)font WithWidthSize:(CGSize)newSize { 357 | CGSize size; 358 | 359 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 360 | NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:font,NSFontAttributeName, nil]; 361 | size = [content boundingRectWithSize:newSize options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:dic context:nil].size; 362 | 363 | #else 364 | size = [content sizeWithFont:font constrainedToSize:newSize lineBreakMode:NSLineBreakByCharWrapping]; 365 | #endif 366 | 367 | return size; 368 | } 369 | 370 | 371 | @end 372 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtNewsViewController/JhtNewsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsViewController.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/12. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtBaseViewController.h" 13 | 14 | #pragma mark - protocol 15 | @protocol JhtNewsViewControllerDelegate 16 | /** 刷新结束后调用 */ 17 | - (void)refreshOver:(id)sender; 18 | 19 | @end 20 | 21 | 22 | /** 展示VC */ 23 | @interface JhtNewsViewController : JhtBaseViewController 24 | 25 | #pragma mark - property 26 | /** 代理 */ 27 | @property (nonatomic, assign) id delegate; 28 | 29 | /** 上级页面传过来的titleName */ 30 | @property (nonatomic, strong) NSString *titleName; 31 | 32 | 33 | #pragma mark - Public Method 34 | /** 暴露给外边的刷新方法 */ 35 | - (void)headerRefresh; 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtNewsViewController/JhtNewsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsViewController.m 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/12. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtNewsViewController.h" 13 | 14 | @interface JhtNewsViewController() { 15 | UITableView *_tableView; 16 | } 17 | 18 | @end 19 | 20 | 21 | @implementation JhtNewsViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | 26 | // 创建UI 27 | [self newsCreateUI]; 28 | } 29 | 30 | 31 | 32 | #pragma mark - UI 33 | /** 创建UI */ 34 | - (void)newsCreateUI { 35 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 150, 150)]; 36 | label.center = CGPointMake(self.view.center.x, self.view.center.y - ([[UIApplication sharedApplication] statusBarFrame].size.height + 44) / 2.0 - 45 / 2.0); 37 | label.backgroundColor = [UIColor whiteColor]; 38 | label.text = [NSString stringWithFormat:@"%@", self.titleName]; 39 | label.textAlignment = NSTextAlignmentCenter; 40 | [self.view addSubview:label]; 41 | 42 | // 设置背景颜色 43 | [self newsSetBackgroundColor]; 44 | 45 | /* _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) - 109) style:UITableViewStylePlain]; 46 | _tableView.delegate = self; 47 | _tableView.backgroundColor = [UIColor redColor]; 48 | _tableView.dataSource = self; 49 | [self.view addSubview:_tableView];*/ 50 | } 51 | 52 | /** 设置背景颜色 */ 53 | - (void)newsSetBackgroundColor { 54 | NSArray *colArr = @[[UIColor redColor], [UIColor greenColor], [UIColor magentaColor], [UIColor cyanColor], [UIColor grayColor], [UIColor yellowColor], [UIColor orangeColor], [UIColor purpleColor]]; 55 | self.view.backgroundColor = colArr[arc4random()%(colArr.count - 1)]; 56 | } 57 | 58 | 59 | #pragma mark - Public Method 60 | - (void)headerRefresh { 61 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"处于选中状态,就是模拟刷新了哈,玩的愉快!" message:@"" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; 62 | alert.tag = 111; 63 | [alert show]; 64 | } 65 | 66 | 67 | #pragma mark - UIAlertViewDelegate 68 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { 69 | if (alertView.tag == 111) { 70 | if (buttonIndex == 0) { 71 | // 刷新成功,隐藏大框顶部的小红点 72 | if ([self.delegate respondsToSelector:@selector(refreshOver:)]) { 73 | [self.delegate refreshOver:self]; 74 | } 75 | } 76 | } 77 | } 78 | 79 | 80 | #pragma mark - UITableViewDelegate 81 | /** - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 82 | return 1; 83 | } 84 | 85 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 86 | return 20; 87 | } 88 | 89 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 90 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 91 | 92 | if (cell == nil) { 93 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 94 | } 95 | cell.textLabel.text = [NSString stringWithFormat:@"这是第 %ld 条数据", indexPath.row]; 96 | return cell; 97 | } 98 | 99 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 100 | return 40; 101 | } 102 | 103 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 104 | NSInteger index = indexPath.row; 105 | NSLog(@"点击了%ld", index); 106 | } */ 107 | 108 | 109 | #pragma mark - dealloc 110 | - (void)dealloc { 111 | // NSLog(@"JhtNewsViewController dealloc"); 112 | } 113 | 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtSortViewDemoVC/JhtSortViewDemoVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtSortViewDemoVC.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/7/30. 9 | // Copyright © 2017年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtBaseViewController.h" 13 | 14 | /** 排序View Demo */ 15 | @interface JhtSortViewDemoVC : JhtBaseViewController 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtSortViewDemoVC/JhtSortViewDemoVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JhtSortViewDemoVC.m 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/7/30. 9 | // Copyright © 2017年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtSortViewDemoVC.h" 13 | #import 14 | #import 15 | #import 16 | #import 17 | 18 | @interface JhtSortViewDemoVC () { 19 | // 滑动的当前页 20 | NSInteger _currentPageIndex; 21 | } 22 | 23 | /** 用于排序界面参数model */ 24 | @property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel; 25 | /** 频道数组 */ 26 | @property (nonatomic, strong) NSMutableArray *channelArray; 27 | /** 装有ChannelModel 待添加的数组 */ 28 | @property (nonatomic, strong) NSMutableArray *toAddItemArray; 29 | /** 不能移动的名字数组 */ 30 | @property (nonatomic, strong) NSMutableArray *notMoveNameArray; 31 | /** 频道栏尾部的Btn */ 32 | @property (nonatomic, strong) UIButton *channelBarTailBtn; 33 | 34 | /** 排序界面View */ 35 | @property (nonatomic, strong) UIView *sortView; 36 | 37 | @end 38 | 39 | 40 | @implementation JhtSortViewDemoVC 41 | 42 | - (void)viewDidLoad { 43 | [super viewDidLoad]; 44 | 45 | _currentPageIndex = 0; 46 | 47 | // 导航栏设置 48 | [self svdvSetNav]; 49 | 50 | // 显示排序界面 51 | [self svdvShowSortView]; 52 | } 53 | 54 | 55 | 56 | #pragma mark - Nav 57 | /** 导航栏设置 */ 58 | - (void)svdvSetNav { 59 | self.navigationController.navigationBar.translucent = NO; 60 | 61 | [self createNavigationBarTitleViewWithLabelTitle:@"JhtNewsChannel"]; 62 | } 63 | 64 | 65 | 66 | #pragma mark - SortView 67 | /** 显示排序界面 */ 68 | - (void)svdvShowSortView { 69 | JhtNewsChannelItemModel *model = self.channelArray[_currentPageIndex]; 70 | __weak typeof(self) weakSelf = self; 71 | self.sortView = [[JhtNewsChannelItemEditView alloc] initWithTopBarItemArray:self.channelArray toAddItemArray:self.toAddItemArray selectedName:model.titleName notMoveNameArray:self.notMoveNameArray isExistDeleteBtn:self.itemEditModel.isExistDelete newsChannelItemEditModel:self.itemEditModel sortBlock:^(NSArray *modelArr, NSArray *nameArray, NSInteger selectIndex, NSArray *toAddNewModelArr) { 72 | NSLog(@"modelArr ==> %@", modelArr); 73 | NSLog(@"toAddNewModelArr ==> %@", toAddNewModelArr); 74 | NSLog(@"selectIndex ==> %ld", selectIndex); 75 | weakSelf.channelArray = [[NSMutableArray alloc] initWithArray:modelArr]; 76 | // 排序完成,待添加的数组 改变了 77 | weakSelf.toAddItemArray = [[NSMutableArray alloc] initWithArray:toAddNewModelArr]; 78 | _currentPageIndex = selectIndex; 79 | } noticeBlock:^{ 80 | }]; 81 | // 添加 view 82 | [self.navigationController.view addSubview:self.sortView]; 83 | 84 | // 顶部排序删除部分高度 85 | CGFloat nceTopPartHeight = self.itemEditModel.distanceItemModel.itemEditTopPartHeight; 86 | // 顶部透明部分 87 | CGFloat nceTransparentHeight = self.itemEditModel.distanceItemModel.itemEditTransparentHeight; 88 | // 修改加号的坐标 89 | CGRect frame = self.channelBarTailBtn.frame; 90 | frame.origin.y += nceTransparentHeight; 91 | self.channelBarTailBtn.frame = frame; 92 | [self.sortView addSubview:self.channelBarTailBtn]; 93 | 94 | // frame 95 | self.sortView.frame = CGRectMake(0, 0, FrameW, FrameH); 96 | JhtNewsChannelItemEditView *changeSortView = (JhtNewsChannelItemEditView *)self.sortView; 97 | changeSortView.sortBigScrollView.frame = CGRectMake(0, nceTopPartHeight + nceTransparentHeight, FrameW, FrameH - nceTransparentHeight - nceTopPartHeight); 98 | } 99 | 100 | 101 | 102 | #pragma mark - Getter 103 | /** 用于排序界面参数model */ 104 | - (JhtNewsChannelItemEditParamModel *)itemEditModel { 105 | if (!_itemEditModel) { 106 | _itemEditModel = [[JhtNewsChannelItemEditParamModel alloc] init]; 107 | // 是否存在删除(排序删除,或者只有排序没有删除) 108 | _itemEditModel.isExistDelete = YES; 109 | 110 | // 用于排序界面中 背景颜色 等相关设置参数model 111 | JhtNewsChannelItemEditBackgroundColorModel *backgroundColorItemModel = [[JhtNewsChannelItemEditBackgroundColorModel alloc] init]; 112 | // 用于排序界面中 文字颜色 等相关设置参数model 113 | JhtNewsChannelItemEditTextColorModel *textColorItemModel = [[JhtNewsChannelItemEditTextColorModel alloc] init]; 114 | // 用于排序界面中 距离,高宽 等相关设置参数model 115 | JhtNewsChannelItemEditDistanceModel *distanceItemModel = [[JhtNewsChannelItemEditDistanceModel alloc] init]; 116 | // 用于排序界面中 文字 等相关设置参数model 117 | JhtNewsChannelItemEditTextModel *textTitleItemModel = [[JhtNewsChannelItemEditTextModel alloc] init]; 118 | 119 | // 排序界面总高度 120 | distanceItemModel.itemEditTotalHeight = FrameH; 121 | // 顶部排序删除部分高度 122 | distanceItemModel.itemEditTopPartHeight = 90 / 2.0; 123 | // 中间已选部分和未选部分中间view 高度 124 | distanceItemModel.itemEditAddTipViewPartHeight = 60 / 2.0; 125 | // ** 单独使用《JhtNewsChannelItemEditView》时 必要参数 ** 126 | distanceItemModel.itemEditTransparentHeight = ([[UIApplication sharedApplication] statusBarFrame].size.height + 44); 127 | // 每个频道的 宽度 128 | distanceItemModel.itemEditChannelItemW = 78; 129 | // 每个频道的 高度 130 | distanceItemModel.itemEditChannelItemH = 32; 131 | // 频道间 纵向间距 132 | distanceItemModel.itemEditChannelMarginH = 15; 133 | // 每行的 频道个数 134 | distanceItemModel.itemEditRowChannelItemNum = 4; 135 | // 频道按钮的弧度 136 | distanceItemModel.itemEditChannelBtnCornerRadius = 32 / 2.0; 137 | 138 | // 每一个频道 边框颜色(最好与删除按钮颜色相同) 139 | textColorItemModel.itemBtnBorderColor = [UIColor colorWithRed:0.64f green:0.64f blue:0.64f alpha:1.00f]; 140 | // 排序顶部删除完成按钮 的 borderColor 颜色 141 | textColorItemModel.itemEditConfirmButtonBorderColor = [UIColor redColor]; 142 | // 排序顶部删除完成按钮 的 文字颜色 颜色 143 | textColorItemModel.itemEditConfirmButtonTitleColor = [UIColor redColor]; 144 | // 排序 栏目切换 文字颜色 145 | textColorItemModel.itemEditTipsLabelTextColor = [UIColor blackColor]; 146 | // 排序 界面中 点击添加更多栏目 文字颜色 147 | textColorItemModel.itemEditAddTipViewTextColor = [UIColor colorWithRed:0.07f green:0.07f blue:0.07f alpha:1.00f]; 148 | // 选中频道Btn title的颜色 149 | textColorItemModel.itemEditChannelBtnSelectedBtnTitleColor = [UIColor redColor]; 150 | // 未选中频道Btn title的颜色 151 | textColorItemModel.itemEditChannelBtnNormalBtnTitleColor = [UIColor grayColor]; 152 | 153 | // 频道栏编辑 背景颜色(整体背景) 154 | backgroundColorItemModel.itemEditBackgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.96]; 155 | // 频道栏 顶部栏目的背景 156 | backgroundColorItemModel.itemEditTopPartBackgroundColor = [UIColor whiteColor]; 157 | // 每一个占位背景的颜色 158 | backgroundColorItemModel.itemEditPlaceholderViewBgColor = [UIColor colorWithRed:0.96f green:0.93f blue:0.91f alpha:1.00f]; 159 | // 已选 和 未选 中间标签的 背景颜色 160 | backgroundColorItemModel.itemMiddleBackgroundColor = [UIColor colorWithRed:0.93f green:0.95f blue:0.96f alpha:1.00f]; 161 | 162 | // 频道栏编辑的时候删除最后一个频道时候的提示语 163 | textTitleItemModel.itemEditDeleteLastChannelItemHint = @"就一个了,你别给我删除了啊,好歹留一个啊!😜"; 164 | // 已选 和 未选 中间标签的 文字 165 | textTitleItemModel.itemMiddleText = @"点击添加更多栏目"; 166 | // 排序界面 顶部排序 左上角标题 167 | textTitleItemModel.itemTopTitleText = @"栏目切换"; 168 | // 排序界面 右上角 完成 文字 169 | textTitleItemModel.itemSortCompletedText = @"完成"; 170 | // 排序界面 不存在频道删除功能时 频道栏右上角 显示的 文字 171 | textTitleItemModel.itemSortNotExistDeleteText = @"拖拽排序"; 172 | // 排序界面 存在频道删除功能时 频道栏右上角 显示的 文字 173 | textTitleItemModel.itemSortIsExistDeleteText = @"排序删除"; 174 | _itemEditModel.backgroundColorItemModel = backgroundColorItemModel; 175 | _itemEditModel.textColorItemModel = textColorItemModel; 176 | _itemEditModel.distanceItemModel = distanceItemModel; 177 | _itemEditModel.textTitleItemModel = textTitleItemModel; 178 | 179 | } 180 | 181 | return _itemEditModel; 182 | } 183 | 184 | /** 频道数组,这里用get方法获取假数据,实际应用从网络获取直接赋值即可 */ 185 | - (NSMutableArray *)channelArray { 186 | if (!_channelArray) { 187 | _channelArray = [[NSMutableArray alloc] init]; 188 | for (NSInteger i = 0; i < 15; i ++) { 189 | JhtNewsChannelItemModel *model = [[JhtNewsChannelItemModel alloc] init]; 190 | model.titleName = [NSString stringWithFormat:@"NO.%ld", i + 1]; 191 | // 模拟添加频道小红点 192 | if (i % 3) { 193 | model.isShowRedPoint = YES; 194 | } else { 195 | model.isShowRedPoint = NO; 196 | } 197 | if (i == 1) { 198 | model.titleName = [NSString stringWithFormat:@"这是特殊情况"]; 199 | } 200 | if (i == 2) { 201 | model.titleName = [NSString stringWithFormat:@"这是五个字"]; 202 | } 203 | [_channelArray addObject:model]; 204 | } 205 | } 206 | 207 | return _channelArray; 208 | } 209 | 210 | /** 待添加的数组 这里用get方法获取假数据,实际应用从网络获取直接赋值即可 */ 211 | - (NSMutableArray *)toAddItemArray { 212 | if (!_toAddItemArray) { 213 | _toAddItemArray = [[NSMutableArray alloc] init]; 214 | 215 | // 待添加的数组 216 | for (NSInteger i = 0; i < 5; i ++) { 217 | JhtNewsChannelItemModel *model2 = [[JhtNewsChannelItemModel alloc] init]; 218 | model2.titleName = [NSString stringWithFormat:@"New.%ld", i + 1]; 219 | [_toAddItemArray addObject:model2]; 220 | } 221 | } 222 | 223 | return _toAddItemArray; 224 | } 225 | 226 | /** 不能移动的名字数组 */ 227 | - (NSMutableArray *)notMoveNameArray { 228 | if (!_notMoveNameArray) { 229 | _notMoveNameArray = [[NSMutableArray alloc] initWithArray: @[@"NO.15", @"这是特殊情况"]]; 230 | } 231 | 232 | return _notMoveNameArray; 233 | } 234 | 235 | /** 频道栏尾部的Btn */ 236 | - (UIButton *)channelBarTailBtn { 237 | if (!_channelBarTailBtn) { 238 | _channelBarTailBtn = [[UIButton alloc] initWithFrame:CGRectMake(FrameW - 45, 8, 40, 30)]; 239 | _channelBarTailBtn.titleLabel.font = [UIFont systemFontOfSize:12]; 240 | [_channelBarTailBtn setTitle:@"OK" forState:UIControlStateNormal]; 241 | [_channelBarTailBtn setBackgroundColor:[UIColor redColor]]; 242 | _channelBarTailBtn.layer.cornerRadius = 5; 243 | 244 | [_channelBarTailBtn addTarget:self action:@selector(svdvChannelTailBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 245 | } 246 | 247 | return _channelBarTailBtn; 248 | } 249 | 250 | 251 | #pragma mark Getter Method 252 | /** 频道栏尾部的Btn触发事件 */ 253 | -(void)svdvChannelTailBtnClick:(UIButton *)btn { 254 | // 返回的时候调用 255 | [(JhtNewsChannelItemEditView *)self.sortView packUpSelf]; 256 | } 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | - (void)didReceiveMemoryWarning { 265 | [super didReceiveMemoryWarning]; 266 | // Dispose of any resources that can be recreated. 267 | } 268 | 269 | /* 270 | #pragma mark - Navigation 271 | 272 | // In a storyboard-based application, you will often want to do a little preparation before navigation 273 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 274 | // Get the new view controller using [segue destinationViewController]. 275 | // Pass the selected object to the new view controller. 276 | } 277 | */ 278 | 279 | @end 280 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtTabBarController/JhtTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtTabBarController.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/3/20. 9 | // Copyright © 2017年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | @interface JhtTabBarController : UITabBarController 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/ViewController/JhtTabBarController/JhtTabBarController.m: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // JhtTabBarController.m 4 | // JhtNewsChannelDemo 5 | // 6 | // GitHub主页: https://github.com/jinht 7 | // CSDN博客: http://blog.csdn.net/anticipate91 8 | // 9 | // Created by Jht on 2017/3/20. 10 | // Copyright © 2017年 JhtNewsChannelDemo. All rights reserved. 11 | // 12 | 13 | #import "JhtTabBarController.h" 14 | #import "JhtNewsChannelViewController.h" 15 | #import 16 | 17 | @implementation JhtTabBarController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.view.backgroundColor = [UIColor whiteColor]; 22 | 23 | // 修改TabBarItem字体大小 24 | [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"HelveticaNeue" size:14],NSForegroundColorAttributeName:UIColorFromRGB(0x61cbf5)} forState:UIControlStateNormal]; 25 | [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"HelveticaNeue" size:14],NSForegroundColorAttributeName:UIColorFromRGB(0xFF001F)} forState:UIControlStateSelected]; 26 | 27 | // 创建对应的VC 28 | [self tbvCreateControllers]; 29 | } 30 | 31 | /** 创建对应的VC */ 32 | - (void)tbvCreateControllers { 33 | JhtNewsChannelViewController *vc1 = [[JhtNewsChannelViewController alloc] init]; 34 | 35 | UIViewController *vc2 = [[UIViewController alloc] init]; 36 | vc2.view.backgroundColor = [UIColor redColor]; 37 | 38 | UIViewController *vc3 = [[UIViewController alloc] init]; 39 | vc3.view.backgroundColor = [UIColor greenColor]; 40 | 41 | NSArray *homeViewControllers = @[vc1, vc2, vc3]; 42 | // 标题 43 | NSArray *titleArr = @[@"乔布斯", @"罗永浩", @"罗玉凤"]; 44 | 45 | // 初始化数组 46 | NSMutableArray *controllers = [NSMutableArray array]; 47 | 48 | // 循环增加Navigation 49 | for (NSInteger i = 0 ; i < titleArr.count; i ++) { 50 | UIViewController *vc = homeViewControllers[i]; 51 | // 标题 52 | vc.title = titleArr[i]; 53 | vc.tabBarItem.tag = i + 1; 54 | 55 | // 循环增加 56 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:homeViewControllers[i]]; 57 | // 添加到数组中 58 | [controllers addObject:nav]; 59 | } 60 | 61 | self.viewControllers = controllers; 62 | self.tabBar.tintColor = UIColorFromRGB(0xfd4444); 63 | } 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /JhtNewsChannelDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/8. 9 | // Copyright © 2016年 Jht. All rights reserved. 10 | // 11 | 12 | #import 13 | #import "AppDelegate.h" 14 | 15 | int main(int argc, char * argv[]) { 16 | @autoreleasepool { 17 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtChannelBarAndSlideViewConnect.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarAndSlideViewConnect.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/18. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtTotalSlideView.h" 13 | @class JhtNewsChannelItemEditParamModel; 14 | @class JhtChannelBarAndSlideViewConnectParamModel; 15 | 16 | /** 所在类是否含有NavigationBar || TabBar_枚举 */ 17 | typedef NS_ENUM(NSUInteger, Jht_IsExist_NT) { 18 | // 只有NavigationBar(Default) 19 | NT_OnlyHave_N, 20 | // 只有TabBar 21 | NT_OnlyHave_T, 22 | // NavigationBar && TabBar都有 23 | NT_Have, 24 | // NavigationBar && TabBar都不有 25 | NT_None 26 | }; 27 | 28 | 29 | /** 频道栏和下边滚动View的结合体 */ 30 | @interface JhtChannelBarAndSlideViewConnect : JhtTotalSlideView 31 | 32 | #pragma mark - property 33 | /** 缓存总数 */ 34 | @property (nonatomic, assign) NSInteger cacheCount; 35 | /** 频道数组 */ 36 | @property (nonatomic, strong) NSMutableArray *channelArray; 37 | /** 上级传过来,装有ChannelModel 待添加的数组 */ 38 | @property (nonatomic, strong) NSMutableArray *toAddItemArray; 39 | 40 | /** 是否添加频道栏尾部的加号Btn */ 41 | @property (nonatomic, assign) BOOL isAddTailBtn; 42 | /** 频道栏尾部的Btn */ 43 | @property (nonatomic, strong) UIButton *channelBarTailBtn; 44 | 45 | /** 排序界面View */ 46 | @property (nonatomic, strong) UIView *sortView; 47 | /** 不能移动的名字数组 */ 48 | @property (nonatomic, strong) NSMutableArray *notMoveNameArray; 49 | /** 是否存在删除btn yes是存在删除 */ 50 | @property (nonatomic, assign) BOOL isExistDelete; 51 | 52 | /** 轨道栏前边的阴影 */ 53 | @property (nonatomic, strong) UIImageView *frontImageView; 54 | /** 轨道栏后边的阴影 */ 55 | @property (nonatomic, strong) UIImageView *behindImageView; 56 | /** 频道栏之间横向间距 */ 57 | @property (nonatomic, assign) CGFloat itemSpace; 58 | /** 底部的线 */ 59 | @property (nonatomic, strong) UIView *lowLineView; 60 | /** 用于排序界面参数model */ 61 | @property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel; 62 | 63 | /** 整体距离顶部的高度 64 | * 注: 只适用于NT_OnlyHave_T || NT_None 两种形式(即不存在navigationBar),default = [[UIApplication sharedApplication] statusBarFrame].size.height 65 | */ 66 | @property (nonatomic, assign) CGFloat connectToTopSpace; 67 | 68 | 69 | 70 | #pragma mark - Public Method 71 | /** 创建ChannelBarAndSliderView和排序删除界面 72 | * barAndSlideModel: 用于设置sliderView和bar参数model(含有部分属性默认值) 73 | * itemEditModel: 用于排序界面的参数设置(含有部分属性默认值) 74 | * isExistType: 是否含有NavigationBar || TabBar 75 | * channelArray: 已经添加的频道数组 存储JhtNewsChannelItemModel (必要参数,并且是存储JhtNewsChannelItemModel的数组) 76 | * baseViewController: 所处于的VC 77 | * delegate: 委托 78 | */ 79 | - (id)initSlideViewAndItemEditViewWithBarAndSlideModel:(JhtChannelBarAndSlideViewConnectParamModel *)barAndSlideModel withNewsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel isExistNavOrTab:(Jht_IsExist_NT)isExistType withChanelArray:(NSMutableArray *)channelArray baseViewController:(id)baseViewController delegte:(id)delegate; 80 | 81 | /** 根据名字数组,查找新的频道栏model */ 82 | - (NSMutableArray *)checkNewChannelItemModelWithNameArray:(NSArray *)nameArray; 83 | 84 | /** 判断频道栏尾部按钮是否可以被点击 85 | * enable: YES--可以被点击 86 | */ 87 | - (void)judgeChannelBarTailBtnIsEnableClick:(BOOL)enable; 88 | 89 | /** 隐藏或者出现小红点 90 | * hidden: YES--隐藏 91 | * index: topBar 中频道栏的index 92 | */ 93 | - (void)redPonitIsHidden:(BOOL)hidden index:(NSInteger)index; 94 | 95 | /** 是否展示“排序拖拽”按钮 96 | * hidden: YES--隐藏 97 | */ 98 | - (void)isHiddenTopEditItemBtn:(BOOL)hidden; 99 | 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtChannelBarAndSlideViewConnectParamModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarAndSlideViewConnectModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/30. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | #import "JhtNewsChannelItemModel.h" 14 | #import "JhtChannelBarTailBtnModel.h" 15 | #import "JhtChannelBarColorAndFontModel.h" 16 | #import "JhtChannelBarAndSlideViewSpaceAndFrameModel.h" 17 | 18 | /** JhtChannelBarAndSlideViewConnect_参数model */ 19 | @interface JhtChannelBarAndSlideViewConnectParamModel : NSObject 20 | 21 | #pragma mark required 22 | /** 缓存的页数 */ 23 | @property (nonatomic, assign) NSInteger cacheCount; 24 | /** 选中的索引值 */ 25 | @property (nonatomic, assign) NSInteger selectedIndex; 26 | 27 | /** 待添加的数组 */ 28 | @property (nonatomic, strong) NSMutableArray *toAddItemArray; 29 | /** 不能移动删除频道的名字数组 */ 30 | @property (nonatomic, strong) NSMutableArray *notMoveNameArray; 31 | 32 | /** 频道栏_尾部加号按钮_参数model */ 33 | @property (nonatomic, strong) JhtChannelBarTailBtnModel *channelTailBtnModel; 34 | 35 | #pragma mark optional 36 | /** 频道栏_颜色和字号类_参数model */ 37 | @property (nonatomic, strong) JhtChannelBarColorAndFontModel *channelColorAndFontModel; 38 | /** 频道栏&&sliderView_间距和坐标_参数model */ 39 | @property (nonatomic, strong) JhtChannelBarAndSlideViewSpaceAndFrameModel *channelSpaceAndRectModel; 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtChannelBarAndSlideViewSpaceAndFrameModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarAndSlideViewSpaceAndFrameModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 频道栏&&sliderView_间距和坐标_参数model */ 15 | @interface JhtChannelBarAndSlideViewSpaceAndFrameModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 顶部频道栏的坐标 19 | * default: CGRectMake(0, 0, FrameW, (90 / 2.0)) || CGRectMake(0, 0, FrameW - 40, (90 / 2.0)) 20 | */ 21 | @property (nonatomic, assign) CGRect topBarFrame; 22 | 23 | /** 频道栏之间横向间距 24 | * default: 25 25 | */ 26 | @property (nonatomic, assign) CGFloat itemSpace; 27 | /** 频道栏与VC之间的距离 28 | * default: 0 29 | */ 30 | @property (nonatomic, assign) CGFloat channelBarBottomSpace; 31 | /** 频道栏两边空白距离 32 | * default: 0 33 | */ 34 | @property (nonatomic, assign) CGFloat itemTopBarSpace; 35 | 36 | /** 小红点的宽度 37 | * default: 8 38 | */ 39 | @property (nonatomic, assign) CGFloat itemRedWidth; 40 | /** 小红点和字之间的距离 41 | * default: 1 42 | */ 43 | @property (nonatomic, assign) CGFloat itemLabelToRedSpace; 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtChannelBarColorAndFontModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarColorAndFontModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | #import 12 | 13 | /** 频道栏_颜色和字号类_参数model */ 14 | @interface JhtChannelBarColorAndFontModel : NSObject 15 | 16 | #pragma mark optional 17 | /** 频道常规颜色 18 | * default: UIColorFromRGB(0x666666) 19 | */ 20 | @property (nonatomic, strong) UIColor *itemNormalColor; 21 | /** 频道被选中的颜色 22 | * default: UIColorFromRGB(0x61cbf5) 23 | */ 24 | @property (nonatomic, strong) UIColor *itemSelectedColor; 25 | 26 | /** 轨道颜色 27 | * default: UIColorFromRGB(0x61cbf5) 28 | */ 29 | @property (nonatomic, strong) UIColor *trackColor; 30 | 31 | /** 未选中的 字号 32 | * default: [UIFont systemFontOfSize:14] 33 | */ 34 | @property (nonatomic, strong) UIFont *itemNormalFont; 35 | /** 选中的字号 36 | * default: [UIFont systemFontOfSize:16] 37 | */ 38 | @property (nonatomic, strong) UIFont *itemSelectedFont; 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtChannelBarTailBtnModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtChannelBarTailBtnModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 频道栏_尾部加号按钮_参数model */ 15 | @interface JhtChannelBarTailBtnModel : NSObject 16 | 17 | #pragma mark required 18 | /** 是否添加频道栏尾部的加号Btn */ 19 | @property (nonatomic, assign) BOOL isAddTailBtn; 20 | 21 | #pragma mark optional 22 | /** 尾部用于排序的加号按钮的坐标 23 | * default: CGRectMake(self.channelBar.frame.size.width, 0, FrameW - self.channelBar.frame.size.width, self.channelBar.frame.size.height) 24 | */ 25 | @property (nonatomic, assign) CGRect channelBarTailBtnFrame; 26 | /** 尾部用于排序的加号按钮 的图片 27 | * default: [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"JhtNewsChannelImages.bundle/more"]] 28 | */ 29 | @property (nonatomic, strong) UIImage *channelBarTailBtnAddImageViewImage; 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditBackgroundColorModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditBackgroundColorModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_背景颜色_参数model */ 15 | @interface JhtNewsChannelItemEditBackgroundColorModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 频道栏 编辑背景颜色(整体背景) 19 | * default: [UIColor colorWithRed:1 green:1 blue:1 alpha:0.96] 20 | */ 21 | @property (nonatomic, strong) UIColor *itemEditBackgroundColor; 22 | /** 频道栏 顶部栏目的背景 23 | * default: [UIColor whiteColor] 24 | */ 25 | @property (nonatomic, strong) UIColor *itemEditTopPartBackgroundColor; 26 | /** 每一个占位背景的颜色 27 | * default: [UIColor colorWithRed:0.96f green:0.93f blue:0.91f alpha:1.00f] 28 | */ 29 | @property (nonatomic, strong) UIColor *itemEditPlaceholderViewBgColor; 30 | /** 已选 和 未选 中间标签的 背景颜色 31 | * default: [UIColor colorWithRed:0.93f green:0.95f blue:0.96f alpha:1.00f] 32 | */ 33 | @property (nonatomic, strong) UIColor *itemMiddleBackgroundColor; 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditDistanceModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditDistanceModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_距离_参数model */ 15 | @interface JhtNewsChannelItemEditDistanceModel : NSObject 16 | 17 | #pragma mark required 18 | /** 顶部空余的透明层,默认就和外层保持一致(正常使用默认值,不做任何设置) 19 | * default: [[UIApplication sharedApplication] statusBarFrame].size.height || ([[UIApplication sharedApplication] statusBarFrame].size.height + KNavBarHeight) 20 | */ 21 | @property (nonatomic, assign) CGFloat itemEditTransparentHeight; 22 | 23 | #pragma mark optional 24 | /** 排序界面总高度 25 | * default: FrameH 26 | */ 27 | @property (nonatomic, assign) CGFloat itemEditTotalHeight; 28 | 29 | /** 顶部条(顶部@"排序删除"按钮部分)高度 30 | * default: 90 / 2.0 31 | */ 32 | @property (nonatomic, assign) CGFloat itemEditTopPartHeight; 33 | /** 中间已选和未选部分中间view 高度 34 | * default: 60 / 2.0 35 | */ 36 | @property (nonatomic, assign) CGFloat itemEditAddTipViewPartHeight; 37 | 38 | /** 每个频道的 宽度 39 | * default: 78 40 | */ 41 | @property (nonatomic, assign) CGFloat itemEditChannelItemW; 42 | /** 每个频道的 高度 43 | * default: 32 44 | */ 45 | @property (nonatomic, assign) CGFloat itemEditChannelItemH; 46 | 47 | /** 频道间 纵向间距 48 | * default: 15 49 | */ 50 | @property (nonatomic, assign) CGFloat itemEditChannelMarginH; 51 | /** 每行的 频道个数 52 | * default: 4 53 | */ 54 | @property (nonatomic, assign) NSInteger itemEditRowChannelItemNum; 55 | /** 频道按钮的弧度 56 | * default: 32 / 2.0 57 | */ 58 | @property (nonatomic, assign) CGFloat itemEditChannelBtnCornerRadius; 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditParamModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditParamModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/30. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import "JhtNewsChannelItemEditTextModel.h" 13 | #import "JhtNewsChannelItemEditDistanceModel.h" 14 | #import "JhtNewsChannelItemEditTextColorModel.h" 15 | #import "JhtNewsChannelItemEditBackgroundColorModel.h" 16 | 17 | /** 排序界面_参数model */ 18 | @interface JhtNewsChannelItemEditParamModel : NSObject 19 | 20 | #pragma mark required 21 | /** 是否存在删除btn(排序删除,或者只有排序没有删除) Yes: 存在删除 */ 22 | @property (nonatomic, assign) BOOL isExistDelete; 23 | 24 | #pragma mark optional 25 | /** 排序界面_背景颜色_参数model */ 26 | @property (nonatomic, strong) JhtNewsChannelItemEditBackgroundColorModel *backgroundColorItemModel; 27 | /** 排序界面_文字颜色_参数model */ 28 | @property (nonatomic, strong) JhtNewsChannelItemEditTextColorModel *textColorItemModel; 29 | /** 排序界面_距离_参数model */ 30 | @property (nonatomic, strong) JhtNewsChannelItemEditDistanceModel *distanceItemModel; 31 | /** 排序界面_文字类_设置参数model */ 32 | @property (nonatomic, strong) JhtNewsChannelItemEditTextModel *textTitleItemModel; 33 | 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditTextColorModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditTextColorModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_文字颜色_参数model */ 15 | @interface JhtNewsChannelItemEditTextColorModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 排序界面 顶部删除完成按钮圆角 cornerRadius 19 | * defalut: CGRectGetHeight(self.confirmButton.frame) / 2.0 20 | */ 21 | @property (nonatomic, assign) CGFloat itemEditConfirmButtonCornerRadius; 22 | /** 排序界面 顶部删除完成按钮 borderColor 颜色 23 | * default: [UIColor redColor] 24 | */ 25 | @property (nonatomic, strong) UIColor *itemEditConfirmButtonBorderColor; 26 | /** 排序界面 顶部删除完成按钮 文字颜色 颜色 27 | * default: [UIColor redColor] 28 | */ 29 | @property (nonatomic, strong) UIColor *itemEditConfirmButtonTitleColor; 30 | 31 | /** 排序界面 @"栏目切换" 文字颜色 32 | * default: [UIColor blackColor] 33 | */ 34 | @property (nonatomic, strong) UIColor *itemEditTipsLabelTextColor; 35 | /** 排序界面 @"点击添加更多栏目" 文字颜色 36 | * default: [UIColor colorWithRed:0.07f green:0.07f blue:0.07f alpha:1.00f] 37 | */ 38 | @property (nonatomic, strong) UIColor *itemEditAddTipViewTextColor; 39 | 40 | /** 选中频道Btn title的颜色 41 | * default: [UIColor redColor] 42 | */ 43 | @property (nonatomic, strong) UIColor *itemEditChannelBtnSelectedBtnTitleColor; 44 | /** 未选中频道Btn title的颜色 45 | * default: [UIColor grayColor] 46 | */ 47 | @property (nonatomic, strong) UIColor *itemEditChannelBtnNormalBtnTitleColor; 48 | 49 | /** 每一个频道 边框颜色(最好与删除按钮颜色相同) 50 | * default: [UIColor colorWithRed:0.64f green:0.64f blue:0.64f alpha:1.00f] 51 | */ 52 | @property (nonatomic, strong) UIColor *itemBtnBorderColor; 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditTextModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemEditTextModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2016/12/16. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | /** 排序界面_文字类_设置参数model */ 15 | @interface JhtNewsChannelItemEditTextModel : NSObject 16 | 17 | #pragma mark optional 18 | /** 频道栏编辑的时删除最后一个频道的提示语 19 | * default: @"就一个了,你别给我删除了啊,好歹留一个啊!😜" 20 | */ 21 | @property (nonatomic, strong) NSString *itemEditDeleteLastChannelItemHint; 22 | /** 排序界面 已选 和 未选 中间标签的 文字 23 | * default: @"点击添加更多栏目" 24 | */ 25 | @property (nonatomic, strong) NSString *itemMiddleText; 26 | /** 排序界面 顶部排序 左上角标题 27 | * default: @"栏目切换" 28 | */ 29 | @property (nonatomic, strong) NSString *itemTopTitleText; 30 | /** 排序界面 右上角 完成 文字 31 | * default: @"完成" 32 | */ 33 | @property (nonatomic, strong) NSString *itemSortCompletedText; 34 | /** 排序界面 不存在频道删除功能时 频道栏右上角 显示的 文字 35 | * default: @"拖拽排序" 36 | */ 37 | @property (nonatomic, strong) NSString *itemSortNotExistDeleteText; 38 | /** 排序界面 存在频道删除功能时 频道栏右上角 显示的 文字 39 | * default: @"排序删除" 40 | */ 41 | @property (nonatomic, strong) NSString *itemSortIsExistDeleteText; 42 | 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemEditView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemSortView.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/9. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | @class JhtNewsChannelItemModel; 14 | @class JhtNewsChannelItemEditParamModel; 15 | 16 | /** 频道栏编辑View */ 17 | @interface JhtNewsChannelItemEditView : UIView 18 | 19 | #pragma mark - Property 20 | /** scrollView */ 21 | @property (nonatomic, strong) UIScrollView *sortBigScrollView; 22 | /** 收起排序界面的 透明背景 Button */ 23 | @property (nonatomic, strong) UIButton *sortViewOfPutAwayBtn; 24 | /** 装有ChannelModel的数组 */ 25 | @property (nonatomic, strong) NSMutableArray *topBarItemArray; 26 | /** 装有ChannelModel 待添加的数组 */ 27 | @property (nonatomic, strong) NSMutableArray *toAddItemModelArray; 28 | /** 选中的名字 */ 29 | @property (nonatomic, strong) NSString *selecteName; 30 | /** 顶部栏的背景View */ 31 | @property (nonatomic, strong) UIView *topPartBackView; 32 | /** @"栏目切换"Label */ 33 | @property (nonatomic, strong) UILabel *tipsLabel; 34 | /** @"排序删除"按钮 */ 35 | @property (nonatomic, strong) UIButton *confirmButton; 36 | /** 固定位置频道名字的数组 */ 37 | @property (nonatomic, strong) NSArray *notMoveNameArr; 38 | /** 是否存在删除btn yes是存在删除 */ 39 | @property (nonatomic, assign) BOOL isExistDelete; 40 | /** 用于排序界面参数model */ 41 | @property (nonatomic, strong) JhtNewsChannelItemEditParamModel *itemEditModel; 42 | 43 | 44 | #pragma mark - Public Method 45 | /** 返回上级页面的 回调 46 | * modelArr: 已添加(上部分)的modelArr 47 | * toAddNewModelArr: 未添加(下部分)的modelArr 48 | * selectIndex: 选中的index 49 | */ 50 | typedef void(^SortViewPopBlock)(NSArray *modelArr, NSArray *nameArray, NSInteger selectIndex, NSArray *toAddNewModelArr); 51 | /** 用于选中通知的block */ 52 | typedef void(^NoticeBlock)(); 53 | 54 | /** 初始化 55 | * block: 用于返回上级页面的 回调 56 | * noticeBlock: 用于选中通知的block 57 | * topBarItemArray: 装有ChannelModel的数组 58 | * name: 选中的名字 59 | * notMoveArr: 不能移动的名字数组 60 | * isExistDelete: 是否存在删除按钮 yes是存在删除 61 | * ToAddItemArray: 待添加的数组 62 | * itemEditModel: 用于排序界面的参数设置 63 | */ 64 | - (id)initWithTopBarItemArray:(NSArray *)topBarItemArray toAddItemArray:(NSArray *)toAddItemArray selectedName:(NSString *)name notMoveNameArray:(NSArray *)notMoveArr isExistDeleteBtn:(BOOL)isExistDelete newsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel sortBlock:(SortViewPopBlock)block noticeBlock:(NoticeBlock)noticeBlock; 65 | 66 | /** 收起自己 */ 67 | - (void)packUpSelf; 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelItemModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelItemModel.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/7/18. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | @protocol JhtNewsChannelItemModel 15 | 16 | @end 17 | 18 | 19 | /** 频道Model */ 20 | @interface JhtNewsChannelItemModel : NSObject 21 | 22 | #pragma mark required 23 | /** title */ 24 | @property (nonatomic, strong) NSString *titleName; 25 | /** 是否显示小红点 */ 26 | @property (nonatomic, assign) BOOL isShowRedPoint; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannelSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannelSDK.h 3 | // JhtNewsChannelSDK 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/29. 9 | // Copyright © 2016年 Jht. All rights reserved. 10 | // 11 | 12 | #import 13 | 14 | #import "JhtNewsChannel_Define.h" 15 | 16 | #import "JhtTotalSlideView.h" 17 | #import "JhtChannelBarAndSlideViewConnect.h" 18 | 19 | #import "JhtNewsChannelItemModel.h" 20 | #import "JhtNewsChannelItemEditParamModel.h" 21 | #import "JhtChannelBarAndSlideViewConnectParamModel.h" 22 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtNewsChannel_Define.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtNewsChannel_Define.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 2017/10/15. 9 | // Copyright © 2017年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #ifndef JhtNewsChannel_Define_h 13 | #define JhtNewsChannel_Define_h 14 | 15 | /** 屏幕的宽度 */ 16 | #define FrameW [UIScreen mainScreen].bounds.size.width 17 | /** 屏幕的高度 */ 18 | #define FrameH [UIScreen mainScreen].bounds.size.height 19 | 20 | /** 状态栏(StatusBar) 高度 */ 21 | #define KNCDStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height 22 | /** 导航栏 高度 */ 23 | #define KNCDNavBarHeight CGRectGetHeight(self.navigationController.navigationBar.frame) 24 | 25 | /** 颜色转换 */ 26 | #define UIColorFromRGB(rgbValue) [UIColor \ 27 | colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ 28 | green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ 29 | blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 30 | 31 | 32 | #endif /* JhtNewsChannel_Define_h */ 33 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtTotalSlideView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtTotalSlideView.h 3 | // JhtNewsChannelDemo 4 | // 5 | // GitHub主页: https://github.com/jinht 6 | // CSDN博客: http://blog.csdn.net/anticipate91 7 | // 8 | // Created by Jht on 16/8/17. 9 | // Copyright © 2016年 JhtNewsChannelDemo. All rights reserved. 10 | // 11 | 12 | #import 13 | #import "JhtTotalSlideViewDelegate.h" 14 | 15 | /** 总的滚动View(频道栏+主View) */ 16 | @interface JhtTotalSlideView : UIView 17 | 18 | #pragma mark - property 19 | /** 频道栏与VC之间的距离 */ 20 | @property (nonatomic, assign) CGFloat channelBarBottomSpace; 21 | /** 主View */ 22 | @property (nonatomic, strong) UIView *slideView; 23 | /** 主View上的VC */ 24 | @property (nonatomic, weak) UIViewController *baseViewController; 25 | /** 选中的索引值 */ 26 | @property (nonatomic, assign) NSInteger selectedIndex; 27 | /** 频道栏 */ 28 | @property (nonatomic, strong) UIView *channelBar; 29 | /** 缓存代理 */ 30 | @property (nonatomic, strong) id cache; 31 | 32 | @property (nonatomic, weak) id delegate; 33 | 34 | 35 | #pragma mark - Public Method 36 | /** 奔跑吧 */ 37 | - (void)running; 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Headers/JhtTotalSlideViewDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // JhtTotalSlideViewDelegate.h 3 | // JhtNewsChannelDemo 4 | // 5 | // Created by Jht on 2017/10/31. 6 | // Copyright © 2017年 JhtNewsChannelDemo. All rights reserved. 7 | // 8 | 9 | #ifndef JhtTotalSlideViewDelegate_h 10 | #define JhtTotalSlideViewDelegate_h 11 | 12 | @class JhtTotalSlideView; 13 | @class JhtNewsChannelItemModel; 14 | 15 | 16 | /** 排序页面显示枚举 */ 17 | typedef NS_ENUM(NSUInteger, Jht_SortView_state) { 18 | // 将要展示排序页面 19 | sortView_willShow, 20 | // 已经展示出排序页面 21 | sortView_DidShow, 22 | }; 23 | 24 | 25 | /** JhtTotalSlideView 委托 */ 26 | @protocol JhtTotalSlideViewDelegate 27 | 28 | @required 29 | /** VC总数量 */ 30 | - (NSInteger)numberOfTabsInJhtTotalSlideView:(JhtTotalSlideView *)sender; 31 | /** 当前index下的VC */ 32 | - (UIViewController *)JhtTotalSlideView:(JhtTotalSlideView *)sender controllerAt:(NSInteger)index; 33 | 34 | @optional 35 | /** 点击VC的index */ 36 | - (void)JhtTotalSlideView:(JhtTotalSlideView *)sender didSelectedAt:(NSInteger)index; 37 | 38 | /** 排序之后的操作 39 | * modelArr: 已添加数组 40 | * nameArray: 频道名字数组 41 | * selectedIndex: 选中的index 42 | * toAddModelArr: 未添加数组 43 | */ 44 | - (void)JhtTotalSlideViewWithSortModelArr:(NSArray *)modelArr nameArray:(NSArray *)nameArray selectIndex:(NSInteger)selectedIndex toAddModelArr:(NSArray *)toAddModelArr; 45 | 46 | /** 排序页面显示状态 47 | * showState: 排序页面展示状态 48 | */ 49 | - (void)JhtSortViewShowState:(Jht_SortView_state)showState; 50 | 51 | 52 | @end 53 | 54 | 55 | #endif /* JhtTotalSlideViewDelegate_h */ 56 | -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannel.framework/Info.plist -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannel.framework/JhtNewsChannel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannel.framework/JhtNewsChannel -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/behindMask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/behindMask@2x.png -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/behindMask@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/behindMask@3x.png -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/deletIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/deletIcon.png -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/frontMask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/frontMask@2x.png -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/frontMask@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/frontMask@3x.png -------------------------------------------------------------------------------- /JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/JhtNewsChannel_SDK/JhtNewsChannelImages.bundle/more.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jinht 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## NewsChannel 2 | 3 | ## Ready 4 | #### 新闻频道栏(网易新闻,新浪新闻,搜狐新闻,今日头条,聚划算,腾讯视频,优酷等类似的频道栏)
5 | #### 支持小红点标识 && 懒加载 && 缓存 && 排序 && 增删等。

6 | 7 | ### 一言不合就上图 8 | 9 | 10 | ### Function Description 11 | 1. 单个频道小红点标识:JhtNewsChannelItemModel中`isShowRedPoint`为BOOL值,在生成频道栏数据Model时可以一起添加频道是否有小红点标识,在后续调接口设置小红点状态依旧照前述可以实现; 12 | 2. 懒加载:页面不会全部加载(非scrollview),点击或者滑动到哪里加载相应页面,同时可以自己设置缓存的个数; 13 | 3. 频道位置固定:可以设置单个或多个频道位置不可变动; 14 | 4. 频道栏排序:可以在排序界面进行自定义排序(会有颤抖提示); 15 | 5. 频道增删:可以在排序界面进行自定义的增删频道,同时囊括排序功能; 16 | 6. 说明:排序或者增删之后的相应页面均可在缓存中找到! 17 | 18 | 19 | ## GO 20 | ### How to use 21 | #### 1. podfile 22 | ```oc 23 | platform:ios, '8.0' 24 | 25 | target '*****' do 26 | 27 | pod 'JhtNewsChannel' 28 | 29 | end 30 | 31 | ``` 32 | 33 | 34 | #### 2. 个性化设置
35 |  a. JhtNewsChannelItemModel:顶部频道Model,你可以继承这个model,来扩展满足自己需求的model;
36 |  b. JhtChannelBarAndSlideViewConnectParamModel:用于切换频道栏界面中相关设置参数model,包含`尾部加号按钮` && `颜色和字号` && `间距和坐标` && `缓存页数` 等相关设置;
37 |  c. JhtChannelBarAndSlideViewConnectParamModel中的属性`notMoveNameArray`(不能移动频道的名字数组)设置频道位置固定, `toAddItemArray`(用于存储JhtNewsChannelItemModel)属性用于设置待添加的频道数组;
38 |  d. JhtNewsChannelItemEditParamModel:用于排序界面中相关设置参数model,包含`文字` && `文字颜色` && `距离` && `背景颜色` 类等相关设置。
39 |  e. JhtChannelBarAndSlideViewConnectParamModel和JhtNewsChannelItemEditParamModel结构如下图
40 | 41 | * 注:model内部均注有required/optional区分标识
42 |   1. required:必要参数,需要进行相关传递
43 |   2. optional:个性化配置参数,内部均有相应默认值 44 | 45 | 46 | #### 3. 建立滑频道条和可滑动的view:相关个性化设置均由传递的Model中参数实现 47 | ```oc 48 | /** 创建ChannelBarAndSliderView和排序删除界面 49 | * barAndSlideModel:用于设置sliderView和bar参数model(为了容错,含有部分属性默认值) 50 | * itemEditModel:用于排序界面的参数设置(为了容错,含有部分属性默认值) 51 | * channelArray:已经添加的频道数组 存储JhtNewsChannelItemModel (必要参数,并且是存储JhtNewsChannelItemModel的数组) 52 | * baseViewController:所处于的VC 53 | * sortFView:排序界面放入的父view 54 | * titleArray:所有的名字数组 55 | * delegate:代理 56 | */ 57 | - (id)initSlideViewAndItemEditViewWithBarAndSlideModel:(JhtChannelBarAndSlideViewConnectParamModel *)barAndSlideModel withNewsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel withChanelArray:(NSMutableArray *)channelArray withBaseViewController:(id)baseViewController withSortFView:(UIView *)sortFView withTitleArray:(NSArray *)titleArray withDelegte:(id)delegate; 58 | ``` 59 | 60 | 61 | #### 4. JhtTotalSlideViewDelegate 方法 62 | ```oc 63 | @protocol JhtTotalSlideViewDelegate 64 | /** VC总数量 */ 65 | - (NSInteger)numberOfTabsInJhtTotalSlideView:(JhtTotalSlideView *)sender; 66 | /** 当前index下的VC */ 67 | - (UIViewController *)JhtTotalSlideView:(JhtTotalSlideView *)sender controllerAt:(NSInteger)index; 68 | 69 | /** 点击VC的index */ 70 | - (void)JhtTotalSlideView:(JhtTotalSlideView *)sender didSelectedAt:(NSInteger)index; 71 | 72 | /** 排序之后的操作 73 | * modelArr:model数组 74 | * nameArray:名字数组 75 | * selectedIndex:选中的index 76 | */ 77 | - (void)JhtTotalSlideViewWithSortModelArr:(NSArray *)modelArr withNameArray:(NSArray *)nameArray withSelectIndex:(NSInteger)selectedIndex; 78 | ``` 79 | 80 | 81 | #### 5. `JhtChannelBarAndSlideViewConnect` 方法 82 |  a. 判断频道栏尾部按钮是否可以被点击 83 | ```oc 84 | /** 判断频道栏尾部按钮是否可以被点击 85 | * enable:yes可以被点击 86 | */ 87 | - (void)judgeChannelBarTailBtnIsEnableClick:(BOOL)enable; 88 | ``` 89 |  b. 隐藏或者出现小红点 90 | ```oc 91 | /** 隐藏或者出现小红点 92 | * hidden:yes隐藏 93 | * index:topBar 中频道栏的index 94 | */ 95 | - (void)redPonitIsHidden:(BOOL)hidden withIndex:(NSInteger)index; 96 | ``` 97 | 98 | 99 | #### 6. 修改SDK切图资源 100 |  如需替换SDK中的切图资源可以直接将`JhtNewsChannelImages.bundle`中的切图同名替换即可 101 |
102 | 103 | * 注:1. 对一些用户反馈的`缓存`疑惑统一解释一下,上面提到的缓存指的是,创建频道下的VC后且`app未重启`的情况下,进行频道编辑后,内部会优先使用之前创建的VC,假使不存在会重新创建新VC
104 |   2. 假使你想做频道编辑后的持久化存储可以在以下方法中实现 105 | 106 |     3. 在demo中可以查看相关的使用和配置方法
107 |     4. 最后,感谢大家长久以来的支持! 108 | 109 | 110 | ### Remind 111 | * ARC 112 | * iOS >= 7.0 113 | * iPhone \ iPad 114 | 115 | 116 | ## Hope 117 | * If you find bug when used,Hope you can Issues me,Thank you or try to download the latest code of this framework to see the BUG has been fixed or not 118 | * If you find the function is not enough when used,Hope you can Issues me,I very much to add more useful function to this framework ,Thank you ! 119 | -------------------------------------------------------------------------------- /ReadMEImages/Gif/deleteAndAdd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/Gif/deleteAndAdd.gif -------------------------------------------------------------------------------- /ReadMEImages/Gif/redPoint.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/Gif/redPoint.gif -------------------------------------------------------------------------------- /ReadMEImages/Gif/shake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/Gif/shake.gif -------------------------------------------------------------------------------- /ReadMEImages/Gif/slide.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/Gif/slide.gif -------------------------------------------------------------------------------- /ReadMEImages/ModelStructureDiagram/connectParamModel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/ModelStructureDiagram/connectParamModel.png -------------------------------------------------------------------------------- /ReadMEImages/ModelStructureDiagram/editParamModel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/ModelStructureDiagram/editParamModel.png -------------------------------------------------------------------------------- /ReadMEImages/Stationary.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinht/NewsChannel/ff9090cf1761823d6532a0658c275ab062f4368e/ReadMEImages/Stationary.PNG --------------------------------------------------------------------------------