Latest 2.3.0
Homepage https://github.com/BB9z/RFKit
License MIT
Platforms ios 6.0, osx 10.8, watchos 2.0, tvos 9.0, requires ARC
Authors

Build Status
Codecov
CocoaPods

English 简体中文 :cn:

RFKit is a useful toolkit for daily Cocoa development.

Requirements

RFKit Version Minimum Xcode Version Minimum iOS Target Minimum macOS Target Minimum watchOS Target Minimum tvOS Target
2.0+ Xcode 8 iOS 6 macOS 10.8 watchOS 2.0 tvOS 9.0
1.7 Xcode 7 iOS 6 macOS 10.8 watchOS 2.0 tvOS 9.0
1.6 Xcode 8 iOS 6 N/A watchOS 2.0 N/A

Install

CocoaPods

To install using CocoaPods, add the following to your project Podfile:

pod 'RFKit'

Specify develop branch to install the lastest version:

pod 'RFKit', :git => 'https://github.com/BB9z/RFKit.git', :branch => 'develop'

A more complex sample:

pod 'RFKit',
    :git => 'https://github.com/BB9z/RFKit.git',
    :branch => 'develop',
    :subspecs => ['Default', 'Category/NSDateFormatter']

Manual

You can always import RFKit by adding source code into your project. Just copy any files you needs.

dout

dout contains a set of convenient log toolcha, which was designed for debugging.

Features:

  • Out out format is better than NSLog(), and more faster.
  • Auto add expression before the results.

    e.g.:

    int a = 10;
    dout_int(101+a)  // Output: 101+a = 111
  • Optimized for multiple threads debugging, you can easily find the output come from which thread.
  • Support add position information in log output to help tracking location of log statements. Set DOUT_FALG_TRACE as 1 to active.
  • Special log methods for warning and error. Can change theirs behave to throw exception or assert fail.
  • Behavior can be highly customizable through the switch.
  • As macro, usually no performance loss.

Details: dout Document(in Chinese)

RFRuntime

Handle build or runtime differences. Provides an unified and simple interface for upper components. Contains:debugging switch define, default header file, RFARC and language extensions.

Debugging switch

RFDEBUG, RFKit debug mode switch. Set as 1 to active. If it´s not defined, will defined as 1 when DEBUG is true and NDEBUG not defined.

RFDebugLevel, controlling debugging behavior. If it´s not defined, will be defined as 2 if RFDEBUG is true, otherwise 1.

Default header file

UIKit and Foundation header is included in RFRuntime by default.

RFFeatureSupport

Defined some fake protocols for declaring a class support something or not.

RFDispatch

Some helper function for GCD.

Language extensions

Include some components from libextobjc:

  • metamacros.h, macros for metaprogramming.
  • EXTKeyPathCoding, allows compile-time verification of key paths.
  • EXTScope, several tools relative to scope.

@keypathClassInstance is similar with @keypath, but accept a class as parameter instead of a instance variable.

UIKit & Foundation Categories

Important part of RFKit. They contains many useful methods.

RFKitDefaultCategories.h defends which extension is imported by default.

See each header file to know the specific features.

RFGeometry

Add new methods and constants for geometry structures: CGPoint, CGSize, CGRect. Add an new CGAngle angle structure.

RFResizeAnchor and RFAlignmentAnchor provides a reference for resizing and aligning.

RFPerformance & doutkit

Performance toolkit.

Others

Some external components were placed under external folder.

Change log

Latest podspec

