Showing posts with label Code IOS. Show all posts
Showing posts with label Code IOS. Show all posts

Thursday, February 27, 2014

Seven Switch

iOS7 style drop in replacement for UISwitch
Animation
Default

Donate Bitcoin

If you're using SevenSwitch in an app or for some other reason consider throwing me some coin.
1GuFb1y7xEmKiD6XD3tGEJBriYJ2hXp8zY

Usage

To use it, add SevenSwitch.h and SevenSwitch.m files to your project and add the QuartzCore framework to your project.
Initializing and adding the switch to the screen
SevenSwitch *mySwitch = [[SevenSwitch alloc] initWithFrame:CGRectMake(10, 10, 50, 30)];
[self.view addSubview:mySwitch];
When the user manipulates the switch control ("flips" it) a UIControlEventValueChanged event is generated.
[mySwitch addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEventValueChanged];
You can set images for the on/off states
mySwitch.offImage = [UIImage imageNamed:@"cross.png"];
mySwitch.onImage = [UIImage imageNamed:@"check.png"];
You can also customize the switches colors
mySwitch.thumbTintColor = [UIColor colorWithRed:0.19f green:0.23f blue:0.33f alpha:1.00f];
mySwitch.activeColor = [UIColor colorWithRed:0.07f green:0.09f blue:0.11f alpha:1.00f];
mySwitch.inactiveColor = [UIColor colorWithRed:0.07f green:0.09f blue:0.11f alpha:1.00f];
mySwitch.onTintColor = [UIColor colorWithRed:0.45f green:0.58f blue:0.67f alpha:1.00f];
mySwitch.borderColor = [UIColor clearColor];
mySwitch.shadowColor = [UIColor blackColor];
You can resize the switch frame to whatever you like to make fatter/skinnier controls
mySwitch.frame = CGRectMake(0, 0, 100, 50);
You can turn off the rounded look by setting the isRounded property to NO
mySwitch.isRounded = NO;

Requirements

SevenSwitch requires iOS 5.0 and above.

Download: https://github.com/bvogelzang/SevenSwitch/archive/master.zip

Sunday, February 23, 2014

JD Status Bar Notification

Show messages on top of the status bar. Customizable colors, font and animation. Supports progress display and can show an activity indicator. iOS 7 ready. iOS6 support. Please open a Github issue, if you think anything is missing or wrong.
Animation
Screenshots

Installation

Cocoapods:

pod 'JDStatusBarNotification'
(For infos on cocoapods, have a look at the cocoapods website)

Manually:

  1. Drag the JDStatusBarNotification/JDStatusBarNotification folder into your project.
  2. Add #include "JDStatusBarNotification.h", where you want to use it

Usage

JDStatusBarNotification is a singleton. You don't need to initialize it anywhere. Just use the following class methods:

Showing a notification

+ (JDStatusBarView*)showWithStatus:(NSString *)status;
+ (JDStatusBarView*)showWithStatus:(NSString *)status
                      dismissAfter:(NSTimeInterval)timeInterval;
The return value will be the notification view. You can just ignore it, but if you need further customization, this is where you can access the view.

Dismissing a notification

+ (void)dismiss;
+ (void)dismissAfter:(NSTimeInterval)delay;

Showing progress

Progress animation
+ (void)showProgress:(CGFloat)progress;  // Range: 0.0 - 1.0

Showing activity

Activity screenshot
+ (void)showActivityIndicator:(BOOL)show
               indicatorStyle:(UIActivityIndicatorViewStyle)style;

Showing a notification with alternative styles

Included styles:

Use them with the following methods:
+ (JDStatusBarView*)showWithStatus:(NSString *)status
                         styleName:(NSString*)styleName;

+ (JDStatusBarView*)showWithStatus:(NSString *)status
                      dismissAfter:(NSTimeInterval)timeInterval
                         styleName:(NSString*)styleName;
To present a notification using a custom style, use the identifier you specified in addStyleNamed:prepare:. See Customization below.

Beware

@goelv informed me, that his app got rejected because of a status bar overlay (for violating 10.1/10.3). So don't overuse it. Although this is the first case I heard of. I even shipped an App myself using this class. It had no problems.

Customization

+ (void)setDefaultStyle:(JDPrepareStyleBlock)prepareBlock;

+ (NSString*)addStyleNamed:(NSString*)identifier
                   prepare:(JDPrepareStyleBlock)prepareBlock;
