加载中
I love open source.

And I love the developers, who spend their valuable private time creating amazing things, which then they share with other people and don’t want anything in return. Open source authors and contributors, you are awesome people. Thank you for all your work.

So from my daily work on my own apps, here I’ve selected favorites from my favorites iOS open source libraries. Order of these projects is totally random, all of them are simply awesome.

The overwhelming majority of the libraries support CocoaPods, so adding them to your Xcode project is a breeze.

On the bottom of the article you will find a TL;DR version — a simple list with only titles and links to the projects. If you’ll find this article useful, share it with your iOS dev buddies. Good things need to spread.

我爱开源。

我也爱开发者们,他们花费大量宝贵的时间创造出如此惊人的东西,然后与其他人分享,而不要求任何回报。开源作者和贡献者们,你们令人敬佩。感谢你们所有的工作。

我在处理自己的 App 的日常工作中,收藏了一些 iOS 开源库,本文我只从中选择了一部分。这些项目的排序是随机的,但是它们都很棒。

多数库支持 CocoaPods,所以很容易把它们加到你的 XCode 项目中。

在文章的底部,你会发现一个简化版本 —就是一个简单的标题及其链接的列表。如果你觉得这篇文章有用,请分享给你的 iOS 朋友。好东西需要传播。

1. DZNEmptyDataSet

This should be a standard, built-in into iOS way of dealing with empty table and collection views. By default if your table view is empty, the screen is empty. It’s not the best user experience you can have.

With this library you just need to conform to a few protocols and iOS will beautifully take care of your collection view and display proper, good looking to user messages. No brainer for every iOS project.

CocoaPods:

pod 'DZNEmptyDataSet'

DZNEmptyDataSet
DZNEmptyDataSet - A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the…github.

2. PDTSimpleCalendar

Need a simple, nice looking and working calendar component for your app? Now you have — PDTSimpleCalendar is probably the best calendar component for iOS. You can customize it in many ways, both working logic and looking.

CocoaPods:

pod 'PDTSimpleCalendar'

jivesoftware/PDTSimpleCalendar
PDTSimpleCalendar - A simple Calendar / Date Picker for iOS using UICollectionViewgithub.com

1. DZNEmptyDataSet

这是 iOS 内建的标准,用于处理空表和集合视图。默认情况下,如果你的表视图是空的,屏幕上什么也不会显示。它给予的用户体验还不算最佳。

使用这个库,你只需要一些协议,iOS 就会很好地处理集合视图,然后合理美观地显示出用户信息。你不需要为每一个 iOS 项目费心。

CocoaPods:

pod 'DZNEmptyDataSet'

DZNEmptyDataSet
DZNEmptyDataSet - UITableView/UICollectionView 超类类别,用于显示人数据集…github.

2. PDTSimpleCalendar

你的应用需要一个好看的日历组件吗?现在你有了 — PDTSimpleCalendar 可以说是最好的 iOS 日历组件。你可以通过许多方法定义它,包括工作逻辑和视觉效果。

CocoaPods:

pod 'PDTSimpleCalendar'

jivesoftware/PDTSimpleCalendar
PDTSimpleCalendar - iOS 的简单的日历/日期选择组件,使用 UIColectionView ... github.com

3. MagicalRecord

Core Data is simple, they said. It’s nice and simple, they said. Huh, really, Apple? A ton of boilerplate code added to each project isn’t very elegant and simple. Not to mention adding, removing and updating a lot of entities, saving context, creating different Core Data stacks for different environments etc, etc. I like Core Data very much of course, but Apple really could simplify it in a little better way — the MagicalRecord way.

MagicalRecord works like a wrapper for Core Data and hides from developer all non-relevant stuff. If you’ve ever worked with active record pattern (e.g. Ruby on Rails), you’re in home. Really, really recommended library if you are using Core Data in your app.

CocoaPods:

pod 'MagicalRecord'

magicalpanda/MagicalRecord
MagicalRecord - Super Awesome Easy Fetching for Core Data 1!!!11!!!!1!github.com

4. Chameleon

If you are reading this, odds that you’re a better programmer than a designer are very high. This is something for you.