{
    "name": "RFKit",
    "version": "2.3.0",
    "summary": "Tool kit for daily cocoa development.",
    "homepage": "https://github.com/BB9z/RFKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "BB9z": "[email protected]"
    },
    "source": {
        "git": "https://github.com/BB9z/RFKit.git",
        "tag": "2.3.0"
    },
    "platforms": {
        "ios": "6.0",
        "osx": "10.8",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "exclude_files": "Test",
    "preserve_paths": "doc",
    "requires_arc": true,
    "pod_target_xcconfig": {},
    "default_subspecs": "Default",
    "subspecs": [
        {
            "name": "Default",
            "dependencies": {
                "RFKit/Runtime": [],
                "RFKit/RFGeometry": [],
                "RFKit/Category/Default": []
            },
            "source_files": [
                "RFKit.{h,m}",
                "RFKitDefaultCategories.h"
            ]
        },
        {
            "name": "ALL",
            "dependencies": {
                "RFKit/Default": [],
                "RFKit/Category/All": []
            },
            "ios": {
                "dependencies": {
                    "RFKit/Performance": [],
                    "RFKit/doutkit": []
                }
            },
            "osx": {
                "dependencies": {
                    "RFKit/Performance": [],
                    "RFKit/doutkit": []
                }
            },
            "tvos": {
                "dependencies": {
                    "RFKit/Performance": [],
                    "RFKit/doutkit": []
                }
            }
        },
        {
            "name": "Foundation",
            "source_files": "RFFoundation.*"
        },
        {
            "name": "Runtime",
            "dependencies": {
                "RFKit/Foundation": []
            },
            "source_files": [
                "dout.{h,m}",
                "RFRuntime.*",
                "RFARC.h",
                "RFDispatch.*",
                "RFFeatureSupport.h",
                "extobjc/*"
            ]
        },
        {
            "name": "RFGeometry",
            "dependencies": {
                "RFKit/Runtime": []
            },
            "source_files": "RFGeometry.{h,m}"
        },
        {
            "name": "Category",
            "subspecs": [
                {
                    "name": "Default",
                    "dependencies": {
                        "RFKit/Category/NSArray": [],
                        "RFKit/Category/NSBundle": [],
                        "RFKit/Category/NSDictionary": [],
                        "RFKit/Category/NSError": [],
                        "RFKit/Category/NSObject": [],
                        "RFKit/Category/NSString": []
                    },
                    "ios": {
                        "dependencies": {
                            "RFKit/Category/UIButton": [],
                            "RFKit/Category/UIColor": [],
                            "RFKit/Category/UIDevice": [],
                            "RFKit/Category/UIImage": [],
                            "RFKit/Category/UINavigationController": [],
                            "RFKit/Category/UIResponder": [],
                            "RFKit/Category/UIStoryboard": [],
                            "RFKit/Category/UITableView": [],
                            "RFKit/Category/UIView": [],
                            "RFKit/Category/UIView+RFAnimate": [],
                            "RFKit/Category/UIViewController": []
                        }
                    },
                    "tvos": {
                        "dependencies": {
                            "RFKit/Category/UIButton": [],
                            "RFKit/Category/UIColor": [],
                            "RFKit/Category/UIDevice": [],
                            "RFKit/Category/UIImage": [],
                            "RFKit/Category/UINavigationController": [],
                            "RFKit/Category/UIResponder": [],
                            "RFKit/Category/UIStoryboard": [],
                            "RFKit/Category/UITableView": [],
                            "RFKit/Category/UIView": [],
                            "RFKit/Category/UIView+RFAnimate": [],
                            "RFKit/Category/UIViewController": []
                        }
                    },
                    "watchos": {
                        "dependencies": {
                            "RFKit/Category/UIColor": [],
                            "RFKit/Category/UIImage": []
                        }
                    }
                },
                {
                    "name": "All",
                    "dependencies": {
                        "RFKit/Category/Default": [],
                        "RFKit/Category/NSDate": [],
                        "RFKit/Category/NSDateFormatter": [],
                        "RFKit/Category/NSFileManager": [],
                        "RFKit/Category/NSJSONSerialization": [],
                        "RFKit/Category/NSNumberFormatter": [],
                        "RFKit/Category/NSURL": []
                    },
                    "ios": {
                        "dependencies": {
                            "RFKit/Category/UIAlertView": [],
                            "RFKit/Category/NSLayoutConstraint": [],
                            "RFKit/Category/UIPickerView": [],
                            "RFKit/Category/UIScrollView+RFScrolling": [],
                            "RFKit/Category/UISearchBar": [],
                            "RFKit/Category/UIViewController+RFInterfaceOrientation": [],
                            "RFKit/Category/UIWebView": []
                        }
                    },
                    "tvos": {
                        "dependencies": {
                            "RFKit/Category/NSLayoutConstraint": [],
                            "RFKit/Category/UIScrollView+RFScrolling": [],
                            "RFKit/Category/UISearchBar": [],
                            "RFKit/Category/UIViewController+RFInterfaceOrientation": []
                        }
                    }
                },
                {
                    "name": "NSArray",
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/Foundation/NSArray+*"
                },
                {
                    "name": "NSBundle",
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/Foundation/NSBundle+*"
                },
                {
                    "name": "NSDate",
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/Foundation/NSDate+*"
                },
                {
                    "name": "NSDateFormatter",
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/Foundation/NSDateFormatter+*"
                },
                {
                    "name": "NSDictionary",
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Category/NSObject": []
                    },
                    "source_files": "category/Foundation/NSDictionary+*"
                },
                {
                    "name": "NSError",
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/Foundation/NSError+*"
                },
                {
                    "name": "NSFileManager",
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/Foundation/NSFileManager+*"
                },
                {
                    "name": "NSJSONSerialization",
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/Foundation/NSJSONSerialization+*"
                },
                {
                    "name": "NSNumberFormatter",
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/Foundation/NSNumberFormatter+*"
                },
                {
                    "name": "NSObject",
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/Foundation/NSObject+*"
                },
                {
                    "name": "NSString",
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/Foundation/NSString+*"
                },
                {
                    "name": "NSURL",
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/Foundation/NSURL+*"
                },
                {
                    "name": "NSLayoutConstraint",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Category/UIView": []
                    },
                    "source_files": "category/UIKit/NSLayoutConstraint+*"
                },
                {
                    "name": "UIAlertView",
                    "platforms": {
                        "ios": "2.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIAlertView+*"
                },
                {
                    "name": "UIButton",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIButton+*"
                },
                {
                    "name": "UIColor",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0",
                        "watchos": "2.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIColor+*"
                },
                {
                    "name": "UIDevice",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/UIKit/UIDevice+*"
                },
                {
                    "name": "UIImage",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0",
                        "watchos": "2.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/RFGeometry": []
                    },
                    "source_files": "category/UIKit/UIImage+*"
                },
                {
                    "name": "UINavigationController",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Category/NSArray": []
                    },
                    "source_files": "category/UIKit/UINavigationController+*"
                },
                {
                    "name": "UIPickerView",
                    "platforms": {
                        "ios": "6.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIPickerView+*"
                },
                {
                    "name": "UIResponder",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIResponder+*"
                },
                {
                    "name": "UIScrollView+RFScrolling",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIScrollView+RFScrolling*"
                },
                {
                    "name": "UISearchBar",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UISearchBar+*"
                },
                {
                    "name": "UIStoryboard",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIStoryboard+*"
                },
                {
                    "name": "UITableView",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Category/UIView+RFAnimate": []
                    },
                    "source_files": "category/UIKit/UITableView+*"
                },
                {
                    "name": "UIView+RFAnimate",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/Runtime": []
                    },
                    "source_files": "category/UIKit/UIView+RFAnimate*"
                },
                {
                    "name": "UIView",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": [],
                        "RFKit/RFGeometry": [],
                        "RFKit/Category/UIResponder": []
                    },
                    "frameworks": "QuartzCore",
                    "source_files": "category/UIKit/UIView+RFKit*"
                },
                {
                    "name": "UIViewController",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIViewController+RFKit*"
                },
                {
                    "name": "UIViewController+RFInterfaceOrientation",
                    "platforms": {
                        "ios": "6.0",
                        "tvos": "9.0"
                    },
                    "source_files": "category/UIKit/UIViewController+RFInterfaceOrientation*"
                },
                {
                    "name": "UIWebView",
                    "platforms": {
                        "ios": "6.0"
                    },
                    "dependencies": {
                        "RFKit/Foundation": []
                    },
                    "source_files": "category/UIKit/UIWebView+*"
                }
            ]
        },
        {
            "name": "Performance",
            "dependencies": {
                "RFKit/Runtime": []
            },
            "source_files": "RFPerformance.{h,m}"
        },
        {
            "name": "doutkit",
            "platforms": {
                "ios": "6.0",
                "osx": "10.8",
                "tvos": "9.0"
            },
            "dependencies": {
                "RFKit/Runtime": [],
                "RFKit/Performance": []
            },
            "source_files": "doutkit/*.{h,m}"
        }
    ]
}

Pin It on Pinterest

Share This