The prepareBlock gives you a copy of the default style, which can be modified as you like:
[JDStatusBarNotification addStyleNamed:<#identifier#>
                               prepare:^JDStatusBarStyle*(JDStatusBarStyle *style) {

                                   // main properties
                                   style.barColor = <#color#>;
                                   style.textColor = <#color#>;
                                   style.font = <#font#>;

                                   // advanced properties
                                   style.animationType = <#type#>;
                                   style.textShadow = <#shadow#>;
                                   style.textVerticalPositionAdjustment = <#adjustment#>;

                                   // progress bar
                                   style.progressBarColor = <#color#>;
                                   style.progressBarHeight = <#height#>;
                                   style.progressBarPosition = <#position#>;

                                   return style;
                               }];

Animation Types

  • JDStatusBarAnimationTypeNone
  • JDStatusBarAnimationTypeMove
  • JDStatusBarAnimationTypeBounce
  • JDStatusBarAnimationTypeFade

Progress Bar Positions

  • JDStatusBarProgressBarPositionBottom
  • JDStatusBarProgressBarPositionCenter
  • JDStatusBarProgressBarPositionTop
  • JDStatusBarProgressBarPositionBelow
  • JDStatusBarProgressBarPositionNavBar
Download: https://github.com/jaydee3/JDStatusBarNotification/archive/master.zip

Thursday, February 20, 2014

EF Circular Slider

An extensible circular slider for iOS applications.

Demo

The code to make this GIF is in the ExampleProject/ directory:

Installation

The simplest way to use EFCircularSlider in your application is with CocoaPods. See the "Getting Started" guide for more information.

Podfile

platform :ios, '7.0'
pod "EFCircularSlider", "~> 0.1.0"
You could instead clone the project and copy the EFCircularSlider/EFCircularSlider.{h,m} files into your project.

Initialization

Adding EFCircularSlider to your project is as simple as getting the source files, and waving a magic wand:
- (void)viewDidLoad {
    ...
    CGRect sliderFrame = CGRectMake(110, 150, 100, 100);
    EFCircularSlider* circularSlider = [[EFCircularSlider alloc] initWithFrame:sliderFrame];
    [self.view addSubview:circularSlider];
    ...
}
And then, just like you would for any other control, you need to subscribe to the event chagning using target-action behavior:
[slider addTarget:self action:@selector(newValue:) forControlEvents:UIControlEventValueChanged];

Options

EFCircularSlider is made to be very easy to style and customize.

Properties

minimumValue:(float) - Default: 0.0f

When the slider is at the very top position, it will set the currentValue to this.
You can set the minimum value with:
circularSlider.minimumValue = 1.0f;

maximumValue:(float) - Default 100.0f

With EFCircularSlider, the currentValue increases as you drag the slider clockwise. Therefore, when the slider is just to the left of the very top position, it will approach (but never reach) this.
You can set the maximum value with:
circularSlider.minimumValue = 100.0f;

currentValue:(float) - Default 0.0f

Whenever the slider changes position, this value will change. It will be a normalized value based on the minimuimValue and maximumValue properties.
You can get the currentValue with:
float val = circularSlider.currentValue;

lineWidth:(int) - Default 5

This determines the width of the arc that makes up the slider. This will set the value both for the unfilled arc (the background) and the arc that shows how much of the slider has been slid across. Currently, changing the lineWidth more than a few pixels causes adverse side effects, mainly with the handle.
You can modify the lineWidth with:
circularSlider.lineWidth = 6;

handleColor:(UIColor*) - Default [UIColor redColor]

The handle is the part of the slider that you drag with your finger.
Modify the color of the handle with:
CGFloat hue = ( arc4random() % 256 / 256.0 );
CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5;
CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5;

circularSlider.handleColor = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1];

handleType:(EFHandleType) - Default EFSemiTransparentWhiteCircle

EFCircularSlider comes with 4 types of handles:
  • EFSemiTransparentWhiteCircle
  • EFSemiTransparentBlackCircle
  • EFDoubleCircleWithOpenCenter
  • EFDoubleCircleWithClosedCenter
  • EFBigCircle
You can change the handleType with:
circularSlider.handleType = EFDoubleCircleWithClosedCenter;

unfilledColor:(UIColor*) - Default [UIColor blackColor]

This is the color that will show if the slider is set to its minimum value.
You can modify the unfilledColor with:
circularSlider.unfilledColor = [UIColor purpleColor];

filledColor:(UIColor*) - Default [UIColor redColor]

This is the color that will show between the minimum value and the currentValue.
You can modify the filledColor with:
circularSlider.unfilledColor = [UIColor purpleColor];