Chameleon is a color framework for iOS. It extends UIColor with beautiful, modern flat colors. It also gives us ability to create color palletes from color defined by us. It can do many other things, explore readme. If you want beautiful application, definitely add this library to your project.

CocoaPods:

pod 'ChameleonFramework'

ViccAlexander/Chameleon
Chameleon - Flat Color Framework for iOS (Obj-C & Swift)github.com

3. MagicalRecord

有人说 Core Data 简单。也有人说它不仅简单而且美观。呵,得了吧,说的是苹果吗?巨多的封装代码被添加到工程里面并不会非常优雅和简单的,更别提要添加、删除和更新如此多的实体、保存上下文,为不同的环境创建不同的 Core Data 栈等等等等这些事情了。我当然也很喜欢 Core Data, 但苹果公司真应该用更好的方式把它简化一下了 — MagicalRecord 的方式就可以。

MagicalRecord 就像是针对 Core Data 的一个封装,隐藏了所有跟开发者无关的东西。如果你用过动态记录模式(例如, Ruby on Rails 就有用到)的话, 那这个非你莫属。如果你的应用里面也使用到了 Core Data,那我真的非常非常推荐这个库。

CocoaPods:

pod 'MagicalRecord'

magicalpanda/MagicalRecord
MagicalRecord - 超赞,帮助你轻松搞定 Core Data 1!!!11!!!!1!github.com

4. Chameleon

如果你正读到这个,那么比起设计师,你可能会是一个更好的程序员。而这个就是为你准备的。

Chameleon 是一个 iOS 的颜色框架。它扩展了 UIColor,加入了漂亮的、现代扁平化风格的颜色。它也让我们可以从由我们自己定义的颜色创建出调色板。通过阅读 readme,你会发现它还能做很多其它的事情。如果你想要的是一个漂亮的应用程序,绝对要把这个库添加到代码工程里面。

CocoaPods:

pod 'ChameleonFramework'

ViccAlexander/Chameleon
Chameleon - iOS  (Obj-C & Swift)的扁平风格颜色框架github.com

5. Alamofire

Alamofire is an elegant networking library written in Swift. Have you ever been using AFNetworking? Alamofire is it’s younger brother. Younger and more stylish, of course (AFNetworking is written in Objective-C).

Need to do networking stuff like downloading, uploading, getting JSONs etc.? Alamofire is for you. 8000 people on GitHub cannot be wrong.

CocoaPods:

pod 'Alamofire'

Alamofire/Alamofire
Alamofire - Elegant HTTP Networking in Swiftgithub.com

6. TextFieldEffects

Don’t you think that standard UITextField is a little boring? Me too — so say hello to TextFieldEffects! I won’t write too much, I’ll just show you a few examples what this library can do:

Yep, these are simple drop-in controllers. You can even make use from IBDesignables in storyboard!

CocoaPods:

 pod 'TextFieldEffects'

Carthage:

github "raulriera/TextFieldEffects"

raulriera/TextFieldEffects
TextFieldEffects - Custom UITextFields effects inspired by Codrops, built using Swiftgithub.com

5. Alamofire

Alamofire 是一个写在 Swift 上的十分美观的网络文库。你有使用过 AFNetwork 吗?Alamofire 就是它的姐妹版,但 Alamofire 更新颖,更有型,当然(AFNetwork 是写在 Objective-C 上的)。

是否还需要做一些网络的东西,例如下载,上传,获取 JSONs 等等呢?Alamofire 已经为你准备好了。GitHub 上 8000 人的选择肯定不会错。

CocoaPods:

pod 'Alamofire'

Alamofire/Alamofire
Alamofire - Swift中的优雅 HTTP 网络.github.com

6. TextFieldEffects

你是不是感觉标准的 UIT 文本域有点无聊?我也有这样的感觉——让我们来跟 TextFieldEffects 打个招呼吧! 我不会写太多,只是为你展示一些这个文库可以做到的事例:

是的,这些是简单的下拉插入键。你甚至可以利用脚本里的 IBDesignables!

CocoaPods:

pod 'TextFieldEffects'

Carthage:

github "raulriera/TextFieldEffects"

