Objective-C相关Category的收集

来源:互联网 发布:极光数据恢复软件官网 编辑:程序博客网 时间:2024/06/05 10:32

What?

User-driven collection of Cocoa categories. Categories is a way to add functionality to classes that you do not have the source code to.

Apple Documentation: Customizing Existing Classes

Why?

Since I first read about objective-c categories I have, with every new project, increased my usage of this wonderful feature. I wanted more, but good categories were not that easy to find. So I decided to create this site with a vision to gather all the best categories that people create in one place and to help others find them as well.

How?

Use them as you like and feel free to add your own, or anyone elses categories (if they dont mind) to the collection. The main purpose of this site is to spread the knowledge of categories and to create a single place to find the best ones. In future versions you will probably find more advanced filtering, tags and so on but I will take this as the need arises.

Want to get updated? Subscribe to the RSS feed.

Who?

I am Fille Åström, co-founder and developer @ IMGNRY.

Help?

I appreciate all the feedback I can get, and I am very eager to improve this idea in any way possible. If you have anything to say, may it be complaints, suggestions or just nice words, do not hesitate to send me an email on fille@imgnry.com or message @bobmoff on Twitter or App.net


  • UIImageView+FaceAwareFill

    This category applies Aspect Fill content mode to an image and if faces are detected it centers them instead of centering the image just by its geometrical center.

  • NSRegularEx+ObjCRegex

    NSRegularExpression categories that simplify regular expressions in Objective-C

  • UIScrollView+Extensions

    A category on UIScrollView for detecting when content has scrolled to top or bottom.

  • NSObject+AutoCoding

    Provides automatic support for NSCoding and NSCopying

  • NSInvocation+SimpleCreation

    Create invocations the simple way.

  • NSRegularExpression+Concise

    Categories on NSRegularExpression that make regular expressions more concise in Objective-C

  • NSString+SHPersian

    Enables Persian fonts rendering.

  • UILabel+ContentSize

    Calculate the size of the content inside a UILabel

  • UIViewController+Swizzled

    Logs the UIViewController hierarchy including the name of the view controller you are in, plus a representation of how deep you are.

  • NSObject+Association

    Ever dreamed of adding "userInfo" to an UIAlertView? Now you can! This category allows you to assign any object to any object from iOS 3.1 and Mac OS 10.6 and up.

  • NSHTTPCookieStorage+FreezeDry

    Persist UIWebView cookies between app restarts. See GitHub note!

  • UIDevice+Hardware

    Detect hardware version of device

  • NSObject+LogDealloc

    Logs when dealloc is called on the object

  • NSObject+SFObservers

    Expanding both NSNotificationCenter and KVO to provide auto removal of observers

  • UIApplication+NetworkActivity

    UIApplication+NetworkActivity keeps track of how many network operations you currently have and manages the NetworkActivityIndicator for you.

  • UIView+Recursion

    Find a subview recursively

  • UIView+RoundedCorners

    Add rounded corners to any view using layer mask.

  • UIView+Stacker

    Stack subviews vertically ordered by their index. Good when u want to use XIB's and need to layout views (show/hide) based on external data, but cannot use autolayout.

  • NSString+PDRegex

    Simplifying use of Regular Expressions

  • MKMapView+MoveLogo

    This category allows you to move the MKMapView logo so that it remains visible if you put other stuff on the mapview. If the logo is hidden, the app won't pass the App Store review. Tested with iOS 5 through 7.

  • NSDate+Escort

    A NSDate utility library that is compatible with NSDate-Extensions API

  • UILabel+DynamicSizeMe

    Adjust UILabel to change it's frame according to it's content

  • UIView+Toast

    Android-style toast notifications to iOS.

  • UIImage+NYXImagesKit

    A set of efficient categories for UIImage class. It allows filtering, resizing, masking, rotating, enhancing... and more

  • UIViewController+MJPopup

    A UIViewController Category to display a ViewController as a popup with different transition effects

  • UIImage+MGImageUtilities

    Proportional Fill & Tinting

  • MultipleObjects+DTFoundation

    DTFoundation is a collection of utility methods and category extensions that Cocoanetics is standardizing on. This should evolve into a toolset of well-documented and -tested code to accelerate future development.

  • UIImageView+WebCache

    Asynchronous image downloader with cache support

  • UIColor+Colours

    Adds 100 predefined colors, some color helper methods and can generate color schemes

  • UIImage+PDFColoredImage

    Converts a black PDF image into a UIImage of any size, in any color

  • NSData+AsyncCacher

    NSData category for async loading data from url and calling block. Requested data is cached with NSCache and can be requested multiple times simultaneously.

  • NSDate+Helper

    A category to extend Cocoa's NSDate class with some convenience functions.

  • MultipleObjects+ObjectiveSugar

    ObjectiveC additions for humans. Ruby style.

  • MKMapView+ZoomLevel

    Setting zoom level in a MapView

  • NSObject+MKBlockAdditions

    Block based Category additions for AlertView and ActionSheets

  • NSString+Extensions

    A utility box for NSStrings. Converts to: SHA1, NSNumber. Test for being empty. Contains substrings and replace substrings from NSDictionary.

  • UIView+Utils

    ViewUtils is a collection of category methods designed that extend UIView with all the handy little properties and functionality that you always wished were built-in to begin with.

  • NSDate+TimeAgo

    A "time ago", "time since", "relative date", or "fuzzy date" category for NSDate and iOS, Objective-C, Cocoa Touch, iPhone, iPad

  • NSString+FontAwesome

    Enables FontAwesome for iOS

  • NSArray+FirstObject

    Gets the first object in an array or returns nil for empty array.

  • CCNode+GestureRecognizers

    GestureRecognizers support for cocos2d, just include category and you are ready to use gesture recognizers. Works with both 2.x and 1.x cocos2d.

  • NSObject+AutoDescription

    Enables easy and descriptive logging for any class (derived from NSObject)

  • CGRect+Additions

    Some functions for dealing with CGRects

  • UIView+ModifyFrame

    Makes modifying the view frame NOT hellish

  • NSObject+Swizzle

    Monkey-Patching iOS with Objective-C Categories Part III: Swizzling

  • NSString+UsefulShit

    Objective-C category demonstration

  • 参考阅读:
    苹果官方文档:Customizing Existing Classes  
     
    UIImageView+FaceAwareFill   
    这个类别使用了Aspect Fill内容模式,可以自动根据图像内容进行调整,当检测到人脸时,它会以脸部中心替代掉以图片的几何中心。
    测试环境:Xcode 5.0,iOS 6.0以上

     
    NSRegularEx+ObjCRegex  
    Objective-C-RegEx-Categories是NSRegularExpression的一个延展,它可以把Object-C中的很多正则表达式合并成一个,简化了代码。
    这个库没有任何依赖性,适用于iOS 4+和OS X 10.7+。

     
    NSObject+AutoCoding  
    AutoCoding是一个NSObject的类目,提供了对NSCoding 和NSCopying的自动支持。
    兼容ARC和non-ARC编译目标
    支持iOS 7.0/Mac OS 10.9 (Xcode 5.0, Apple LLVM compiler 5.0)
     
    NSInvocation+SimpleCreation  
    创建invocations的简单方法
     
    NSString+SHPersian  
    SHPersian是一个针对使用波斯语和阿拉伯语的iOS开发者提供的工具,包含了一个在Persian iOS app中为文本添加自定义外观的必需的类。

     
    UILabel+ContentSize  
    在UILabel内计算内容的大小。
     
    UIViewController+Swizzled      
    记录UIViewController层次:包括你在视图控制器的名字,还有你进入层次的展示。
     
    NSObject+Association    
    你是不是一直希望将"userInfo"显示到UIAlertView上呢?通过Association这个category可以将任意的对象赋值给其它任意对象(从iOS3.1和mac os 10.6到最新的系统版本。)

     
     
    NSHTTPCookieStorage+FreezeDry  
    app重启时,清除UIWebView cookies。
     
    UIDevice+Hardware  
    检测硬件设备的版本。
     
    NSObject+LogDealloc   
    是一个NSObject category,对于内存泄露的跟踪非常有用
     
    NSObject+SFObservers  
    是对NSNotificationCenter and KVO的一个扩展,它能够自动移除观察者。
     
    UIApplication+NetworkActivity  
    UIApplication+NetworkActivity跟踪你最近进行过的网络操作,并管理NetworkActivityIndicator。
     
    UIView+Recursion
    以递归的方式遍历(查找)subview
     
    UIView+RoundedCorners  
    使用图层蒙版为视图添加圆角
     
    UIView+Stacker  
    Stack subviews是按照索引进行垂直排序的。主要用于——使用xib时,以及需要进行view布局时(显示/隐藏)——当基于外部数据。不过不能用于autolayout。.
     
    NSString+PDRegex   
    简化正则表达式的使用
     
    MKMapView+MoveLogo   
    这个类目允许你移动MKMapView logo,即使你放其他东西在mapview上它仍能保持可见。如果隐藏了logo,那将不能通过App Store审核。已经在iOS 5-iOS 7上进行了测试。
     
    NSDate+Escort  
    NSDate-Escort是一个NSDate实用库,兼容NSDate-Extensions API
     
    UILabel+DynamicSizeMe  
    调整UILabel来根据内容改变其框架
     
    UIView+Toast  
    适用于iOS上的Android风格toas通知。
     
    UIImage+NYXImagesKit  
    NYXImagesKit是一个重组了多个有用的UIImage categories的iOS项目,可对图像/图片进行多个处理,比如筛选、模糊、优化、蒙版、调整大小、旋转以及保存等等。同时还提供了一个UIImageView子类从URL异步加载图片,并在下载完毕时展示图片。
     
    UIViewController+MJPopup  
    MJPopupViewController是一个 UIViewController Category,用于使用不同的过渡效果来把ViewController作为弹出视图进行展示。
     
    UIImage+MGImageUtilities  
    MGImageUtilities展示两个UIImage category:UIImage+ProportionalFill和UIImage+Tint。你可以通过UIImage+ProportionalFill调整任意图片的尺寸,可以使用UIImage+Tint来为图片着色。
     
    MultipleObjects+DTFoundation 
    DTFoundation集合了实用方法和category的扩展,逐渐演变成一个文档齐全的工具集,记录和测试代码以加快开发。
     
    UIImageView+WebCache  
    SDWebImage提供一个UIImageView类别,以支持加载管理源自网络的远程图片。具有异步加载、缓存管理、同一个URL下载次数控制和优化等特征。简单易用。
     
    UIColor+Colours  
    100组漂亮的预制的色彩和配色方案可以让你的iOS/OS X开发更轻松。

    UIImage+PDFColoredImage  
    UIImage-PDFColoredImage是一个UIImage扩展,可以把黑色的PDF image转换成任意尺寸任意颜色的UIImage,只需一行代码,简单易用。
     
    NSData+AsyncCacher  
    NSData-AsyncCacher是NSData的一个category,用于从url和block中异步加载数据。请求数据使用NSCache缓存,可以多次请求。
     
    NSDate+Helper  
    通过一些便捷函数扩展了Cocoa的NSDate
     
    MultipleObjects+ObjectiveSugar  
    Objective-C additions for humans. Ruby style.
     
    MKMapView+ZoomLevel 
    在MapView中设置缩放比例。
     
    NSString+Extensions  
    一个针对NSStrings的category,它能将string转换为SHA1,NSNumber。检测string是否为空、是否包含某个子字符串,以及替换掉NSDictionary中的子字符串。
     
    UIView+Utils  
    ViewUtils是一个category methods的集合,这些方法是UIView的扩展,包含了许多方便的属性和方法,其中许多都是我们希望苹果内置的。
     
    NSDate+TimeAgo   
    让NSDate报告时间,比如"A moment ago", "30 seconds ago", "5 minutes ago", "Yesterday", "Last month", "2 years ago"以及其他。
     
    NSString+FontAwesome  
    FontAwesome+iOS是一个开源形象字体库,通过扩展 NSString 让你在app中轻松使用 FontAwesome 字体。
    官方网站:http://fortawesome.github.io/Font-Awesome/

     
    NSArray+FirstObject 
    从数组中获得第一个对象,或者从空数组中返回零
     
    NSObject+AutoDescription  
    能够简单地为任何类描述日志(从 NSObject派生出来)
     
    CGRect+Additions  
    处理CGRects的一些函数。
     
    UIView+ModifyFrame  
    简单实用的UIView类目使修改框架不那么变态。
     
    NSString+UsefulShit  
    Objective-C category 示范

  • 源地址:http://cocoacats.com/   http://www.cocoachina.com/applenews/devnews/2014/0212/7808.html

0 0
原创粉丝点击