CODING iOS 客户端源代码

Overview

Coding_iOS客户端项目介绍

编译环境:Xcode-Version 8.0 (8A218a)

让项目跑起来先

项目里用到了 CocoaPodsCarthage,如果没有安装的话,需要先自行安装。

Clone 代码后,初次执行前,需要双击运行根目录下的bootstrap脚本。这个过程涉及到下载依赖,可能会有点久,需耐心等待。

Tip:由于用到了 submodule,所以必需要把 git 仓库 clone 到本地,而不是只点击‘下载’按钮下载 zip 文件!!!

精彩项目 任务管理 项目文档 代码托管 趣味冒泡
图片1 图片2 图片3 图片4 图片5

下面介绍一下文件的大概目录先:

    .
    ├── Coding_iOS
    │   ├── Models:数据类
    │   ├── Views:视图类
    │   │   ├── CCell:所有的 CollectionViewCell 都在这里
    │   │   ├── Cell:所有的 TableViewCell 都在这里
    │   │   └── XXX:ListView(项目、动态、任务、讨论、文档、代码)和 InputView(用于聊天和评论的输入框)
    │   ├── Controllers:控制器,对应app中的各个页面
    │   │   ├── Login:登录页面
    │   │   ├── RootControllers:登录后的根页面
    │   │   ├── MeSetting:设置信息页面
    │   │   └── XXX:其它页面
    │   ├── Images:app 中用到的所有的图片都在这里
    │   ├── Resources:资源文件
    │   ├── Util:一些常用控件和 Category、Manager 之类
    │   │   ├── Common
    │   │   ├── Manager
    │   │   ├── OC_Category
    │   │   └── ObjcRuntime
    │   └── Vendor:用到的一些第三方类库,一般都有改动
    │       ├── AFNetworking
    │       ├── AGEmojiKeyboard
    │       ├── ASProgressPopUpView
    │       ├── ActionSheetPicker
    │       ├── FontAwesome+iOS
    │       ├── MJPhotoBrowser
    │       ├── MLEmojiLabel
    │       ├── NSDate+Helper
    │       ├── NSStringEmojize
    │       ├── PPiAwesomeButton
    │       ├── QBImagePickerController
    │       ├── RDVTabBarController
    │       ├── SMPageControl
    │       ├── SVPullToRefresh
    │       ├── SWTableViewCell
    │       ├── UMENG
    │       ├── UMessage_Sdk_1.1.0
    │       ├── XGPush
    │       ├── XTSegmentControl
    │       └── iCarousel
    └── Pods:项目使用了 [CocoaPods](http://code4app.com/article/cocoapods-install-usage) 这个类库管理工具

再说下项目的启动流程:

在 AppDelegate 的启动方法中,先设置了一下 Appearance 的样式,然后根据用户的登录状态选择是去加载登录页面 LoginViewController,还是登录后的 RootTabViewController 页面。

RootTabViewController 继承自第三方库 RDVTabBarController。在 RootTabViewController 里面依次加载了 Project_RootViewController、MyTask_RootViewController、Tweet_RootViewController、Message_RootViewController、Me_RootViewController 五个 RootViewController,后续的页面跳转都是基于这几个 RootViewController 引过去的。

项目里面还有些需要注意的点

  • Coding_NetAPIManager:基本上 app 的所有请求接口都放在了这里。网络请求使用的是 AFNetworking 库,与服务器之间的数据交互格式用的都是 json(与 Coding 使用的 api 一致)。

  • 关于推送:刚开始是用的 友盟推送,后来又改用了 腾讯信鸽,因为要兼顾旧版本 app 的推送,所以服务器是同时保留了两套推送。但是为了确保新版本的 app 不同时收到双份相同的推送消息,所以当前代码里还存留了友盟的 sdk,用于解除推送 token 与友盟 Alias 的绑定。

  • 关于 ProjectViewController:这个就是进入到某个项目之后的页面,这里包含了项目的动态、任务、讨论、文档、代码、成员各类信息,而且每类信息里面还可能会有新的分类(如‘任务’里面还分有各个成员的任务);这个页面相当的臃肿,我对它们做了拆分,都放在视图类 Views 目录下面。 首先是把数据列表独立成了对应的 XXXListView(如 ProjectTaskListView);然后如果需要标签切换的话,会再新建一个 XXXsView(如:ProjectTasksView),在这个视图中,上面会放一个切换栏 XTSegmentControl 显示各个标签,下面放一个 iCarousel 可以滑动显示各个标签的内容;最后这些视图都会存储在 ProjectViewController 的 projectContentDict 变量里面,根据顶部导航栏选择的类别,去显示或隐藏对应的视图。

  • 关于 UIMessageInputView:这个是私信聊天的输入框。因为这个输入框好多地方都有用到(冒泡、任务、讨论的评论还有私信),所以这个输入框就写成了一个相对独立的控件,并且直接显示在了 keyWindow 里面而不是某个视图里。这里的表情键盘用的是 AGEmojiKeyboard 改写了一下。

  • 关于 Emoji:这个,Coding 站点的 emoji 都是用的图片,而且服务器是不接受大部分 emoji 字符的,所以刚开始的时候 app 一直不能处理 emoji 表情;又因为没有 emoji 图片名和 emoji code 码的对应关系表,所以拖了很久都没能做好转换。直到在 github 上面找到了 NSStringEmojize 这个项目;试了一下,虽然也不能全部解析,但是大部分表情都能正确显示了,不能更感谢。

  • 关于如何正确显示冒泡的内容:api 返回的数据里面,冒泡内容都是 html 格式,需要做一下预处理;其实私信、讨论里面的内容也是 html。解析 html 的类名是 HtmlMediaItem,它是先用 hpple 对 html 进行了解析,然后把对应的 media 元素和对应的位置做一个存储,显示的时候便可以根据需要来显示了。

最后说下 CocoaPods 里面用到的第三方类库

License

Coding is available under the MIT license. See the LICENSE file for more info.

Issues
:octocat: iOS app to browse open-source-ios-apps

osia Super basic iOS app to browse open-source-ios-apps Getting Started git clone https://github.com/dkhamsing/osia.git open Swift/osia.xcodeproj CMD

null 61 Nov 14, 2021
A better way to handle gestures on iOS

Tactile is a safer and more idiomatic way to respond to gestures and control events. It lets you catch bugs at compile time and write more expressive

Damien 711 Nov 16, 2021
String (and more) validation for iOS

Swift Validators ?? String validation for iOS. Contents Installation Walkthrough Usage Available validators License ReactiveSwift + SwiftValidators Wa

George Kaimakas 233 Oct 27, 2021
DuckDuckGo iOS Application

DuckDuckGo iOS We are excited to engage the community in development! We are hiring! DuckDuckGo is growing fast and we continue to expand our fully di

DuckDuckGo 1.2k Nov 23, 2021
Firefox for iOS

Firefox for iOS Download on the App Store. This branch (main) This branch works with Xcode 12.4, Swift 5.3 and supports iOS 12.4 and above. Please not

Mozilla Mobile 10.6k Nov 26, 2021
Legacy Ghostery Browser for iOS

DEPRECATED - Ghostery for iOS version 2.x This project is no longer active. Please see our current iOS browser project for Ghostery iOS v3+. Ghostery

Ghostery 15 Oct 28, 2021
Kickstarter for iOS. Bring new ideas to life, anywhere.

Welcome to Kickstarter’s open source iOS app! Come on in, take your shoes off, stay a while—explore how Kickstarter’s native squad has built and conti

Kickstarter 7.8k Nov 21, 2021
Team Kodi 13.1k Nov 18, 2021
📱 Nextcloud iOS app

Nextcloud iOS app Check out https://nextcloud.com and follow us on twitter.com/nextclouders or twitter.com/NextcloudiOS How to contribute If you want

Nextcloud 1.1k Nov 26, 2021
📱😀 Video & audio calls through Nextcloud on iOS

Nextcloud Talk iOS app Video & audio calls and chat through Nextcloud on iOS Nextcloud Talk is a fully on-premises audio/video and chat communication

Nextcloud 92 Nov 26, 2021
Our new iOS portfolio app for WWDCScholars

WWDCScholars iOS App WWDCScholars is a community of Apple WWDC Scholarship winners. Every year bright minds from all around the world compete against

WWDCScholars 61 Sep 21, 2021
Simplenote for iOS

Simplenote for iOS A Simplenote client for iOS. Learn more about Simplenote at Simplenote.com. Build Instructions Download Xcode At the moment Simplen

Automattic 1.8k Nov 12, 2021
📱The official Wikipedia iOS app.

Wikipedia iOS The official Wikipedia iOS app. License: MIT License Source repo: https://github.com/wikimedia/wikipedia-ios Planning (bugs & features):

Wikimedia 2.4k Nov 11, 2021
📱 Wire for iOS (iPhone and iPad)

Wire™ This repository is part of the source code of Wire. You can find more information at wire.com or by contacting [email protected] You can find

Wire Swiss GmbH 3.1k Nov 19, 2021
WordPress for iOS - Official repository

WordPress for iOS Build Instructions Please refer to the sections below for more detailed information. The instructions assume the work is performed f

WordPress Mobile 3.2k Nov 18, 2021
iOS project bootstrap aimed at high quality coding.

iOS Project bootstrap How do you setup your iOS projects? Since we are approaching 2015 I’m working on refreshing my project bootstrap. I’ve decided t

Krzysztof Zabłocki 2k Nov 15, 2021
LaiFeng IOS Live Kit,H264 and AAC Hard coding,support GPUImage Beauty, rtmp transmission,weak network lost frame,Dynamic switching rate

LFLiveKit LFLiveKit is a opensource RTMP streaming SDK for iOS. Features Background recording Support horizontal vertical recording Support Beauty Fac

null 4.3k Nov 22, 2021
This project is a clone of YouTube. But the main intention is to show how to write clean code, using proper MVC patterns and re-usable coding methodologies!

YouTubeClone This project is a clone of YouTube. But the main intention is to show how to write clean code, using proper MVC patterns and re-usable co

Vamshi Krishna 163 Nov 4, 2021
Easy JSON to NSObject mapping using Cocoa's key value coding (KVC)

#Motis Object Mapping Easy JSON to NSObject mapping using Cocoa's key value coding (KVC) Motis is a user-friendly interface with Key Value Coding that

Mobile Jazz 253 Nov 7, 2021
Simple and lightweight Functional Reactive Coding in Swift for the rest of us

The simplest Observable<T> implementation for Functional Reactive Programming you will ever find. This library does not use the term FRP (Functional R

Jens Ravens 1.1k Nov 17, 2021
Key-Value Coding (KVC) for native Swift classes and structs

SwiftKVC SwiftKVC brings key-value coding to native Swift classes and structures. You can easily set and access properties just using a subscript: var

Brad Hilton 134 Oct 23, 2021
A style guide that outlines the coding conventions for raywenderlich.com

The official raywenderlich.com Objective-C style guide. This style guide outlines the coding conventions for raywenderlich.com. Introduction The reaso

raywenderlich 3.1k Nov 18, 2021
**Archived** Style guide & coding conventions for Objective-C projects

This repository is no longer active. These guidelines build on Apple's existing Coding Guidelines for Cocoa. Unless explicitly contradicted below, ass

GitHub 1.7k Nov 9, 2021
**Archived** Style guide & coding conventions for Swift projects

This repository is no longer active. A guide to our Swift style and conventions. This is an attempt to encourage patterns that accomplish the followin

GitHub 4.7k Nov 20, 2021
Key-Value Coding (KVC) for native Swift classes and structs

SwiftKVC SwiftKVC brings key-value coding to native Swift classes and structures. You can easily set and access properties just using a subscript: var

Brad Hilton 134 Oct 23, 2021
A charting library to visualize and interact with a vector map on iOS. It's like Geochart but for iOS!

FSInteractiveMap A charting library to visualize data on a map. It's like geochart but for iOS! The idea behind this library is to load a SVG file of

Arthur 544 Oct 11, 2021
[Deprecated] iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android).

FinanceReactNative iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android). Data is pulled from Yahoo Finance

kf 1.9k Nov 17, 2021
iOS tool that helps with profiling iOS Memory usage.

FBMemoryProfiler An iOS library providing developer tools for browsing objects in memory over time, using FBAllocationTracker and FBRetainCycleDetecto

Facebook 3.4k Nov 8, 2021