Latest 1.0.1
License MIT
Platforms ios 7.0, requires ARC

CI Status



YJKit is a useful Cocoa Touch library extension. Here is the menu list.

  • Foundation extension
    • Runtime extension
      • Method swizzling, associated identifier/tag, isClass checking, isTaggedPointer checking, isMutable checking
      • isWeakDelegateByDefault/isWeakDataSourceByDefault for checking whether is weak as property attribute for delegate or dataSource (as opposed to assign)
      • Using IMP insertion for doing extra work by calling original method. This is being used for: 1. safe kvo dealloc; 2. calling safe isEqual: method.
    • YJSafeKVO
      • Provide safe and simple API for Key value observing.
      • Provide subscribing feature and support both single and multiple key path binding.
      • Click here for more information.
    • YJCollection/YJSequence
      • Add collection extension: map, filter, reduce, flat…
      • Add sequence extension: dropFirst, dropLast, prefix, suffix…
    • Others
      • NSBundle extension API, NSTime with block supports.
  • UIKit extension
    • UIScreen with device screen adaptation (YJScreenDisplayResolution, YJScreenDisplayAspectRatio)
      • [UIScreen mainScreen].displayResolution
      • [UIScreen mainScreen].displayAspectRatio
    • YJGrid… spring & structs on UIView category
    • UIImage extension: bundle loading and image resizing.
    • UIImageView extension: yj_contentMode property, which provide combined image display options that UIViewContentMode doesn’t have:
      • imageView.yj_contentMode = YJViewContentModeAspectFit | YJViewContentModeTop;
    • UIColor extension:
      • Support hexadecimal value for UIColor generation
      • Provide RGBColor as light weight c struct for storing color component values, which support NSValue and boxable wrapping.
    • UIKit block API is supported for:
      • UIControl
      • UIAlertView
      • UIGestureRecognizer
      • UIAlertSheet
      • UIBarButtonItem
    • UITextView, UITextField’s autoResignFirstResponder property.
      • UITextView also support placeholder property.
    • YJMaskFamily – CALayer based rounded corner family.
      • Support IBDesignable and IBInspectable.
      • High performance without layer blended color and offscreen rendering.
      • Customized subclasses: YJRoundedCornerView, YJRoundedCornerImageView, YJCircularImageView, YJRoundedCornerButton, YJRoundedCornerLabel, YJSemicircularCornerButton, YJSemicircularCornerLabel
  • CoreGraphics extension
    • NSValue+CGFloat
    • CGGeometry extension with CGSize and CGRect
      • CGSizeScaleToSize()
      • CGRectPositionToRect()
      • CGRectPositioned()
      • See more information on demo app.
  • Other extensions
    • Macros:
      • execute_once(), perform_once()…
      • Make assign attributed property delegate or dataSource performs like weak.
    • YJTuple:
      • Support macro initializing.
      • Subclassing recommended.
    • YJGroupedStyleTableViewController
      • Using less code to build group styled tableView with lots of detail customization.
      • The default style is iOS setting app style.
      • Click here for more snapshots.
    • YJPhotoLibrary: Save image to iOS photo album.


  • It requires Xcode 7.3+ for NS_SWIFT_NAME avaliable, so it can expose APIs for swift and feels more swifty.
  • It requires Cocoapods. Add use_frameworks! for Podfile to avoid compiler error by defining IB_DESIGNABLE in cocoapods project
platform :ios, '7.0'
pod 'YJKit'


huang-kun, [email protected]


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

Latest podspec

    "name": "YJKit",
    "version": "1.0.1",
    "license": "MIT",
    "summary": "A useful extension for iOS library.",
    "homepage": "",
    "authors": {
        "huang-kun": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.1"
    "platforms": {
        "ios": "7.0"
    "requires_arc": true,
    "source_files": "YJKit/**/*",
    "public_header_files": "YJKit/**/*.h"

Pin It on Pinterest

Share This