Recently Added iOS Source Code Examples

More >
  • ODMultiColumnLabel works best if the label has no fixed height, either using Autolayout’s intrinsic content size or -sizeToFit. Forcing a smaller height to the label will currently crop the bottom part

    ODMultiColumnLabel

    09/19/2014

    ODMultiColumnLabel is a UILabel replacement that renders text on multiple columns, without any major hassle。

  • Date from String

// Date from String with custom format
NSDate(fromString: "16 July 1972 6:12:00 ", format: .Custom("dd MMM yyyy HH:mm:ss")) -> NSDate
// Date from ISO8601 String
NSDate(fromString: "1972-07-16T08:15:30-05:00", format: .ISO8601) -> NSDate
// Date from DotNetJSON String
NSDate(fromString: "/Date(1260123281843)/", format: .DotNet) -> NSDate
// Date from RSS String
NSDate(fromString: "Fri, 09 Sep 2011 15:26:08 +0200", format: .RSS) -> NSDate
// Date from AltRSS String
NSDate(fromString: "09 Sep 2011 15:26:08 +0200", format: .AltRSS) -> NSDate -> NSDate

    AFDateHelper

    09/19/2014

    Convenience extension for NSDate 。

  • You start shaking your views with a one liner :). It supports a few different shaking styles (horizontal, vertical, rotate) and let you configure the duration, the speed and the shake strength.

    SCViewShaker

    09/18/2014

    A highly configurable UIView category for shaking a view。

  • BFPaperButton is a subclass of UIButton that behaves much like the new paper buttons from Google's Material Design Labs. All animation are asynchronous and are performed on sublayers. BFPaperButtons work right away with pleasing default behaviors, however they can be easily customized! The corner radius, tap-circle color, background fade color, and tap-circle diameter are all readily customizable via public properties.

    BFPaperButton

    09/18/2014

    A flat button inspired by Google Material Design's Paper theme。

  • Surfboard was developed with Xcode 5 and the iOS 7 SDK. It uses autolayout and UICollectionViewController, so although it hasn't been tested on iOS 6, you may entertain yourself by trying to run Surfboard on it.

    Sufboard

    09/17/2014

    Surfboard is a delightful onboarding library for iOS。

  • It lets you interact with your app as you normally would while applying one of several color transformations to the user interface in realtime.

    Vangogh

    09/17/2014

    Vangogh is an iOS library for testing how well an application works for people with various kinds of color vision deficiencies。

  • ViewController to describe the User how to turn on the Notifications

NSString *title = @"Benachrichtungen aktivieren";
NSString *descriptionString = @"Um die Notificationen verwenden zu können müssen sie die Banachrichtungen aktivieren.";

MHNotificationHelperObject *notificationObject = [MHNotificationHelperObject objectWithTitle:title
                                                                                 description:descriptionString
                                                                                     appIcon:nil
                                                                                     appName:@"meine App"];

MHNotificationHelperViewController *notificationHelper = [MHNotificationHelperViewController.alloc initWithNotification:notificationObject];
notificationHelper.bannerLabel.text = NSLocalizedString(@"Banner", nil);

[self presentViewController:notificationHelper animated:YES completion:nil];

    MHNotificationHelper

    09/16/2014

    ViewController to describe the User how to turn on the Notifications。

  • Drop the MAThemeKit.h/m files into your project, import the header into your AppDelegate.m file, and in the application:didFinishLaunchingWithOptions: method tell MAThemeKit what you'd like your primary and secondary theme colors to be, what you want for a font for your applications Navigation/TabBar's and if you'd like the status bar to be light or not. (NOTE - you'll still need to manually add the 'View controller-based status bar appearance' key to your Info.plist and set it to NO for the status bar to be set to light content.)

    MAThemeKit

    09/16/2014

    MAThemeKit provides iOS developers the ability to create a coherent color theme throughout their entire application using a single line of code, removing the need to mess with the dozens of UIAppearance proxies for each UI component.。

  • IQMediaPickerController contains 3 library IQMediaCaptureController, IQAssetsPickerController & IQAudioPickerController. All libraries are separate from the others, so if you want to integrate any one of them, you can copy only required library without copying others.

    IQMediaPickerController

    09/15/2014

    IQMediaPickerController allows user to capture Videos, Images and Audio using AVFoundation framework。

  • AMPActivityIndicator is a custom UIView subclass that mimics the UIActivityIndicatorView behavior.


