{"id":15028422,"url":"https://github.com/dequan1331/hybridpagekit","last_synced_at":"2025-10-07T06:00:11.154Z","repository":{"id":31974494,"uuid":"124619709","full_name":"dequan1331/HybridPageKit","owner":"dequan1331","description":"A high-performance、high-extensibility、easy integration framework for Hybrid content page. Support most content page types of News App.  ","archived":false,"fork":false,"pushed_at":"2023-02-03T02:24:09.000Z","size":39853,"stargazers_count":1222,"open_issues_count":9,"forks_count":189,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-16T08:05:24.234Z","etag":null,"topics":["hybrid","newsapp","reuse","scrollview","wkwebview"],"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/dequan1331.png","metadata":{"files":{"readme":"README-CN.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":"2018-03-10T03:46:58.000Z","updated_at":"2025-03-30T13:47:03.000Z","dependencies_parsed_at":"2023-02-18T02:31:01.193Z","dependency_job_id":null,"html_url":"https://github.com/dequan1331/HybridPageKit","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequan1331%2FHybridPageKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequan1331%2FHybridPageKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequan1331%2FHybridPageKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequan1331%2FHybridPageKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dequan1331","download_url":"https://codeload.github.com/dequan1331/HybridPageKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"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","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":["hybrid","newsapp","reuse","scrollview","wkwebview"],"created_at":"2024-09-24T20:08:18.031Z","updated_at":"2025-10-07T06:00:06.127Z","avatar_url":"https://github.com/dequan1331.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HybridPageKit\n\n![GitHub](https://img.shields.io/github/license/dequan1331/HybridPageKit.svg)\n![Cocoapods platforms](https://img.shields.io/cocoapods/p/HybridPageKit.svg)\n![GitHub closed issues](https://img.shields.io/github/issues-closed/dequan1331/HybridPagekit.svg)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dequan1331/HybridPageKit.svg)\n\n[英文](./README.md) | [扩展阅读](https://dequan1331.github.io/) | [Extended Reading](https://dequan1331.github.io/index-en.html) \n\n\u003e**HybridPageKit**是一个针对新闻类App高性能、易扩展、组件化的通用内容页实现框架。\n\u003e\n\u003e基于[扩展阅读](https://dequan1331.github.io/)中关于内容页架构和性能的探索。\n\n\u003cbr\u003e\n\n\u003cdiv\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/dequan1331/HybridPageKit/master/README-IMAGE/Hybrid.gif\" width=\"20%\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/dequan1331/HybridPageKit/master/README-IMAGE/Short.gif\" width=\"20%\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/dequan1331/HybridPageKit/master/README-IMAGE/Banner.gif\" width=\"20%\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/dequan1331/HybridPageKit/master/README-IMAGE/Folded.gif\" width=\"20%\"\u003e\n\u003c/div\u003e\n\n## 配置 \u0026 安装\n\n1.\tCocoaPods \n```objc\n//In your Podfile\npod \"HybridPageKit\", :testspecs =\u003e [\"HybridPageKitTests\"]\n...\n```\n\n2. Carthage\n\n```objc\n//In your Cartfile\ngit \"https://github.com/dequan1331/HybridPageKit.git\" \"master\"\n```\n\n3. Cloning the repository\n\n\n##\t特性\n\n\u003e\t强烈建议阅读[iOS新闻类App内容页技术探索](https://dequan1331.github.io/)\n\n*  全部面向协议集成简单，几十行代码完成新闻类App的内容展示页框架，满足绝大多数使用场景\n*  易于扩展，组件化管理高内聚低耦合，功能模块高度独立\n*  使用并扩展WKWebView，在提高系统稳定性的同时，进行更加友好和全面的扩展\n*  自动实现WKWebView全局复用、Native组件滚动复用、全局复用\n*  WebView中元素Native化实现，数据驱动，极大减少开发和维护成本，提升首屏速度\n*  统一页面内滚动复用管理逻辑，简单易于集成和扩展，线程安全\n\n\n## 相关阅读\n\n* [iOS新闻类App内容页技术探索](https://dequan1331.github.io/)\n\n\n## 快速使用\n\n\n1. 基于后台下发模板-数据分离的数据结构\n\t\t\t\t\t\n```json\n{\n//内容HTML\n\"articleContent\": \"\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003e\u003cP\u003eTEXTTEXTTEXTTEXTTEXTTEXT\u003c/P\u003e\u003cP\u003e{{IMG_0}}\u003c/P\u003e\u003cP\u003eTEXTTEXTTEXTTEXTTEXTTEXT\u003c/P\u003e\u003cP\u003e{{IMG_1}}\u003c/P\u003e\u003cP\u003eTEXTTEXTTEXTTEXTTEXTTEXT\u003c/P\u003e\u003cP\u003e{{IMG_2}}\u003c/P\u003e\u003cP\u003eThe End\u003c/P\u003e\u003c/body\u003e\u003c/html\u003e\",\n\n//内容HTML中的非文字组件数据\n\"articleAttributes\": {\n\t\"IMG_0\": {\n\t    \"url\": \"http://127.0.0.1:8080?type=3\",\n\t    \"width\": \"340\",\n\t    \"height\": \"200\"\n\t},\n\t\"IMG_1\": {\n\t    \"url\": \"http://127.0.0.1:8080?type=3\",\n\t    \"width\": \"340\",\n\t    \"height\": \"200\"\n\t},\n\t\"IMG_2\": {\n\t    \"url\": \"http://127.0.0.1:8080?type=3\",\n\t    \"width\": \"340\",\n\t    \"height\": \"200\"\n\t},\n},  \n\n//扩展区域中的组件数据\n\"articleRelateNews\": {\n    \"index\":\"1\",\n    \"newsArray\" : [\n        \"扩展阅读区 - RelateNews - 1\",\n        \"扩展阅读区 - RelateNews - 2\",\n        \"扩展阅读区 - RelateNews - 3\",\n        \"扩展阅读区 - RelateNews - 4\",\n    ],\n}, \n\n//扩展区域中的组件数据\n\"articleComment\": {\n    \"index\":\"2\",\n    \"commentArray\" : [\n        \"相关评论区 - Comment - 1\",\n        \"相关评论区 - Comment - 2\",\n        \"相关评论区 - Comment - 3\",\n        \"相关评论区 - Comment - 4\",\n    ],\n},  \n}\n```\n\n2. 生成对应UI组件的Model、View\n\n```objc\n//Model实现HPKModelProtocol协议\n@interface VideoModel : NSObject\u003cHPKModelProtocol\u003e\n...\nIMP_HPKModelProtocol(@\"\");\n\n//View实现HPKModelProtocol协议\n@interface VideoView : UIImageView\u003cHPKViewProtocol\u003e\n...\nIMP_HPKViewProtocol()\n\n```\n\n3. 生成UI组件对应的Controller，处理控制逻辑\n\n```objc\n@interface VideoController : NSObject\u003cHPKControllerProtocol\u003e\n...\n- (nullable NSArray\u003cClass\u003e *)supportComponentModelClass {\n\treturn @[[VideoModel class]];\n}\n...\n- (nullable Class)reusableComponentViewClassWithModel:(HPKModel *)componentModel {\n\treturn [VideoView class];\n}\n...\n- (void)scrollViewWillDisplayComponentView:(HPKView *)componentView\n                    componentModel:(HPKModel *)componentModel {\n...\n}\n\n- (void)controllerViewDidDisappear {\n...\n}\n```\n\n4. 实现简单的内容页\n\n```objc\n...\n_componentHandler = [[HPKPageHandler alloc] initWithViewController:self componentsControllers:@[VideoController ...];\n...\n[_componentHandler handleSingleScrollView:[[UIScrollView alloc] initWithFrame:self.view.bounds]];\n...\n[_componentHandler layoutWithComponentModels:@[VideoModel ...]];\n...\n```\n\n5. 实现复杂Hybrid类型的内容页\n\n```objc\n// in page viewController\n...\n_componentHandler = [[HPKPageHandler alloc] initWithViewController:self componentsControllers:@[VideoController ...];\n...\n[_componentHandler handleHybridPageWithContainerScrollView:[[UIScrollView alloc] initWithFrame:self.view.bounds] defaultWebViewClass:[HPKWebViewSubClass class] defaultWebViewIndex:1 webComponentDomClass:@\"domClass\" webComponentIndexKey:@\"domAttrIndex\"];\n...\n[_componentHandler layoutWithWebComponentModels:@[WebVideoModel ...]];\n...\n[_componentHandler layoutWithComponentModels:@[VideoModel ...];\n...\n```\n\n\n## 证书\n\nAll source code is licensed under the [MIT License](https://github.com/dequan1331/HybridPageKit/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdequan1331%2Fhybridpagekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdequan1331%2Fhybridpagekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdequan1331%2Fhybridpagekit/lists"}