Latest 0.1.0
Homepage https://github.com/tadeuzagallo/TZShortKit
License MIT
Platforms ios 5.0, requires ARC
Authors

Small library with a few helpers that I use daily to save up some code.

example:

instead of:

CGRect frame = view.frame;
frame.size.width -= 20;
view.frame = frame;

you can write:

view.frame.width -= 20;

Categories provided

  • UIImage.width and UIImage.height
  • UIView:
    • CGFloat x
    • CGFloat y
    • CGFloat width
    • CGFloat height
    • CGFloat boundsX
    • CGFloat boundsY
    • CGFloat boundsWidth
    • CGFloat boundsHeight
    • CGPoint origin
    • CGPoint boundsOrigin
    • CGSize size
    • CGSize boundsSize
  • UIButton
    • UIImage *image
    • UIImage *backgroundImage
    • UIImage *selectedImage
    • UIImage *selectedBackgroundImage
    • NSString *title
    • NSString *selectedTitle

Other helpers:

  • Device helpers

    BOOL IsRetinaScreen();
    BOOL IsRetina4Screen();
    CGFloat iOSVersion();
    BOOL iOSVersionIsAtLeast(CGFloat version);
    BOOL iOSVersionIsAtMost(CGFloat version);
    BOOL iOSVersionIsGreatherThan(CGFloat version);
    BOOL iOSVersionIsLessThan(CGFloat version);
  • Notification helpers (I tried to make notifications as easy and flexible as possible, so there are a lot of optional parameters)

    On(NSString *event[, id object], NotificationBlock block);
    On(NSString *event[, id object], id target, NSString *selectorName);
    Off(NSString *event[, NotificationBlock block]);
    Off(NSString *event[, id target, NSString *selectorName]);
    Trigger([id sender,] NSString *event [, NSDictionary *userInfo]);
    • Clarifying notification parameters:
      The second On method could be originally written as:
    [[NSNotificationCenter defaultCenter] addObserver:target
                                        selector:NSSelectorFromString(selectorName)
                                        name:event
                                        object:object];

    Alternatively you may substitute the target and selector for a block…

Latest podspec

{
    "name": "TZShortKit",
    "version": "0.1.0",
    "summary": "iOS library of shortcuts for long properties",
    "description": "                    ObjC library of shortcuts for long propertiesn                    TZShortKit shortens things as `self.view.frame.size.width` -> `self.view.width`n",
    "homepage": "https://github.com/tadeuzagallo/TZShortKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Tadeu Zagallo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/tadeuzagallo/TZShortKit.git",
        "tag": "v0.1.0"
    },
    "platforms": {
        "ios": "5.0"
    },
    "requires_arc": true,
    "source_files": "TZShortKit/**/*.{h,m}"
}

Pin It on Pinterest

Share This