raulriera/TextFieldEffects
TextFieldEffects - 自定义 UITextFields 效果灵感来自 Codrops,使用 Swift 构建.github.com

7. GPUImage

Have you ever created a camera app? If not, you surely will after meeting this library.

GPUImage provides us a GPU-accelerated camera effects (both images and video) with blazing speed. There are hundreds of apps in the App Store that use this library — and one mine’s too:

GPUImage in use in one of my apps.

8869 stars on GitHub and still counting.

CocoaPods:

pod 'GPUImage'

BradLarson/GPUImage
GPUImage - An open source iOS framework for GPU-based image and video processinggithub.com

8. iRate

What’s the best way to get more reviews in the App Store? I don’t have hard data to answer that question, but if I had to guess, I would say that simple asking the user. Maybe it’s a little oldschool way to do this— most developers now create custom in-app alerts — but if you don’t have time or you don’t want to implement everything from scratch, it’s better to use iRate than not to. And this is iRate exactly — a small library that you include in your project and forget about asking users for review — iRate will do it for you, at proper time.

CocoaPods:

pod 'iRate'

nicklockwood/iRate
iRate - A handy class that prompts users of your iPhone or Mac App Store app to rate your application after using it…github.com

7. GPUImage

你是否有创建过相机APP的经历?如果没有,你一定会在不久之后遇到这个库的。

GPUImage为我们提供了由GPU加速的相机预览效果(包括图像和视频),速度极快。 在App Store有数百个APP已经使用这个库——我其中的一个也使用了:

我的一个使用GPUImage的APP。

8869 stars on GitHub and still counting.在GitHub上有8869颗星,并且还在不断增加中。

CocoaPods:

pod 'GPUImage'

BradLarson/GPUImage
GPUImage - An open source iOS framework for GPU-based image and video processinggithub.com
 (GPUImage:iOS上开源的基于GPU的图像视频处理框架)

8. iRate

在App Store中获得更多评论的最好方法是什么? 我没有实际数据来回答这个问题,但如果我不得不猜测的话,我会说直接去问用户。也许这么做是一个很老式的方式——大多数开发人员现在创建自定义的App提示窗——但如果你没有时间或你不想一切从头开始,最好是使用iRate而不是不用。iRate是这样的:一个你可以包含到你的工程中,并且不需要考虑要求用户评论的小型库——iRate将会在合适的时机自动完成这个。

CocoaPods:

pod 'iRate'

nicklockwood/iRate
iRate - A handy class that prompts users of your iPhone or Mac App Store app to rate your application after using it…github.com
 (iRate:一个便于使用的类库,可用于督促在iPhone、Mac应用商店下载并使用你的app用户给你推荐)

9. GameCenterManager

Love or hate singletons, but in this case managing Game Center is just easier with a little help of our best known anti-pattern (you have only one Game Center in your game, right?).

To be honest, vanilla-managing Game Center in iOS isn’t that hard, but with this library is just simple and fast. And better is the enemy of the good.

I’m using this in one of my games and it’s a pleasure experience.

CocoaPods:

pod 'GameCenterManager'

nihalahmed/GameCenterManager
GameCenterManager - iOS Game Center helper singletongithub.com

10. PKRevealController 2

This is a real gem here, one of my most favorited iOS control. PKRevealController is a slideable side menu (left, right or both), which slides with a help of your finger (or just by pressing the button, but it’s not as much cool as sliding).

I’ve tried a few other libraries providing this kind of control and PKRevealController is just the best. Very easy to setup, highly customizable and recognizes gestures very, very well. It could be included in iOS SDK as a standard control, really.

CocoaPods:

pod 'PKRevealController'

pkluz/PKRevealController
Introducing PKRevealController 2 - The second version of one of the most popular view controller containers for iOS…github.com

9. GameCenterManager

不管你喜欢或讨厌单例子,在这里通过我们最熟悉的 anti-pattern (反模式)管理 Game Center 都是一件非常简单的事(你的游戏里只有一个Game Center在,不是吗?)

老实说,vanilla-managing 在 iOS 中管理 Game Center 并不是很难,但是使用这个库就更加简单和快捷了。好上加好的体验。