You can customize:
The color
The width of each bar
The height of each bar
The aperture (distanfe from the center)

    AMPActivityIndicator

    09/15/2014

    AMPActivityIndicator is a custom UIView subclass that mimics the UIActivityIndicatorView behaviour。

  • AmazingButton *button = [[AmazingButton alloc] initWithFrame:CGRectMake(85, 100, 50, 50) color:[UIColor orangeColor]     type:AmaButtonTypeUser];

    AmazingButton

    09/12/2014

    AmazingButton is look like net ease news app button style.。

  • BKCardNumberField

// create (you can also use interface builder)
BKCardNumberField *cardNumberField = [[BKCardNumberField alloc] initWithFrame:CGRectMake(0, 0, 300, 40)];
cardNumberField.showsCardLogo = YES;
[self.view addSubview:cardNumberField];

// get card number
NSString *cardNumber = cardNumberField.cardNumber;

// get card company name
NSString *companyName = cardNumberField.cardCompanyName;
BKCardExpiryField

BKCardExpiryField *field = [[BKCardExpiryField alloc] init];

// get month
NSInteger month = field.dateComponents.month;

// get year
NSInteger year = field.dateComponents.year;
BKCurrencyTextField

BKCurrencyTextField *field = [[BKCurrencyTextField alloc] init];

// change currency
field.numberFormatter.currencyCode = @"KRW";

// get number value
NSDecimalNumber *number = field.numberValue;

    BKMoneyKit

    09/12/2014

    BKMoneyKit iOS UI controls and formatters for entering money, credit card number and expiry date.。

  • JYGraphViewController is a slightly adapted version of the graph that appears in Tempo/Weather. It is meant to be presented modally and using the whole screen. The demo application it belongs to here presents it using an orientation change notification, but it could be triggered via any action. The benefit of having it presented based on orientation is that you don't have to obscure the graph with any controls. From a UX point of view, animating the presentation helps the user understand the graph is affected by gravity: ie. slides out when device is turned into landscape, and falls back away when returned to portrait.

- (void) didRotate
{
    if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft ||
        [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {

    JYGraphViewController *graphView = [[JYGraphViewController alloc] initWithNibName:@"JYGraphViewController" bundle:nil];

    // Set the data for the graph
    // Send only an array of number values
    graphView.graphData = [self createArrayOfNumbersToPassToGraph];

    // Set the xAxis labels (optional)
    // Can send numbers or strings (it's printed using stringWithFormat:"%@")
    graphView.graphXAxisLabels = [self createXAxisLabelArray];

    [self presentViewController:graphView animated:YES completion:nil];
    }
}

    JYGraphViewController

    09/11/2014

    JYGraphViewController is an easy way to graph data in a simple and minimalist style. By default it is presented modally when the device is turned into landscape orientation。

  • IRImageTableView Class

@property (nonatomic, strong) NSArray *data;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, weak) id <IRImageTableViewDelegate> delegate;

-(id)initWithTable:(UITableView*)aTable withData:(NSArray *)aData;

@end

IRImageTableViewDelegate Protocol

@protocol IRImageTableViewDelegate <NSObject>
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
@end

    IRImageTableView

    09/11/2014

    A solution to add a UIImageView in an UITableView (inspired by Tweetbot)。

  • Here we should set the titles,finishedDownloadingButtonTitle, and buttonDelegate !!!.