labelFont:(UIFont*) - Default [UIFont systemFontOfSize:10.0f]

This is the font that the labels will have if you decide to set inner marking labels (more on this down the page).
You can modify the labelFont with:
circularSlider.labelFont = [UIFont systemFontOfSize:14.0f];
Note this will have no effect if you have not passed in the labels that you want to add

snapToLabels:(BOOL) - Default NO

If this is set to YES, once finish dragging the slider, it will snap to the closest label and subsequently set the current value to what it would be at that label, not where you dragged it.
You can set the slider to snap to labels with:
circularSlider.snapToLabels = YES;
Note this will have no effect if you have not passed in the labels that you want to add

Functions

-(void)setInnerMarkingLabels:(NSArray*)labels

You can send this method an array of labels and they will show up on the inside of the slider. There is currently no way to specify the spacing between the labels and therefore they will be evenly spaced out. If you choose to include labels on your slider, you will then have the option to set the font of the label as well as if the slider should snap to the closest label position after the value changes.
The first label will appear at the 1 o'clock position (if it were a clock).
If you wanted to make your slider look like a clock, you would do the following:
NSArray* hoursArray = @[@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", @"11", @"12"];
[circularSlider setInnerMarkingLabels:hoursArray];
Download: https://github.com/eliotfowler/EFCircularSlider/archive/master.zip

Wednesday, February 19, 2014

FH Segmented View Controller

FHSegmentedViewController

123

Requirements

  • iOS 6.1+
  • ARC

Installation

From CocoaPods

pod 'FHSegmentedViewController'

From source

  • Drag the FHSegmentedViewController folder to your project

Getting Started

  1. Create a subclass of FHSegmentedViewController in your project
#import "FHSegmentedViewController.h"

@interface MasterViewController : FHSegmentedViewController
2.Implement - (void)viewDidLoad
- (void)viewDidLoad
{
    [super viewDidLoad];

    [self setViewControllers:@[[self.storyboard instantiateViewControllerWithIdentifier:@"firstSubViewController"], [self.storyboard instantiateViewControllerWithIdentifier:@"secondSubViewController"]]];
}
  1. Push an instance of AnotherViewController.
    UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"firstSubViewController"];
    [self pushViewController:viewController title:@"anotherViewController"]; 
Download: https://github.com/iDay/FHSegmentedViewController/archive/master.zip

Sunday, February 16, 2014

MW Date Picker

MWDatePicker - Custom UIDatePicker

An UIDatePicker replacement with custom Background and Selector Styles. (As seen in nextr)

Still in work :)

Preview

With Shadows and ColorsWith Shadows and BlackWith Shadows and Black and SelectorWithout Shadows and White

Features

  • customize the Look and Feel of your UIDatePicker in order to suit your App Design
  • change Background of each Component either with UIColor or an UIView
  • change and style the Date Selector Overlay (again with UIColor or an UIView)

Installation

  1. Add MWDatePicker.h and MWDatePicker.m to your project
  2. Add QuartzCore.framework to your project

Requirements

  • iOS 6.0 and greater
  • ARC

Delegate Methods

  1. Add 'MWDatePicker.h' to your ViewController
  2. Add 'MWPickerDelegate' to your Class
  3. Implement MWDatePicker Delegate Methods
  • (void)datePicker:(MWDatePicker *)picker didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
  • (void)datePicker:(MWDatePicker *)picker didClickRow:(NSInteger)row inComponent:(NSInteger)component;
  • (UIView *)backgroundViewForDatePicker:(MWDatePicker *)picker;
  • (UIColor *)backgroundColorForDatePicker:(MWDatePicker *)picker;
  • (UIView *)datePicker:(MWDatePicker *)picker backgroundViewForComponent:(NSInteger)component;
  • (UIColor *)datePicker:(MWDatePicker *)picker backgroundColorForComponent:(NSInteger)component;
  • (UIView *)overlayViewForDatePickerSelector:(MWDatePicker *)picker;
  • (UIColor *)overlayColorForDatePickerSelector:(MWDatePicker *)picker;
  • (UIView *)viewForDatePickerSelector:(MWDatePicker *)picker;
  • (UIColor *)viewColorForDatePickerSelector:(MWDatePicker *)picker;
Download: https://github.com/mwermuth/MWDatePicker/archive/master.zip

Friday, February 14, 2014

CR Navigation Controller

