Git Product home page Git Product logo

hkhelperkit's Introduction

HKHelperKit

HKHelperKit fixes some annoyances when developing Objective-C applications. Mostly it just adds some methods to SDK classes to make them easier and less verbose to use.

Usage

  1. Clone this repository into a HKHelperKit subfolder within your project.
  2. Drag the HKHelperKit folder into XCode.
  3. Now simply use #include "HKHelperKit.h" anywhere that you want to use HKHelperKit methods.

Features

HKHelperKit enhances the following classes in the following ways:

NSString

  • [NSString stringFromResource:@"MyFile.html"]; loads an app resource from teh main bundle with teh provided file name into an autoreleased string.
  • Simple search methods
    • [@"foobar" conatinsString:@"oob"];
    • [@"foobar" startsWithString:@"foo"];
    • [@"foobar" endsWithString:@"bar"];
  • [someString isPresent]; method that is shorthand for: string != nil && ![string isEqualToString:@""];.
  • [@"foobar" compareCaseInsensitive:@"FooBAR"];
  • NSData conversion
    • [NSString stingWithData:someNSDataObject];
    • [NSString stingWithData:someNSDataObject encoding:NSASCIIStringEncoding];
    • [@"foobar" data]
  • [@"foo/space here" stringByEscapingURL] => @"foo%2Fspace%20here"
  • [@"foo/space here" stringByPercentEscapingCharacters:@" "] => @"foo/space%20here"

UIAlertView

  • [UIAlertView showSimpleAlertWithTitle:@"A Title" message:@"A Message!"]; Shows an alert with an OK button
  • [UIAlertView showSimpleAlertWithTitle:@"A Title" message:@"A Message!" buttonTitle:@"Not OK"]; Shows an alert with a single custom button title

UIBarButtonItem

  • Convenience Initializers
    • [UIBarButtonItem itemWithSystemType:UIBarButtonSystemItemAdd];
    • [UIBarButtonItem itemWithSystemType:UIBarButtonSystemItemAdd target:object action:@selector(someSelector)];
    • [UIBarButtonItem itemWithTitle:@"foobar" target:object action:@selector(someSelector)];
    • [UIBarButtonItem itemWithImage:someUIImage target:object action:@selector(someSelector)];
    • [UIBarButtonItem flexibleSpace];
    • [UIBarButtonItem fixedSpace:123];

UIImage

  • Added NSCoding support to UIImage
  • [someImage imageByResizing:CGSizeMake(123, 456)];

UINavigationController

  • navigationController.backViewController read only property that works just like topViewController except it return the controller immediately preceding the top one (or nil).

UIViewController

  • Convenience Initializers
    • [UIViewController controller];
    • [UIViewController controllerWithNib]; This loads the nib with the same name as the view controller class. [MyController controllerWithNib] is the same as [[[MyController alloc] initWithNibName:@"MyController" bundle:nil] autorelease]
    • [UIViewController controllerWithNibName:@"SomeNibName"];
    • [UIViewController controllerWithNibName:@"SomeNibName" bundle:someBundle];
    • [[UIViewController alloc] initWithNibName:@"SomeNibName"];
    • [[UIViewController alloc] initWithNib]; instance level initializer that works as described in the controllerWithNib class method.

hkhelperkit's People

Contributors

alexjwayne avatar

Stargazers

Dmitry Seredinov avatar Prof Syd Xu avatar

Watchers

Prof Syd Xu avatar James Cloos avatar

Forkers

ycaihua

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.