我正在我的一个游戏项目中使用它,它带给我愉快的体验。

CocoaPods:

pod 'GameCenterManager'

nihalahmed/GameCenterManager
GameCenterManager - iOS 游戏中心助手singletongithub.com

10. PKRevealController 2

这个是我最喜欢的 iOS 控件之一,它就像一个宝石。PKRevealController 是一个侧滑的菜单(左,右,或者同时),滑向哪边是看你的使用习惯(或者仅仅通过一个按钮,但是这样看起来并没有像滑动那样的 Cool)。

关于类似功能,我尝试过不少其他的库,但是 PKRevealController 给我的感觉是最好的,非常简单的设置,高度的自定义,手势的识别非常好。这个真的可以被包括在 iOS 的 SDK 中,作为一个标准库。

CocoaPods:

pod 'PKRevealController'

pkluz/PKRevealController
Introducing PKRevealController 2 - 第二版本的 iOS 的最流行的视图控制器容器... github.com

11. SlackTextViewController

Have you ever used Slack iOS app? If you are working in a bigger software company, probably yes. For these people who haven’t — Slack rocks. And Slack’s iOS app too, especially for the great, custom text input control… which here you have — a code ready for use in your app!

Self growing text area? Check.Gestures recognizing, autocompletion, multimedia pasting? Check. Easy drop-in solution? Check. What else can you possibly need?

CocoaPods:

pod 'SlackTextViewController'

slackhq/SlackTextViewController
SlackTextViewController - A drop-in UIViewController subclass with a growing text input view and other useful messaging…github.com

12. RETableViewManager

RETableViewManager will help you with dynamically creating and managing your table views, everything in code. It deliver us predefined cells (for bools, texts, dates etc. — check screenshots below), but you can also create your custom views and use them along with the default ones.

All of this stuff you can do in storyboard without help of this library, but sometimes code is simply better than visual editor.

CocoaPods:

pod 'RETableViewManager'

romaonthego/RETableViewManager
RETableViewManager - Powerful data driven content manager for UITableView.github.com

11. SlackTextViewController

你使用过 Slack iOS 的 App 吗?如果你在一个大型的软件公司工作,可能答案是肯定的。但也有一些人尚未接触 Slack。 Slack 的 iOS App 非常强大,尤其是它的自定义文本输入控件...这里有一段代码,你可在 APP 中使用!

需要自动增长的文本区域?验证下。需要手势识别、自动完成、多媒体粘贴? 验证下。需要易于方案集成?验证下。你还可能需要什么其他功能呢?

CocoaPods:

pod 'SlackTextViewController'

slackhq/SlackTextViewController
SlackTextViewController - 一个插入UIViewController子类与不断增长的文本输入视图和其他有用的消息... github.com

12. RETableViewManager

RETableViewManager 将帮助您动态创建和管理表视图,自动生成控制代码。 它为我们提供了预定义的单元格(对于 bools,文本,日期等 - 请查看下面的屏幕截图),但你也可以创建自定义视图,并支持与默认的视图一起使用。

所有这些元素,你可以在不使用这个库的前提下在 storyboard 中实现。但有时简单的代码比可视化编辑器更好。

CocoaPods:

pod 'RETableViewManager'

romaonthego/RETableViewManager
RETableViewManager - 强大的数据驱动内容管理器UITableView.github.com

13. PermissionScope

Useful library to deliver better user experience by informing user about needed system permissions before asking user for them. Higher acceptance rate -> more users actively using the app -> better retention -> better stats -> more downloads. Highly recommended pod.

CocoaPods:

pod 'PermissionScope'

nickoneill/PermissionScope
PermissionScope - A Periscope-inspired way to ask for iOS permissionsgithub.com

14. SVProgressHUD

This image is loaded properly, don’t wait longer and don’t refresh the page. This is exactly how SVProgressHUD looks like in your app. If you need custom waiting indicator, here you have (the best probably) one.

CocoaPods:

pod 'SVProgressHUD'

TransitApp/SVProgressHUD
SVProgressHUD - A clean and lightweight progress HUD for your iOS app.github.com