A UINavigationController subclass that brings about a more vivid, brighter UINavigationBar.
iOS 7.1 Update: This update has yet again affected how UINavigationBar's color scheme works. This time, it seems as though any modifications to the alpha channel are ignored. This hinders this library quite a bit since we rely on editing this value to display the color layer beneath. I am currently looking for a workaround for this.
iOS 7.0.3 Update: It seems like this update has changed the way translucency works for both navigation bars and toolbars. The blurriness is dependant on the alpha of the color. Unfortunately, there is no magic formula to make colors made in iOS 7.0.2 and earlier the same as they are in iOS 7.0.3. I've found that setting the alpha of the navigation bar at around 0.6f-0.8f provides the best bang for your buck; that is, you can still obtain translucency, however, at the cost of your vibrant color. The additional color layer has been removed since this also impacts translucency, until we can figure out a more optimal solution. If you are still running an earlier version of iOS 7, this library still works!
With the release of iOS 7, Apple has brought translucency all throughout the operating system. As developers, we are (in a sense) responsible for utilizing these new libraries to present unity between our apps and the OS. With the introduction of gaussian, translucent navigation bars, we are able to allow for more dynamic context with the views that we are presenting.
However, there's a subtle flaw; much of the color options are rather desaturated. Suppose you wanted a translucent navigation bar that was a slightly light, rich blue. With native classes, you would get this (under a white background):

Blue UINavigationBar without Layer

Not exactly what you'd expect. You could come up with a combination of values for red, green, and blue and still never get the color you wanted. This is because Apple has decided to lower the saturation of the color by about 40%. Additionally, it inherits some color from whatever is behind it. As a result, we get this very pale blue color that isn't necessarily what we want.
Enter this library.
This library does a simple little addition to the UINavigationBar. By adding a layer directly above the navigation bar's background layer, we can enhance the navigation bar's vibrance. This layer takes on the same color that we specify in the navigation bar's barTintColor, at 50% opacity. This can be changed, but I've found that this percentage is the best blend of vibrance and translucency. With this library, we get:

Blue UINavigationBar with Layer

This still doesn't allow us to achieve an absolute color; however, it brings us many steps closer in the right direction.

UINavigationController vs. CRNavigationController:

Achieving a red barTintColor:

Red UINavigationBar without Layer
vs.
Red UINavigationBar with Layer

Achieving a black barTintColor:

Black UINavigationBar without Layer
vs.
Black UINavigationBar with Layer

Requirements

  • Xcode 5
  • iOS 7.0 (iOS 7.0.3 has a different color scheme. So does iOS 7.1.)
  • A desire to experiment with colors!

Demonstration

A demo app is available in the repo. Mess with the toggles to change the color of either the CRNavigationBar or the backgroundColor of the view to understand how much impact a specific color may have on a certain barTintColor. RGB values in decimal format are also displayed for your convenience if you decide to use this as a tool to find the perfect color.

Credits, Licensing, and Other What Have You

I can't take all of the credit for this solution. This was a collaborated effort on Stack Overflow, created by me and many others. Feel free to use this library in your projects. Mess with the settings and find what blends work best with your apps! I only ask that you leave boilerplates unchanged and that you mention the use of this library in any apps you decide to ship into the store.
I guess this goes here, too. The infamous MIT License:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Download: https://github.com/croberts22/CRNavigationController/archive/master.zip

Thursday, February 13, 2014

DL Widget Menu

DLWidgetMenu is a versatile solution for displaying widget menus and can easily be extended with custom layouts and/or animations.

Preview

screenshot

Features

DLWidgetMenu comes with three built-in layouts:
  • DLWMLinearLayout
  • DLWMRadialLayout
  • DLWMSpiralLayout
DLWidgetMenu uses iOS7's spring animations (DLWMSpringMenuAnimator) by default, but can easily be provided with your own custom animations as well (by subclassing DLWMMenuAnimator).
DLWidgetMenu observes its menu items for these gesture recognizer events:
  • single tap
  • double tap
  • long press
  • pan
  • pinch
