{"id":13849048,"url":"https://github.com/Coding/Coding-iOS","last_synced_at":"2025-07-12T15:32:59.658Z","repository":{"id":42176170,"uuid":"42172037","full_name":"coding/Coding-iOS","owner":"coding","description":"CODING iOS 客户端源代码","archived":false,"fork":false,"pushed_at":"2019-05-23T03:43:13.000Z","size":65180,"stargazers_count":3802,"open_issues_count":5,"forks_count":1272,"subscribers_count":235,"default_branch":"master","last_synced_at":"2025-05-21T21:06:06.548Z","etag":null,"topics":["carthage","cocoapods","coding","emoji","hpple","html","ios","roottabviewcontroller"],"latest_commit_sha":null,"homepage":"https://coding.net/u/coding/p/Coding-iOS/git","language":"Objective-C","has_issues":false,"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/coding.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":"2015-09-09T10:29:59.000Z","updated_at":"2025-05-19T09:14:25.000Z","dependencies_parsed_at":"2022-08-26T04:10:34.178Z","dependency_job_id":null,"html_url":"https://github.com/coding/Coding-iOS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coding/Coding-iOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding%2FCoding-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding%2FCoding-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding%2FCoding-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding%2FCoding-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coding","download_url":"https://codeload.github.com/coding/Coding-iOS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coding%2FCoding-iOS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265013552,"owners_count":23698061,"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":["carthage","cocoapods","coding","emoji","hpple","html","ios","roottabviewcontroller"],"created_at":"2024-08-04T19:01:06.584Z","updated_at":"2025-07-12T15:32:54.645Z","avatar_url":"https://github.com/coding.png","language":"Objective-C","funding_links":[],"categories":["Objective-C","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\n### Coding_iOS客户端项目介绍 \n*编译环境：Xcode-Version 8.0 (8A218a)*\n#### 让项目跑起来先\n\n项目里用到了 [CocoaPods](http://cocoapods.org/) 和 [Carthage](https://github.com/Carthage/Carthage)，如果没有安装的话，需要先自行安装。\n\nClone 代码后，初次执行前，需要双击运行根目录下的`bootstrap`脚本。这个过程涉及到下载依赖，可能会有点久，需耐心等待。\n\n**Tip：由于用到了 submodule，所以必需要把 git 仓库 clone 到本地，而不是只点击‘下载’按钮下载 zip 文件！！！**\n\n精彩项目|任务管理|项目文档|代码托管|趣味冒泡\n------------ | ------------- | ------------| ------------| ------------\n![图片1][1]|![图片2][2]|![图片3][3]|![图片4][4]|![图片5][5]\n\n\n\n#### 下面介绍一下文件的大概目录先：\n```\n    .\n    ├── Coding_iOS\n    │   ├── Models：数据类\n    │   ├── Views：视图类\n    │   │   ├── CCell：所有的 CollectionViewCell 都在这里\n    │   │   ├── Cell：所有的 TableViewCell 都在这里\n    │   │   └── XXX：ListView（项目、动态、任务、讨论、文档、代码）和 InputView（用于聊天和评论的输入框）\n    │   ├── Controllers：控制器，对应app中的各个页面\n    │   │   ├── Login：登录页面\n    │   │   ├── RootControllers：登录后的根页面\n    │   │   ├── MeSetting：设置信息页面\n    │   │   └── XXX：其它页面\n    │   ├── Images：app 中用到的所有的图片都在这里\n    │   ├── Resources：资源文件\n    │   ├── Util：一些常用控件和 Category、Manager 之类\n    │   │   ├── Common\n    │   │   ├── Manager\n    │   │   ├── OC_Category\n    │   │   └── ObjcRuntime\n    │   └── Vendor：用到的一些第三方类库，一般都有改动\n    │       ├── AFNetworking\n    │       ├── AGEmojiKeyboard\n    │       ├── ASProgressPopUpView\n    │       ├── ActionSheetPicker\n    │       ├── FontAwesome+iOS\n    │       ├── MJPhotoBrowser\n    │       ├── MLEmojiLabel\n    │       ├── NSDate+Helper\n    │       ├── NSStringEmojize\n    │       ├── PPiAwesomeButton\n    │       ├── QBImagePickerController\n    │       ├── RDVTabBarController\n    │       ├── SMPageControl\n    │       ├── SVPullToRefresh\n    │       ├── SWTableViewCell\n    │       ├── UMENG\n    │       ├── UMessage_Sdk_1.1.0\n    │       ├── XGPush\n    │       ├── XTSegmentControl\n    │       └── iCarousel\n    └── Pods：项目使用了 [CocoaPods](http://code4app.com/article/cocoapods-install-usage) 这个类库管理工具\n```\n\n\n#### 再说下项目的启动流程：\n在 AppDelegate 的启动方法中，先设置了一下 Appearance 的样式，然后根据用户的登录状态选择是去加载登录页面 LoginViewController，还是登录后的 RootTabViewController 页面。\n\nRootTabViewController 继承自第三方库 [RDVTabBarController](https://github.com/robbdimitrov/RDVTabBarController)。在 RootTabViewController 里面依次加载了 Project_RootViewController、MyTask_RootViewController、Tweet_RootViewController、Message_RootViewController、Me_RootViewController 五个 RootViewController，后续的页面跳转都是基于这几个 RootViewController 引过去的。\n\n#### 项目里面还有些需要注意的点\n - Coding_NetAPIManager：基本上 app 的所有请求接口都放在了这里。网络请求使用的是 [AFNetworking](https://github.com/AFNetworking/AFNetworking) 库，与服务器之间的数据交互格式用的都是 json（与 [Coding](https://coding.net) 使用的 api 一致）。\n  \n - 关于推送：刚开始是用的 [友盟推送](http://www.umeng.com/)，后来又改用了 [腾讯信鸽](http://xg.qq.com/)，因为要兼顾旧版本 app 的推送，所以服务器是同时保留了两套推送。但是为了确保新版本的 app 不同时收到双份相同的推送消息，所以当前代码里还存留了友盟的 sdk，用于解除推送 token 与友盟 Alias 的绑定。\n \n - 关于 ProjectViewController：这个就是进入到某个项目之后的页面，这里包含了项目的动态、任务、讨论、文档、代码、成员各类信息，而且每类信息里面还可能会有新的分类（如‘任务’里面还分有各个成员的任务）；这个页面相当的臃肿，我对它们做了拆分，都放在视图类 Views 目录下面。 首先是把数据列表独立成了对应的 XXXListView（如 ProjectTaskListView）；然后如果需要标签切换的话，会再新建一个 XXXsView（如：ProjectTasksView），在这个视图中，上面会放一个切换栏 [XTSegmentControl](https://github.com/xushao1990/XTNews) 显示各个标签，下面放一个 [iCarousel](https://github.com/nicklockwood/iCarousel) 可以滑动显示各个标签的内容；最后这些视图都会存储在 ProjectViewController 的 projectContentDict 变量里面，根据顶部导航栏选择的类别，去显示或隐藏对应的视图。\n \n - 关于 UIMessageInputView：这个是私信聊天的输入框。因为这个输入框好多地方都有用到（冒泡、任务、讨论的评论还有私信），所以这个输入框就写成了一个相对独立的控件，并且直接显示在了 keyWindow 里面而不是某个视图里。这里的表情键盘用的是 [AGEmojiKeyboard](https://github.com/ayushgoel/AGEmojiKeyboard) 改写了一下。\n \n - 关于 Emoji：这个，[Coding](https://coding.net) 站点的 emoji 都是用的图片，而且服务器是不接受大部分 emoji 字符的，所以刚开始的时候 app 一直不能处理 emoji 表情；又因为没有 emoji 图片名和 emoji code 码的对应关系表，所以拖了很久都没能做好转换。直到在 github 上面找到了 [NSStringEmojize](https://github.com/diy/NSStringEmojize) 这个项目；试了一下，虽然也不能全部解析，但是大部分表情都能正确显示了，不能更感谢。\n \n - 关于如何正确显示冒泡的内容：api 返回的数据里面，冒泡内容都是 html 格式，需要做一下预处理；其实私信、讨论里面的内容也是 html。解析 html 的类名是 HtmlMediaItem，它是先用 [hpple](https://github.com/topfunky/hpple) 对 html 进行了解析，然后把对应的 media 元素和对应的位置做一个存储，显示的时候便可以根据需要来显示了。\n\n#### 最后说下 [CocoaPods](http://cocoapods.org/) 里面用到的第三方类库\n - [SDWebImage](https://github.com/rs/SDWebImage)：图片加载\n - [TTTAttributedLabel](https://github.com/TTTAttributedLabel/TTTAttributedLabel)：富文本的 label，可点击链接\n - [RegexKitLite](https://github.com/wezm/RegexKitLite)：正则表达式\n - [hpple](https://github.com/topfunky/hpple)：html 解析\n - [MBProgressHUD](https://github.com/jdg/MBProgressHUD)：hud 提示框\n - [ODRefreshControl](https://github.com/Sephiroth87/ODRefreshControl)：下拉刷新\n - [TPKeyboardAvoiding](https://github.com/michaeltyson/TPKeyboardAvoiding)：有文字输入时，能根据键盘是否弹出来调整自身显示内容的位置\n - [JDStatusBarNotification](https://github.com/jaydee3/JDStatusBarNotification)：状态栏提示框\n - [BlocksKit](https://github.com/zwaldowski/BlocksKit)：block 工具包。将很多需要用 delegate 实现的方法整合成了 block 的形式\n - [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa)：基于响应式编程思想的 oc 实践（是个好东西呢）\n \n#### License\nCoding is available under the MIT license. See the LICENSE file for more info.\n\n\n  [1]: Screenshots/1.png\n  [2]: Screenshots/2.png\n  [3]: Screenshots/3.png\n  [4]: Screenshots/4.png\n  [5]: Screenshots/5.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCoding%2FCoding-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCoding%2FCoding-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCoding%2FCoding-iOS/lists"}