13、权限作用域

该库通过在请求用户之前通知用户有关所需的系统权限,以提供更好的用户体验。更高的接受率->更多活跃用户使用 app->更佳反馈->更好状态->更多下载量。鼎力推荐的 pod。

CocoaPods:

pod 'PermissionScope'

nickoneill/PermissionScope
PermissionScope - 一个 Periscope-启发方式来自 iOS 权限.github.com

14、SVProgressHUD

这个图片展示的是正常下载,不用等到更长时间,也不用刷新页面。这就是 SVProgressHUD 在 app 中所呈现的。假如你需要自定义等待提示,这里有一个例子(可能是合适的)。

CocoaPods:

pod 'SVProgressHUD'

TransitApp/SVProgressHUD
SVProgressHUD - 为 iOS 应用程序提供一个干净、轻巧的进度 HUD.github.com

15. FontAwesomeKit

Font Awesome is awesome and with this library you can easily add the font to your project and use it in many ways.

CocoaPods:

pod 'FontAwesomeKit'

PrideChung/FontAwesomeKit
FontAwesomeKit - Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons.github.com

16. SnapKit

Love auto layout? You should!

At least when creating it in storyboards.

Creating constraints in code is painful without some help, but luckily SnapKit is here and with it on board you can code your constraints in easy, declarative way. Check it out.

CocoaPods:

pod 'SnapKit'

SnapKit/SnapKit
SnapKit - A Swift Autolayout DSL for iOS & OS Xgithub.com

15. FontAwesomeKit

Font Awesome 是非常优秀的,使用这个库可以简单地添加字体到你的项目当中,另外还有很多其它方面的功能。

CocoaPods:

pod 'FontAwesomeKit'

PrideChung/FontAwesomeKit

FontAwesomeKit - 适用于 iOS 的图标字体库。当前支持 Font-Awesome,Foundation icons,Zocial 和 ionicons。 github.com

16. SnapKit

喜欢自动布局(auto layout)?应该是!

至少在 storyboards 中创建的时候是这样的。

在没有帮助的情况下,在代码上创建约束是痛苦的,幸运地是用 SnapKit 你可以很方便地通过声明的方式,来约束你的代码。来看看吧。

CocoaPods:

pod 'SnapKit'

SnapKit/SnapKit
SnapKit - 一个为 iOS & OSX 系统的快速的自动布局 DSL github.com

17. MGSwipeTableCell

Another UI component, that is so often seen in many apps that Apple should probably think about including something similar in standard iOS SDK. Swipeable table cell, this is the best description of this pod. The best one.


These are just 3 animation types, there are more of them. Explore readme.

CocoaPods:

pod 'MGSwipeTableCell'

MortimerGoro/MGSwipeTableCell
MGSwipeTableCell - An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of…github.com

18. Quick

Unit testing in Swift, for Swift (ok, for Objective-C too), integrated with Xcode. If you are Objective-C fan, I would recommend Specta instead of this, but for Swift Quick will be probably the best shot.

CocoaPods:

pod 'Quick'

Quick/Quick
Quick - The Swift (and Objective-C) testing framework.github.com

17. MGSwipeTableCell

这是另一个在很多应用里经常看到的 UI 模块,Apple 也许应该考虑将之纳入标准的 iOS SDK 里。Swipeable table cell(可擦除式表格单元)——是关于这个产品最好的描述。最好的一个。

以上只是3种动画类型,还有更多动画lei'xin,请查阅Readme。

CocoaPods:

pod 'MGSwipeTableCell'

MortimerGoro/MGSwipeTableCell
MGSwipeTableCell - MGSwipeTableCell - 一个易用的UITableViewCell子类,允许显示可擦除式按钮,并提供各种...github.com

18. Quick

Swift 里的单元测试,适用于 Swift(好吧,Objective-C 也能用),已与 Xcode 集成。如果你是 Objective-C 粉,我更推荐 Specta,但是对于 Swift 来说,Quick 应该是最棒的选择。

CocoaPods:

pod 'Quick'

Quick/Quick
Quick -  Swift(及 Objective-C)的测试框架。github.com

返回顶部
顶部