and forwards them directly to its delegate.
None of these events make DLWidgetMenu do anything by default.
The menu (by default) doesn't even open, when you tap it!
And it shouldn't.
DLWidgetMenu was specifically designed to keep you in full control over its behaviour. All it does is animating and layouting its menu items. Keeping you in total charge of what to do and when.
Assuming you do want DLWidgetMenu to open when single-tapped, all you need to do is implement this in your DLWMMenuDelegate:
- (void)receivedSingleTap:(UITapGestureRecognizer *)recognizer onItem:(DLWMMenuItem *)item inMenu:(DLWMMenu *)menu {
    if ([menu isClosedOrClosing]) {
        [menu open];
    } else if ([menu isOpenedOrOpening]) {
        if (item == menu.mainItem) {
            [menu close];
        } else {
            [menu closeWithSpecialAnimator:[[DLWMSelectionMenuAnimator alloc] init] forItem:item];
        }
    }
}
As you can see the delegate makes DLWidgetMenu use a custom animator for the tapped menu item by calling:
[menu closeWithSpecialAnimator:[[DLWMSelectionMenuAnimator alloc] init] forItem:item];
(The built-in DLWMSelectionMenuAnimator applies a scale-up in combination with a fade-out.)
Don't want that? Fine, just call [menu close]; then.
Okay, tapping is pretty standard stuff, right? Nothing too fancy. So how about moving a menu around using a pan gesture? Piece of cake:
- (void)receivedPan:(UIPanGestureRecognizer *)recognizer onItem:(DLWMMenuItem *)item inMenu:(DLWMMenu *)menu {
    // NSLog(@"%s", __FUNCTION__);
    if (item == menu.mainItem) {
        [menu moveTo:[recognizer locationInView:menu.superview] animated:NO];
    }
}

It's worth mentioning here that one should usually prefer [menu moveTo:… animated:…]; over menu.center = …; (while the menu is open, that is).
The reason for this is that DLWidgetMenu shrinks to just wrap its main item when closed and stretches to fit its superview when opened (in order to catch tap events outside its menu items). Just enable the debugging-mode (menu.debuggingEnabled = YES;) and you should get an idea of what this means.

Installation

Just copy the files in "DLWidgetMenu/Classes/..." into your project.
Alternatively you can install DLWidgetMenu into your project with CocoaPods. Just add it to your Podfile:
pod 'DLWidgetMenu'

Demos

DLWidgetMenu contains a demo app giving you a quick overview of all three included layouts.

ARC

DLWidgetMenu uses automatic reference counting (ARC).

Download: https://github.com/regexident/DLWidgetMenu/archive/master.zip

Tuesday, February 11, 2014

AP Time Zones

An utility for iOS and OSX developers to simplify extracting NSTimeZone from a given CLLocation.
You can do the same job by calling Google API or Yahoo API but APTimeZones works locally, offline and with no limits inherented to hosted solutions.

Usage:

//Ukraine location
CLLocation *location = [[CLLocation alloc] initWithLatitude:50.449846
                                                  longitude:30.523629];

NSTimeZone *timeZone = [[APTimeZones sharedInstance] timeZoneWithLocation:location];
NSLog(@"%@", timeZone);
You can use APTimeZones with Apple CLGeocoder as well to receive NSTimeZone for a given city string.
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:@"New York" completionHandler:^(NSArray *placemarks, NSError *error) {
    if (placemarks.count) {
        CLPlacemark *placemark = placemarks[0];
        CLLocation *location = placemark.location;

        NSString *countryCode = placemark.addressDictionary[@"CountryCode"];
        NSTimeZone *timeZone = [[APTimeZones sharedInstance] timeZoneWithLocation:location
                                                                      countryCode:countryCode];
        NSLog(@"%@", timeZone);
    } 
}];

Version 1.1:

We've added some handy categories with version 1.1 to make timezones magic even more easy.
CLLocation+APTimeZones
CLPlacemark+APTimeZones
Usage:
CLLocation *location = ...
NSLog(@"%@", location.timeZone);

CLPlacemark *placemark = ...;
NSLog(@"%@", placemark.timeZone);
Also, we've added example project that shows APTimeZones usage [Demo Video on YouTube]:
githalytics.com alpha If you have improvements or concerns, feel free to post an issue and write details.

Download: https://github.com/Alterplay/APTimeZones/archive/master.zip

Friday, January 24, 2014

3D Sphere View

Introduction:
- Implementation can be automatically or manually rotate the rotating 3D spherical tab, click the tab to enlarge the label.
- Code reference
http://codeiospro.blogspot.com
- Xiaobian Note: Thanks to developer @ supernatural apparition release code in http://codeiospro.blogspot.com.
Test environment:
- [CodeIOSpro] compile the test, the test environment: Xcode 5.0, iOS 5.0 above.


3D Sphere View iOS / iPhone / iPad 3D Sphere View iOS / iPhone / iPad  

Download: https://github.com/heroims/SphereView/archive/master.zip

Thursday, January 23, 2014

Twitter Cover

Twitter Cover is a parallax top view with real time blur effect to any UIScrollView, inspired by Twitter for iOS.
Completely created using UIKit framework.
Easy to drop into your project.
You can add this feature to your own project, TwitterCover is easy-to-use.

