0

Objective-C UIControl Category Inspired By JQuery Adding Many Blocks-Based Events

-

Previously I mentioned a great library providing a large number of block utilities called BlocksKit enhancing many classes within the iOS SDK to utilize blocks.

Here’s a library from Mysterious Trousers called MTControl inspired by JQuery providing an add-on library for many UIControl based objects that allows you to handle events using blocks.

Here’s an example from the readme using the MTControl enhanced UIButton:

  1. UIButton *button = [UIButton buttonWithType:UIButtonTypeContactAdd];
  2.  
  3. <a href='#' class='small-button smallblue'><span></span></a>;
  4. [_model fetchFromServer:@"http://mysterioustrousers.com" success:^(BOOL success){
  5. [_spinner stop];
  6. }];
  7. }];
UIButton *button = [UIButton buttonWithType:UIButtonTypeContactAdd];

<a href='#' class='small-button smallblue'><span></span></a>;
[_model fetchFromServer:@"http://mysterioustrousers.com" success:^(BOOL success){
[_spinner stop];
}];
}];

Another example showing MTControl working with A UITextField:

  1. UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 300, 40)];
  2.  
  3. [textField editingDidBegin:^(UIEvent *event) {
  4. textField.text = @"";
  5. }];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 300, 40)];

[textField editingDidBegin:^(UIEvent *event) {
textField.text = @"";
}];

And here’s a listing of the events provided by MTControl:

  1. touchDown
  2. touchDownRepeat
  3. touchDragInside
  4. touchDragOutside
  5. touchDragEnter
  6. touchDragExit
  7. touchUpInside
  8. touchUpOutside
  9. touchCancel
  10. valueChanged
  11. editingDidBegin
  12. editingChanged
  13. editingDidEnd
  14. editingDidEndOnExit
  15. allTouchEvents
  16. allEditingEvents
touchDown
touchDownRepeat
touchDragInside
touchDragOutside
touchDragEnter
touchDragExit
touchUpInside
touchUpOutside
touchCancel
valueChanged
editingDidBegin
editingChanged
editingDidEnd
editingDidEndOnExit
allTouchEvents
allEditingEvents

You can find MTControlBlocks on Github here.

Blocks can definitely make things much easier.

0

JASidePanels for iOS

-
Full

UIViewController container designed for presenting a center panel with revealable side panels - one to the left and one to the right.

GitHub

1

iOS UI Control For Making Great Looking Progress Indicators, Alert Views, And More

-

Some time ago I mentioned a great library for creating customizable progress indicators called MBProgressHud.

Here’s a user interface control that explains on the HUD concept allowing you to create great looking progress indicators, but also informative modal views, and alert view like pop-ups.

The control uses a block based syntax has great looking animations and images, and an extensive example is included.

Here’s a series of images from the readme showing the control in action:

MBAlertView

You can find MBAlertView on Github here.

A nice easy to use UI control for making great looking alerts, and indicators.

0

BTBreadcrumbView for iOS

-

A breadcrumb control for iOS. Features:

  • Simple API
  • Animated transition

GitHub

0

RichContentLabel for iOS

-
Full

It's a small browser render engine for browser, using Core-Text without leverage the UIWebView.

  • It has its own smart HTML parser, who can handle all invalid cases, such as unclosed tags and overlapping tags.
  • Fully supports image layout as well as text formatted layout.
  • Useful callback function for link tapping event and image tapping event.

GitHub

 

« 1 2 3 4 5 6 7 8 9 10 11 12 ... 44 »