{"id":13990229,"url":"https://github.com/jinht/NewsChannel","last_synced_at":"2025-07-22T12:31:12.448Z","repository":{"id":56916945,"uuid":"67021459","full_name":"jinht/NewsChannel","owner":"jinht","description":"新闻频道栏/滚动栏（网易新闻，新浪新闻，搜狐新闻，今日头条，聚划算，腾讯视频，优酷等类的频道栏），支持小红点标识 \u0026\u0026 懒加载 \u0026\u0026 缓存 \u0026\u0026 排序 \u0026\u0026 增删等","archived":false,"fork":false,"pushed_at":"2019-09-17T04:26:54.000Z","size":14354,"stargazers_count":254,"open_issues_count":3,"forks_count":58,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-18T19:26:51.693Z","etag":null,"topics":["channels","ios-sdk","netease","news-reader","newschannel","scrollbar"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jinht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-31T09:01:59.000Z","updated_at":"2025-05-24T05:24:30.000Z","dependencies_parsed_at":"2022-08-20T21:20:28.368Z","dependency_job_id":null,"html_url":"https://github.com/jinht/NewsChannel","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jinht/NewsChannel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinht%2FNewsChannel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinht%2FNewsChannel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinht%2FNewsChannel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinht%2FNewsChannel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinht","download_url":"https://codeload.github.com/jinht/NewsChannel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinht%2FNewsChannel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266495924,"owners_count":23938626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["channels","ios-sdk","netease","news-reader","newschannel","scrollbar"],"created_at":"2024-08-09T13:02:29.111Z","updated_at":"2025-07-22T12:31:10.249Z","avatar_url":"https://github.com/jinht.png","language":"Objective-C","funding_links":[],"categories":["Objective-C"],"sub_categories":[],"readme":"## NewsChannel\n\n## Ready\n#### 新闻频道栏（网易新闻，新浪新闻，搜狐新闻，今日头条，聚划算，腾讯视频，优酷等类似的频道栏）\u003cbr\u003e\n#### 支持小红点标识 \u0026amp;\u0026amp; 懒加载 \u0026amp;\u0026amp; 缓存 \u0026amp;\u0026amp; 排序 \u0026amp;\u0026amp; 增删等。\u003cbr\u003e\u003cbr\u003e\n\n### 一言不合就上图\n\u003cimg src=\"https://raw.githubusercontent.com/jinht/NewsChannel/master/ReadMEImages/Gif/slide.gif\" width=200 height=350 /\u003e\u0026emsp;\u003cimg src=\"https://raw.githubusercontent.com/jinht/NewsChannel/master/ReadMEImages/Gif/shake.gif\" width=200 height=350 /\u003e\u0026emsp;\u003cimg src=\"https://raw.githubusercontent.com/jinht/NewsChannel/master/ReadMEImages/Gif/deleteAndAdd.gif\" width=200 height=350 /\u003e\u0026emsp;\u003cimg src=\"https://raw.githubusercontent.com/jinht/NewsChannel/master/ReadMEImages/Gif/redPoint.gif\" width=200 height=350 /\u003e\n\n### Function Description\n1. 单个频道小红点标识：JhtNewsChannelItemModel中`isShowRedPoint`为BOOL值，在生成频道栏数据Model时可以一起添加频道是否有小红点标识，在后续调接口设置小红点状态依旧照前述可以实现；\n2. 懒加载：页面不会全部加载（非scrollview），点击或者滑动到哪里加载相应页面，同时可以自己设置缓存的个数；\n3. 频道位置固定：可以设置单个或多个频道位置不可变动；\n4. 频道栏排序：可以在排序界面进行自定义排序（会有颤抖提示）；\n5. 频道增删：可以在排序界面进行自定义的增删频道，同时囊括排序功能；\n6. 说明：排序或者增删之后的相应页面均可在缓存中找到！\n\n\n## GO\n### How to use\n#### 1. podfile\n```oc\nplatform:ios, '8.0'\n\ntarget '*****' do\n\npod 'JhtNewsChannel'\n        \nend\n\n```\n\n\n#### 2. 个性化设置\u003cbr\u003e\n\u0026emsp;a. JhtNewsChannelItemModel：顶部频道Model，你可以继承这个model，来扩展满足自己需求的model；\u003cbr\u003e\n\u0026emsp;b. JhtChannelBarAndSlideViewConnectParamModel：用于切换频道栏界面中相关设置参数model，包含`尾部加号按钮` \u0026\u0026 `颜色和字号` \u0026\u0026 `间距和坐标` \u0026\u0026 `缓存页数` 等相关设置；\u003cbr\u003e\n\u0026emsp;c. JhtChannelBarAndSlideViewConnectParamModel中的属性`notMoveNameArray`（不能移动频道的名字数组）设置频道位置固定, `toAddItemArray`（用于存储JhtNewsChannelItemModel）属性用于设置待添加的频道数组；\u003cbr\u003e\n\u0026emsp;d. JhtNewsChannelItemEditParamModel：用于排序界面中相关设置参数model，包含`文字` \u0026\u0026 `文字颜色` \u0026\u0026 `距离` \u0026\u0026 `背景颜色` 类等相关设置。\u003cbr\u003e\n\u0026emsp;e. JhtChannelBarAndSlideViewConnectParamModel和JhtNewsChannelItemEditParamModel结构如下图\u003cbr\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jinht/NewsChannel/master/ReadMEImages/ModelStructureDiagram/connectParamModel.png\" width=210 height=327 /\u003e\u0026emsp;\u003cimg src=\"https://raw.githubusercontent.com/jinht/NewsChannel/master/ReadMEImages/ModelStructureDiagram/editParamModel.png\" width=244 height=329 /\u003e\n* 注：model内部均注有required/optional区分标识\u003cbr\u003e\n\u0026emsp;\u0026emsp;1. required：必要参数，需要进行相关传递\u003cbr\u003e\n\u0026emsp;\u0026emsp;2. optional：个性化配置参数，内部均有相应默认值\n\n\n#### 3. 建立滑频道条和可滑动的view：相关个性化设置均由传递的Model中参数实现\n```oc\n/** 创建ChannelBarAndSliderView和排序删除界面\n *  barAndSlideModel：用于设置sliderView和bar参数model（为了容错，含有部分属性默认值）\n *  itemEditModel：用于排序界面的参数设置（为了容错，含有部分属性默认值）\n *  channelArray：已经添加的频道数组 存储JhtNewsChannelItemModel (必要参数，并且是存储JhtNewsChannelItemModel的数组)\n *  baseViewController：所处于的VC\n *  sortFView：排序界面放入的父view\n *  titleArray：所有的名字数组\n *  delegate：代理\n */\n- (id)initSlideViewAndItemEditViewWithBarAndSlideModel:(JhtChannelBarAndSlideViewConnectParamModel *)barAndSlideModel withNewsChannelItemEditModel:(JhtNewsChannelItemEditParamModel *)itemEditModel withChanelArray:(NSMutableArray *)channelArray withBaseViewController:(id)baseViewController withSortFView:(UIView *)sortFView withTitleArray:(NSArray *)titleArray withDelegte:(id\u003cJhtTotalSlideViewDelegate\u003e)delegate;\n```\n\n\n#### 4. JhtTotalSlideViewDelegate 方法\n```oc\n@protocol JhtTotalSlideViewDelegate \u003cNSObject\u003e\n/** VC总数量 */\n- (NSInteger)numberOfTabsInJhtTotalSlideView:(JhtTotalSlideView *)sender;\n/** 当前index下的VC */\n- (UIViewController *)JhtTotalSlideView:(JhtTotalSlideView *)sender controllerAt:(NSInteger)index;\n\n/** 点击VC的index */\n- (void)JhtTotalSlideView:(JhtTotalSlideView *)sender didSelectedAt:(NSInteger)index;\n\n/** 排序之后的操作\n *  modelArr：model数组\n *  nameArray：名字数组\n *  selectedIndex：选中的index\n */\n- (void)JhtTotalSlideViewWithSortModelArr:(NSArray *)modelArr withNameArray:(NSArray *)nameArray withSelectIndex:(NSInteger)selectedIndex;\n```\n\n\n#### 5. `JhtChannelBarAndSlideViewConnect` 方法\n\u0026emsp;a. 判断频道栏尾部按钮是否可以被点击\n```oc\n/** 判断频道栏尾部按钮是否可以被点击\n *  enable:yes可以被点击 \n */\n- (void)judgeChannelBarTailBtnIsEnableClick:(BOOL)enable;\n```\n\u0026emsp;b. 隐藏或者出现小红点\n```oc\n/** 隐藏或者出现小红点\n *  hidden：yes隐藏\n *  index：topBar 中频道栏的index\n */\n- (void)redPonitIsHidden:(BOOL)hidden withIndex:(NSInteger)index;\n```\n\n\n#### 6. 修改SDK切图资源\n\u0026emsp;如需替换SDK中的切图资源可以直接将`JhtNewsChannelImages.bundle`中的切图同名替换即可\n\u003cbr\u003e\n\n* 注：1. 对一些用户反馈的`缓存`疑惑统一解释一下，上面提到的缓存指的是，创建频道下的VC后且`app未重启`的情况下，进行频道编辑后，内部会优先使用之前创建的VC，假使不存在会重新创建新VC\u003cbr\u003e\n\u0026emsp;\u0026emsp;2. 假使你想做频道编辑后的持久化存储可以在以下方法中实现\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/13724367/21304949/9f752672-c603-11e6-9d1a-bd1b91ebb7fa.jpg\"/\u003e\n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;3. 在demo中可以查看相关的使用和配置方法\u003cbr\u003e\n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;4. 最后，感谢大家长久以来的支持！\n      \n \n### Remind\n* ARC\n* iOS \u003e= 7.0\n* iPhone \\ iPad \n       \n\n## Hope\n* 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\n* 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 !\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinht%2FNewsChannel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinht%2FNewsChannel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinht%2FNewsChannel/lists"}