Requirements

TwitterCover requires Xcode 5, targeting either iOS 5.0 and above, ARC-enabled.

How to use

Drag UIScrollView+TwitterCover.h amd UIScrollView+TwitterCover.m files to your project.
No other frameworks required.
#import "UIScrollView+TwitterCover.h"
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
[scrollView addTwitterCoverWithImage:[UIImage imageNamed:@"cover.png"]];

How it looks

Twitter Cover iOS / iPhone / iPad

Download: https://github.com/cyndibaby905/TwitterCover/archive/master.zip

Wednesday, January 22, 2014

RF Keyboard Toolbar

This is a flexible UIView and UIButton subclass to add customized buttons and toolbars to your UITextFields/UITextViews. This project was inspired by the toolbar seen in iOctocat.

Installation

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like RFKeyboardToolbar in your projects.

Podfile

platform :ios, '7.0'
pod "RFKeyboardToolbar", "~> 1.1"

Installation without CocoaPods

Just drag the RFKeyboardToolbar folder into your project and import it.
#import 'RFKeyboardToolbar.h'

Use

RFKeyboardToolbar is pretty easy to use with your UITextFields or UITextViews. After you've importedRFKeyboardToolbar, you can add a toolbar to anything that has an inputAccessoryView.
I've commented on the initialization below, to help you get a better understanding of it.
// Create a new RFToolbarButton
RFToolbarButton *exampleButton = [RFToolbarButton buttonWithTitle:@"Example"];

// Add a button target to the exampleButton
[exampleButton addEventHandler:^{
    // Add any action
    [_textView insertText:@"You pressed a button!"];
} forControlEvents:UIControlEventTouchUpInside];

// Create an RFKeyboardToolbar, adding all of your buttons, and set it as your inputAcessoryView
_textView.inputAccessoryView = [RFKeyboardToolbar toolbarViewWithButtons:@[exampleButton]];

// Add the UITextView/UITextField   
[self.view addSubview:_textView];
Hope you enjoy it! Please Fork and send Pull Requests!

Screenshots

RFMarkdownTextViewRFKeyboardToolbarDemo

Contributors

License

The MIT License (MIT)
Copyright (c) 2013 Rex Finn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Download: https://github.com/rexfinn/RFKeyboardToolbar/archive/master.zip

Tuesday, January 21, 2014

Face Aware Fill

This category applies Aspect Fill content mode to an image and if faces are detected it centers them instead of centering the image just by its geometrical center.
Based on this awesome post by @maniacdev
Based on this awesome post by @maniacdev

Example:

image

Installation

FaceAwareFill is available through CocoaPods, to install it simply add the following line to your Podfile:
pod "FaceAwareFill"

Usage

Import the category to your .m file or to your "prefix" file.
#import "UIImageView+UIImageView_FaceAwareFill.h"
Then AFTER setting the image property of a UIImageView do:
[imageView faceAwareFill];
That's all.
Enjoy!

Debugging

A red rectangle can optionally be displayed on faces for debugging.
To enable, add the following value to the preprocessor macros:
DEBUGGING_FACE_AWARE_FILL

Author

Julio Andrés Carretttoni, @dev_jac

Notes:

Face Aware Fill Face Aware Fill Download: https://github.com/Julioacarrettoni/UIImageView_FaceAwareFill/archive/master.zip

Friday, January 17, 2014

Progress HUD

ProgressHUD is a lightweight and easy-to-use HUD for iOS 7 (written in Objective-C).

Installation

Drag the ProgressHUD/ProgressHUD folder into your project.

Requirements

  • Xcode 5
  • iOS 7
  • ARC

Displaying the HUD

+ (void)show:(NSString *)status;
+ (void)showSuccess:(NSString *)status;
+ (void)showError:(NSString *)status;
showSuccess and showError will automatically dismiss the HUD.

iOS / iPhone / iPad 适配iOS 7的HUD。 iOS / iPhone / iPad 适配iOS 7的HUD。 iOS / iPhone / iPad 适配iOS 7的HUD。 iOS / iPhone / iPad 适配iOS 7的HUD。

Dismissing the HUD

+ (void)dismiss;

Usage

1., Add the following import to the top of the file:
#import "ProgressHUD.h"
2., Use the following to display the HUD:
[ProgressHUD show:@"Please wait..."];
3., Simply dismiss after complete your task:
[ProgressHUD dismiss];

Color shemes