MOStoreButton*storeButton1 =[[MOStoreButton alloc]initWithFrame:CGRectMake(100, 260,80, 40) andColor:[UIColor blueColor]];

storeButton1.buttonDelegate=self;
storeButton1.titleLabel.font =[UIFont systemFontOfSize:17];
storeButton1.finishedDownloadingButtonTitle =@"Open";
[storeButton1 setTitles:@[@"free",@"INSTALL"]];
[self.view addSubview:storeButton1]; 


Delegate

We Care here about the currentIndex which determine the state of the button transition, see the demo for more clarification

-(void)storeButtonFired:(MOStoreButton *)button{

NSLog(@"click  %i",button.currentIndex);

}

    MoStoreButton

    09/10/2014

    simple-to-use iOS 7 Appstore like button。

  • Flat Rounded Style

//Example
    self.flatRoundedButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(100, 150, 30, 30)
                                              buttonType:buttonMenuType
                                             buttonStyle:buttonRoundedStyle];
self.flatRoundedButton.roundBackgroundColor = [UIColor whiteColor];
self.flatRoundedButton.lineThickness = 2;
self.flatRoundedButton.tintColor = [UIColor flatPeterRiverColor];
[self.flatRoundedButton addTarget:self
                           action:@selector(flatRoundedButtonPressed)
                 forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.flatRoundedButton];
Flat Plain Style

//Example
    self.flatPlainButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(200, 150, 30, 30)
                                                   buttonType:buttonAddType
                                                  buttonStyle:buttonPlainStyle];
self.flatPlainButton.lineThickness = 2;
self.flatPlainButton.tintColor = [UIColor whiteColor];
[self.flatPlainButton addTarget:self
                         action:@selector(flatPlainButtonPressed)
               forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.flatPlainButton];
In both cases, you can use the following method to animate the button from one state to the next:

[flatRoundedButton animateToType:nextType];
This are the 9 types avaiable for the button:

typedef NS_ENUM(NSInteger, FlatButtonType) {
buttonDefaultType,             // Vertical line
buttonAddType,                 // +
buttonMinusType,               // -
buttonCloseType,               // x
buttonBackType,                // <
buttonForwardType,             // >
buttonMenuType,                 // 3horizontal lines
buttonDownloadType,
buttonShareType
};

    VBFPopFlatButton

    09/10/2014

    VBFPopFlatButton通过Facebook Pop实现按钮的动态变换。

  • Drop the OnboardingViewController and OnboardingContentViewController header and implementation files into your project, import them into your AppDelegate, and you're ready to create an awesome onboarding experience for your users!

Create individual pages by creating an OnboardingContentViewController, providing it a title, body, image, text for an action button, and within the action block handle whatever you want to do when the users press the button. If you don't want a button, you can leave both the button text and action handler nil.

OnboardingContentViewController *firstPage = [[OnboardingContentViewController alloc] initWithTitle:@"Page Title" body:@"Page body goes here." image:[UIImage imageNamed:@"icon"] buttonText:@"Text For Button" action:^{
    // do something here when users press the button, like ask for location services permissions, register for push notifications, connect to social media, or finish the onboarding process
}];

    Onboard

    09/09/2014

    nboard provides developers with a quick and easy means to create a beautiful, engaging, and useful onboarding experience with only a few lines of code。

  • ARTEmailSwipe is a UIViewController container, which allows you to have one view controller at the bottom, whilst keeping your main navigation separate. This is based on the iOS 8 emails implementation where you can have your new email open at the bottom whilst still viewing all your old emails above it. I also took a lot of inspiration from the JASidePanels project.


Example 1: Code

#import "ARTEmailSwipe.h"

实现文件中创建ARTEmailSwipe对象并初始化:
@implementation AppDelegate