Use sheme_white or sheme_black depending on your needs. However feel free to customize the color settings in ProgressHUD.h file.

Download: https://github.com/relatedcode/ProgressHUD/archive/master.zip

Thursday, January 16, 2014

iOS Mp4 Camera

A Demo WIth UIIamgePicerView and AVAssetExportSession

Attenction This Demo Based iOS 6 SDK...

This demo shows:

  1. Record a Mov Video
  2. Convert To Mp4 File With Native API
  3. Play The Mp4 File With MPMoviePlayerViewController
 iOS Mp4 Camera iOS / iPhone / iPad

Download: https://github.com/rpplusplus/iOSMp4Camera/archive/master.zip

Kal for IOS 7

  • update UI to IOS7 style
  • add range select
Kal for IOS 7 iOS / iPhone / iPad

Kal - a calendar component for the iPhone

This project aims to provide an open-source implementation of the month view in Apple's mobile calendar app (MobileCal). When the user taps a day on the calendar, any associated data for that day will be displayed in a table view directly below the calendar. As a client of the Kal component, you have 2 responsibilities:
  1. Tell Kal which days need to be marked with a dot because they have associated data.
  2. Provide UITableViewCells which display the details (if any) for the currently selected day.
In order to use Kal in your application, you will need to provide an implementation of the KalDataSource protocol to satisfy these responsibilities. Please see KalDataSource.h and the included demo app for more details.

Release Notes

June 21, 2012
Today I added VoiceOver/Accessibility support. Special thanks to Matt Gemmell's excellent article on adding accessibility support to your iPhone app. I wish I would have done this a long time ago.
If your app is localized, then you will also want to localize the 4 new accessibility strings that I added in this release: "Previous month", "Next month", "Marked" and "Today".
July 9, 2010
This is the iOS 4.0 / iPhone4 release. New features include:
1) A refactored project file. Kal is now built as a static library in a separate Xcode project. Regardless of whether you are a new or existing user of Kal, please read the section entitled "Integrating Kal into Your Project" below.
2) The project now specifies iOS 4.0 as the Base SDK. So if you want to upgrade to this release of Kal, you must upgrade your SDK.
3) Added hi-res graphics for Retina Display support. Extra special thanks to Paul Calnan for sending me the hi-res graphics.
4) Added a new example app, "NativeCal," which demonstrates how to integrate Kal with the EventKit framework that Apple made available in iOS 4.
NOTE I'm not crazy about the KalDataSource asynchronous/synchronous API. I will probably be changing it in the future and updating the example apps to use GCD and blocks.
March 11, 2010
A lot of people have emailed me asking for support for selecting and displaying an arbitrary date on the calendar. So today I pushed some commits that make this easy to do. You can specify which date should be initially selected and shown when the calendar is first created by using -[KalViewController initWithSelectedDate:]. If you would like to programmatically switch the calendar to display the month for an arbitrary date and select that date, use -[KalViewController showAndSelectDate:].
January 1, 2010
I have made significant changes to the KalDataSource API so that the client can respond to the data request asynchronously. The Kal demo app, "Holidays," now includes 2 example datasources:
  1. HolidayJSONDataSource - retrieves data asynchronously from http://keith.lazuka.org/holidays.json
  2. HolidaySqliteDataSource - queries an Sqlite database inside the application bundle and responds synchronously (because the query is fast enough that it doesn't affect UI responsiveness too badly).
December 19, 2009
Initial public release on GitHub.

Example Usage

Note: All of the following example code assumes that it is being called from within another UIViewController which is in a UINavigationController hierarchy.
How to display a very basic calendar (without any events):
KalViewController *calendar = [[[KalViewController alloc] init] autorelease];
[self.navigationController pushViewController:calendar animated:YES];
In most cases you will have some custom data that you want to attach to the dates on the calendar. The first thing you must do is provide an implementation of the KalDataSource protocol. Then all you need to do to display your annotated calendar is instantiate the KalViewController and tell it to use your KalDataSource implementation (in this case, "MyKalDataSource"):
id<KalDataSource> source = [[MyKalDataSource alloc] init];
KalViewController *calendar = [[[KalViewController alloc] initWithDataSource:source] autorelease];
[self.navigationController pushViewController:calendar animated:YES];
NOTE: KalViewController does not retain its datasource. You probably will want to store a reference to the dataSource in an instance variable so that you can release it after the calendar has been destroyed.

Integrating Kal into Your Project

Kal is compiled as a static library, and the recommended way to add it to your project is to use Xcode's "dependent project" facilities by following these step-by-step instructions:
  1. Clone the Kal git repository: git clone git://github.com/klazuka/Kal.git. Make sure you store the repository in a permanent place because Xcode will need to reference the files every time you compile your project.
  2. Locate the "Kal.xcodeproj" file under "Kal/src/". Drag Kal.xcodeproj and drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add".
  3. Now you need to link the Kal static library to your project. Select the Kal.xcodeproj file that you just added to the sidebar. Under the "Details" table, you will see libKal.a. Check the checkbox on the far right for this file. This will tell Xcode to link against Kal when building your app.
  4. Now you need to add Kal as a dependency of your project so that Xcode will compile it whenever you compile your project. Expand the "Targets" section of the sidebar and double-click your application's target. Under the "General" tab you will see a "Direct Dependencies" section. Click the "+" button, select "Kal" and click "Add Target".
  5. Now you need to add the bundle of image resources internally used by Kal's UI. Locate "Kal.bundle" under "Kal/src" and drag and drop it into your project. A dialog will appear -- make sure "Create Folder References" is selected, "Copy items" is unchecked, and "Reference Type" is "Relative to Project" before clicking "Add".
  6. Finally, we need to tell your project where to find the Kal headers. Open your "Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click it. Add the relative path from your project's directory to the "Kal/src" directory.
  7. While you are in Project Settings, go to "Other Linker Flags" under the "Linker" section, and add "-all_load" to the list of flags.
  8. You're ready to go. Just #import "Kal.h" anywhere you want to use KalViewController in your project.

Additional Notes

The Xcode project includes two demo apps: 1) "Holiday" demonstrates how to use Kal to display several 2009 and 2010 world holidays using both JSON and Sqlite datasources. 2) "NativeCal" demonstrates how to use Kal with the EventKit framework.
Kal is fully localized. The month name and days of the week will automatically use the appropriate language and style for the iPhone's current regional settings.

Download: https://github.com/phaibin/Kal/archive/master.zip

Wednesday, January 15, 2014

UIButton Bootstrap

UIButton-Bootstrap
Simple UIButton category that adds nice and flat Bootstrap 3.0 button styles.
No subclass, no images. Quartz Core drawing. Highly customizable.

iOS / iPhone / iPad 无需任何图片,纯代码实现(Quartz Core)具有扁平化、Bootstrap风格的按钮。

How-To

  • Drag the UIButton+Bootstrap, NSString+FontAwesome and FontAwesome.ttf files to your project
  • Import the category with #import "UIButton+Bootstrap.h"
  • Add Fonts provided by application key to Info.plist and include FontAwesome.ttf
Create an UIButton with UIButtonTypeCustom.
Then set the style by:
[yourButton primaryStyle];

[yourOtherButton successStyle];

etc.
And icons by:
[yourButton addAwesomeIcon:FAIconBookmark beforeTitle:YES];

[yourOtherButton addAwesomeIcon:FAIconCalendar beforeTitle:NO];

etc.

Credits

BButton by mattlawer: https://github.com/mattlawer/BButton
FontAwesome-iOS by leberwurstsaft: https://github.com/leberwurstsaft/FontAwesome-for-iOS

License

The MIT License (MIT)
Copyright (c) 2013 Oskar Groth
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Download: https://github.com/OskarGroth/UIButton-Bootstrap/archive/master.zip

DX Alert View

Feature

  1. API is simple just like the UIAlertView.
  2. The callback function is simple to write.
  3. The animation is cool or in another saying----different from the triditional way.

How to use

eg:
DXAlertView *alert = [[DXAlertView alloc] initWithTitle:@"Congratulations" contentText:@"You have bought something" leftButtonTitle:@"Ok" rightButtonTitle:@"Fine"];
[alert show];

alert.leftBlock = ^() {
    NSLog(@"left button clicked");
};
alert.rightBlock = ^() {
    NSLog(@"right button clicked");
};
alert.dismissBlock = ^() {
    NSLog(@"Do something interesting after dismiss block");
};
PicDemo:


screenshots


iOS / iPhone / iPad DX Alert View iOS / iPhone / iPad DX Alert View 2
Download: https://github.com/xiekw2010/DXAlertView/archive/master.zip

Thursday, January 9, 2014

Wt url image view

Description:
WTURLImageView is a subclass of UIImageView that load images from Internet using AFNetworking, with the following features

Auto resize image
Show image in different aspect ratio
Disk cache using GVCache
Activity indicator
Placeholder and failed image
Various transition animations when image is loaded
Screenshot:
Wturlimageview