@synthesize window = _window;
@synthesize viewController = _viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    self.viewController = [[ARTEmailSwipe alloc] init];

  // you will want to use your own custom classes here, but for the example I have just instantiated it with the UIViewController class.
    self.viewController.centerViewController = [[UIViewController alloc] init];
    self.viewController.bottomViewController = [[UIViewController alloc] init];

    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

@end

    ARTEmailSwipe

    09/09/2014

    ARTEmailSwipe is a UIViewController container。

Popular Code

More >
  • 高仿番茄快点点餐界面 ,手指点击位置弹出番茄并进行抛物线动画,滑动tableView时动画不卡顿。
小编注:感谢开发者@奋斗的小三到2046 发布代码于Code4App.com。

    Add to Cart Animation

    2429 downloads

    Implement Add item to cart animation on UITableView。

  • 一个使用ZXing库实现二维码扫描、自定义扫描控件及二维码生成的例子。项目中包含了ZXing自带扫描控件的使用,自定义扫描控件的界面,从相册中读取照片解析二维码,以及生成二维码的功能。解码使用ZXing库,编码使用QRCodeEncoder库。
小编注:感谢开发者@禁行线 分享代码于Code4App。

    ZXing Demo

    2258 downloads

    使用ZXing库实现二维码扫描、自定义扫描控件及二维码生成。

  • 实现聊天应用的气泡对话框效果。气泡大小可以根据文字输入的多少而自动改变高度。

    Bubble TableView

    2163 downloads

    Cocoa UI component for chat bubbles with avatars and images support。

  • 实现微信选取图片并裁剪成头像的控件。

    VPImageCropper

    1844 downloads

    Crop an image to round shape for use as an user avatar。

  • 利用 cocos2d-x 实现多平台高仿微信打飞机游戏。平台包括:iOS、Mac OS 和 Anroid。代码基于@JustDifferent__ 发布于 code4app 的代码 “高仿微信打飞机”(http://code4app.com/ios/高仿微信打飞机/521495136803fa1d5f000001)移植而来。
作者说:需要在代码工程中加入cocos2d-x的库才能运行demo。
请参考 How to create a multi-platform project in one command line(http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_create_a_multi-platform_project_in_one_command_line).
目的:学习 Cocos2d-x 如何支持多平台开发。
版本:
    基于 mac os x 系统
    基于 cocos2d-x-2.1.4
    基于 cocos2d-x 的 cocos2d-x-2.1.4/tools/project-creator/create_project.py 创建多平台项目目录结构
测试平台:
    iOS 通过
    mac os x 通过
    android 通过
mac & iOS:
mac($COCOS2DX_ROOT/projects/PlayThePlane/proj.mac) 和 iOS ($COCOS2DX_ROOT/projects/PlayThePlane/proj.ios) 直接打开目录下的工程文件即可
android:
请参考 How to create a multi-platform project in one command line.
android 下有不少坑要留意的。
其它平台
proj.linux 和 proj.win32 还会在话下么?
小编注:感谢开发者@者年 发布代码于Code4App.com。

    Flight war game by cocos2d-x

    1681 downloads

    Flight war game made by cocos2d-x。

  • 实现转盘菜单效果。转盘菜单用在建设银行的app中,点击转盘菜单上某个按钮,则菜单进行转动,被点击的按钮会慢慢被转到最前面。由于转动的过程中,按钮会有大变小或者由小变大,所以这个动画有3D的效果。

    Dial Menu

    1677 downloads

    A dial menu demo. Can scroll the screen to select different menu item。

  • 以Kal日历控件为基础,界面更新为IOS7扁平化风格。并且可以设置单选和范围选择两种模式。还可以设置初始选择日期和可选日期的范围。
作者说:Kal是一个日历控件(http://code4app.com/ios/4f7049e56803fad237000000),但是已经很久没有更新了。这是我的fork。
小编注:感谢开发者@文祥 发布代码于Code4App.com。

    Kal for IOS 7

    1553 downloads

    A calendar component for the iPhone (the UI is designed to match MobileCal)。