Recently Added iOS Source Code Examples

More >
  • Usage

Create a instance of any UIView subclass.
Call the show(modalView: , inView: ) of PathDynamicModal class-function or instance-function.
For detail, please refer to Demo-project.
Functions

class func show(modalView view: UIView, inView: UIView) -> PathDynamicModal // Show modal with settings default all.
func show(modalView view: UIView, inView: UIView) // Show modal with custom settings.
func closeWithLeansRandom() // Close modal with random slant.
func closeWithStraight() // Close modal with non slant.
func closeWithLeansRight() // Close modal with right slant.
func closeWithLeansLeft() Close modal with left slant.
Property

var backgroundColor: UIColor // Default is UIColor.blackColor()
var backgroundAlpha: CGFloat // Default is 0.7 
var showMagnitude: CGFloat // Default is 250.0. This affects the speed of modal dropping to show.
var closeMagnitude: CGFloat // Default is 170.0. This affects the speed of modal dropping to close.
var closeByTapBackground: Bool // Default is true
var closeBySwipeBackground: Bool // Default is true
var showedHandler: (() -> Void)?
var closedHandler: (() -> Void)?

More detail please refer the demo.

    PathDynamicModal

    05/15/2015

    A modal view using UIDynamicAnimator, like the Path for iOS。

  • A nice and simple tags input control for iOS.

You are able to easily setup different colors for control elements and set different displaying modes

Switching between displaying modes

You are able to switch between displyaing modes by setting the mode property

@property (nonatomic) TLTagsControlMode mode;
TLTagsControl has two displaying modes:

TLTagsControlModeEdit,
This mode allows user to input new tags and delete tags that are already presented.

In this mode control will look like below:

Screenshot

TLTagsControlModeList,
This mode allows only listing of already presented tags

In this mode control will look like below:

Screenshot

Setting different colors of control elements

You are able to change colors of different element by setting these prperties

@property (nonatomic, strong) UIColor *tagsBackgroungColor;
@property (nonatomic, strong) UIColor *tagsTextColor;
@property (nonatomic, strong) UIColor *tagsDeleteButtonColor;
Applying changes

To apply your changes you should call the method below

- (void)reloadTagSubviews;
Example:

//assuming tagControl will be set initialized from stroryboard
@interface ViewController ()

@property (nonatomic, strong) IBOutlet TLTagsControl *tagControl;

@end

....

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  UIColor *blueBackgroundColor = [UIColor colorWithRed:75.0/255.0 green:186.0/255.0 blue:251.0/255.0 alpha:1];
  UIColor *whiteTextColor = [UIColor whiteColor];

  self.tagControl.tagsBackgroungColor = blueBackgroundColor;
  self.tagControl.tagsDeleteButtonColor = whiteTextColor;
  self.tagControl.tagsTextColor = whiteTextColor;

  self.tagControl.mode = TLTagsControlModeList;

  [self.tagControl reloadTagSubviews];
}

@end

    TLTagsControl

    05/15/2015

    A nice and simple tags input control for iOS。

  • A simple control for implementing a beautiful scrolling segment control. With adaptive gradient to tease the user to explore all the items in the list. Fully customizable either by code or using interface builder.

    YAScrollSegmentControl

    05/14/2015

    Beautiful and easy to use scrolling segment control.。

  • KDCircularProgress is a circular progress view written in Swift. It makes it possible to have gradients in the progress view, along with glows and animations.

    KDCircularProgress(Swift)

    05/14/2015

    A circular progress view with gradients written in Swift。

  • Most simple usage:

// Get four dominant colors from the image, but avoid the background color of our UI
CCColorCube *colorCube = [[CCColorCube alloc] init];
UIImage *img = [UIImage imageNamed:@"test2.jpg"];
NSArray *imgColors = [colorCube extractColorsFromImage:img avoidColor:myBackgroundColor co

    ColorCube

    05/11/2015

    Dominant color extraction from RGB images on iOS。

  • SwiftNotice is a GUI library for displaying various popups written in pure Swift, fits any scrollview.

    SwiftNotice

    05/05/2015

    GUI library for displaying various popups, written in pure Swift.。

  • 
Configure
Checkout PPDragDropBadgeView from github.
Copy PPDragDropBadgeView folder to your project.
Go to 'TARGET' -> 'Build Phases' -> 'Complile Sources', add compliler flags '-fno-objc-arc' for 'PRTween.m' and 'PRTweenTimingFunctions.m'
Done.
You can also refer to the example project provided by me.

Usage

Q: How to use PPDragDropBadgeView?
A: Very simple, you only follow the down code.

PPDragDropBadgeView* badgeView \
= [[PPDragDropBadgeView alloc] initWithSuperView:self.testView
                                    location:CGPointMake(0,0)
                                      radius:10.0f dragdropCompletion:^{
                                                     NSLog(@"Drag drop done.");
                                       }];
badgeView.text = @"6";
Q: Does it can be customized?

A: Of course, you can set "location", "radius", "tintColor", "borderWidth", "borderColor". You can see the propertys provided by me.

/** The location of badge view. */
@property (nonatomic, assign) CGPoint location;

/** The radius of badge view. */
@property (nonatomic, assign) CGFloat radius;

/** The completion block when drag drop done. */
@property (nonatomic, copy) void(^dragdropCompletion)();

/** The tint color of badge view. Default is red */
@property (nonatomic, strong) UIColor* tintColor;

/** The border color of badge view. Default is clear */
@property (nonatomic, strong) UIColor* borderColor;

/** The border width of badge view. Default is 1.0f */
@property (nonatomic, assign) CGFloat borderWidth;

/** The text of badge view. */
@property (nonatomic, strong) NSString* text;

    PPDragDropBadgeView

    04/30/2015

    PPDragDropBadgeView is a badge view which able to drag and drop. Just like QQ 5.0 badge view.。

  • Usage

Instantiate and set delegate and dataSource as you know,

self.pickerView = AKPickerView(frame: <#frame#>)
self.pickerView.delegate = self
self.pickerView.dataSource = self
then specify the number of items using AKPickerViewDataSource,

func numberOfItemsInPickerView(pickerView: AKPickerView) -> Int {}
and contents to be shown. You can use either texts or images:

func pickerView(pickerView: AKPickerView, titleForItem item: Int) -> NSString {}
// OR
func pickerView(pickerView: AKPickerView, imageForItem item: Int) -> UIImage {}
Using both texts and images are currently not supported. When you implement both, titleForItem will be called and the other won't.
You currently cannot specify image sizes; AKPickerView shows the original image in its original size. Resize your images in advance if you need.
You can change its appearance with properties below:

var font: UIFont
var highlightedFont: UIFont
var textColor: UIColor
var highlightedTextColor: UIColor
var interitemSpacing: CGFloat
var viewDepth: CGFloat
var pickerViewStyle: AKPickerViewStyle
All cells are laid out depending on the largest font, so large differnce between the sizes of font and highlightedFont is NOT recommended.
viewDepth property affects the perspective distortion. A value near the screen's height or width is recommended.
After all settings, never forget to reload your picker.

self.pickerView.reloadData()
Optional: You can use AKPickerViewDelegate methods to observe selection changes:

func pickerView(pickerView: AKPickerView, didSelectItem item: Int) {}

CocoaPods:

In your Podfile:
pod "AKPickerView-Swift"

And in your *.swift:
import AKPickerView_Swift

    AKPickerView-Swift

    04/24/2015

    A simple yet customizable horizontal picker view。

  • Usage:
self.indicatorView1 = MAActivityIndicatorView(frame: self.viewForActivity1.frame)
            self.indicatorView1.defaultColor = UIColor.redColor()
            self.indicatorView1.animationDuration    = 1
            self.indicatorView1.numberOfCircles      = 15
            self.indicatorView1.maxRadius            = 40
            self.indicatorView1.delegate = self
           // self.indicatorView1.backgroundColor = UIColor.lightGrayColor()
            self.indicatorView1.startAnimating()
            self.view.addSubview(self.indicatorView1)

    MAActivityIndicator

    04/24/2015

    a custom activity indicator with little dots written in Swift。

  • Custom Calendar for iOS Grid Calendar view for iOS created by Jubin Jacob (jubinjacob19@gmail.com) Swipe to change months.

Delegate displays selected date(NSDate) on selection of a date.

Datasource allows some days to be highlighted and the calendar to be « locked » between a starting month and an ending month.

    CustomCalendar

    04/10/2015

    Custom Calendar for iOS。

  • JDFPeekaboo is a simple class that hides the navigation bar when you scroll down, and shows it again when you scroll back up. It can actually be any UIView that it hides, and it will also hide a view at the bottom of the screen as well, if you like.

It's very easy to use. Simply add a property for it:

@property (nonatomic, strong) JDFPeekabooCoordinator *scrollCoordinator;
Then, set it up (say, in -viewDidLoad):

self.scrollCoordinator = [[JDFPeekabooCoordinator alloc] init];
self.scrollCoordinator.scrollView = self.scrollView;
self.scrollCoordinator.topView = self.navigationController.navigationBar;
self.scrollCoordinator.bottomView = self.navigationController.toolbar;
Sometimes, you may want to temporarily disable JDFPeekaboo, for example when you push another view controller onto your navigation controller. Some convenience methods are provided for disabling JDFPeekaboo (and re-enabling it).

    JDFPeekaboo

    04/10/2015

    JDFPeekaboo is a simple class that hides the navigation bar when you scroll。

  • Recreate Twitter's profile page scrolling animation for UITableView and UIScrollViews. Librarys uses Core graphics framework and is based of thinkandbuild.it's swift tutorial converted into Obj-C.

Installation

From CocoaPods
MBTwitterScroll is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MBTwitterScroll"

Manually
Copy the source files MBTwitterScroll folder into your project.

Usage
#import "MBTwitterScroll.h"

UITableView

To show animation on UITableVIew use the following code:

    MBTwitterScroll *myTableView = [[MBTwitterScroll alloc]
                                    initTableViewWithBackgound:[UIImage imageNamed:@"your image"]
                                    avatarImage:[UIImage imageNamed:@"your avatar"]
                                    titleString:@"Main title"
                                    subtitleString:@"Sub title"
                                    buttonTitle:@"Follow"];  // Set nil for no button
    myTableView.delegate = self;
    [self.view addSubview:myTableView];


UIScrollView

To show animation on UIScrollView use the following code:

   MBTwitterScroll *myScrollView = [[MBTwitterScroll alloc]
                                      initScrollViewWithBackgound:nil
                                      avatarImage:[UIImage imageNamed:@"avatar.png"]
                                      titleString:@"Main title"
                                      subtitleString:@"Sub title"
                                      buttonTitle:@"Follow" // // Set nil for no button
                                      contentHeight:2000];
    myScrollView.delegate = self;
    [self.view addSubview:myScrollView];

    MBTwitterScroll

    03/30/2015

    Recreate Twitter's profile page scrolling animation for UITableView and UIScrollViews。

  • Installation

The easiest way to get started is to use CocoaPods. Add the following line to your Podfile:
platform :ios, '8.0'
use_frameworks!
# The following is a Library of Swift.
pod 'MediumMenu'
Then, run the following command:

pod install
Or add the MediumMenu (including MediumMenu.swift) folder into your project.

Due to the lack of choice whether status bar is hidden or not, Edit info.plist in your project.

Add "Status bar is initially hidden" and "View controller-based status bar appearance" in info.plist as key. Eash value is "YES" and "NO".

In the rest of the details, refer to MediumMenu-Sample project.

    MediumMenu

    03/30/2015

    A menu based on Medium iOS app。

  • You can use secret command with swipe gesture and A, B button. Show a secret mode you want!
Features
-Secret command register
-Unlock with secret command
- Show input command with animation

Installation

CocoaPods
SASecretCommandViewController is available through CocoaPods. If you have cocoapods 0.36 beta or greater, you can install it, simply add the following line to your Podfile:
pod "SASecretCommandViewController"

Manually
Add the SASecretCommandViewController directory to your project.

See the example project for the detail usage.

    SASecretCommandViewController

    03/27/2015

    SASecretCommandViewController。

  • HoleView, holes methods

- (NSInteger)addHoleCircleCenteredOnPosition:(CGPoint)centerPoint andDiameter:(CGFloat)diamter;
- (NSInteger)addHoleRectOnRect:(CGRect)rect;
- (NSInteger)addHoleRoundedRectOnRect:(CGRect)rect withCornerRadius:(CGFloat)cornerRadius;
- (NSInteger)addHCustomView:(UIView *)customView onRect:(CGRect)rect;

HoleView Delegation : JMHoledViewDelegate

This method will be called if you configure a holeViewDelegate. The index is equal to NSNotFound if user touch dimingView.

- (void)holedView:(JMHoledView *)holedView didSelectHoleAtIndex:(NSUInteger)index;

    JMHoledView

    03/27/2015

    A view design to be filled with holes。

  • Usage

Import category #import <UIViewController-KeyboardAdditions/UIViewController+KeyboardAdditions.h>

Register to keyboard notifications in -viewWillAppear::

[self ka_startObservingKeyboardNotifications];
Unregister from notifications in -viewWillDisappear::
[self ka_stopObservingKeyboardNotifications];
Perform any layout with same animation options as keybord:
- (void)ka_keyboardShowOrHideAnimationWithHeight:(CGFloat)height
                               animationDuration:(NSTimeInterval)animationDuration
                                  animationCurve:(UIViewAnimationCurve)animationCurve {

    self.containerViewBottomConstraint.constant = height;
    [self.view layoutIfNeeded];
}

    UIViewControllerKeyboardAdditions

    03/27/2015

    Tiny UIViewController category that provides handy way for keyboard handling logic。

  • ABCIntroView is an easy to use onboarding which allows you to introduce your users to the applicaiton before reaching the Main Screen.

To use the ABCIntroView please do the following:

Add the follwing files found in the CLASSES folder to your project:
        *ABCIntroView.h
        *ABCIntroView.m
Import the ABCIntoView file to your RootViewController.

Create an ABCIntroView property and add the ABCIntroViewDelegate.

Add the following line of code to your ViewDidLoad:

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if (![defaults objectForKey:@"intro_screen_viewed"]) {
        self.introView = [[ABCIntroView alloc] initWithFrame:self.view.frame];
        self.introView.delegate = self;
        self.introView.backgroundColor = [UIColor greenColor];
        [self.view addSubview:self.introView];  
    }
Add the ABCIntroView Delegate Method:
#pragma mark - ABCIntroViewDelegate Methods

-(void)onDoneButtonPressed{
    //    Uncomment so that the IntroView does not show after the user clicks "DONE"
    //    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]
    //    [defaults setObject:@"YES"forKey:@"intro_screen_viewed"];
    //    [defaults synchronize];
    [UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        self.introView.alpha = 0;
    } completion:^(BOOL finished) {
        [self.introView removeFromSuperview];
    }];
}

    ABCIntroView

    03/27/2015

    an easy to use onboarding which allows you to introduce your users to the applicaiton before reaching the Main Screen。

  • Usage:
set the mark through a plist file&#40;refer the demo's plist&#41;

 NSDictionary* coachMarkDict =
    [NSDictionary
     dictionaryWithContentsOfFile:[[NSBundle mainBundle]
                                   pathForResource:@"coachmark1"
                                   ofType:@"plist"]];
    PIImageCoachmark* coachmark1 = [[PIImageCoachmark alloc] initWithDictionary:coachMarkDict];


    PICoachmarkScreen* screen1 = [[PICoachmarkScreen alloc] initWithCoachMarks:@[coachmark1]];

];
    [window addSubview:coachMarksView];
    [coachMarksView setScreens:@[screen2, screen1]];
    [coachMarksView start];

See the example project for the Usage.

    PICoachmark

    03/25/2015

    A extensible and easy coach mark libary。

Popular Code

More >
  • 类似于Faceboo App的Stacked View。点击主界面上的一个按钮时,主界面左边滑动一半显示出一个子视图,点击列表上任意一行,右边部分出现新内容,左边子视图滑出界面。当对左边视图进行搜索时,左边一半界面的视图变成全界面显示搜索内容。

    SideBar Navigation

    2347 downloads

    A clone of the new Facebook iOS UI paradigm。

  • 实现网易新闻app/新浪微博app中手指右滑屏幕返回上一层视图的交互。利用UINavigationControler组织多层,即也可以用导航栏(UINavigationBar)的返回按钮返回上一层。支持视图上有scrollview等页面。
小编注:这份代码比较好地模仿了网易新闻/新浪微博app右滑屏幕返回的交互效果,推荐!感谢作者@Feather-Mie 分享原创代码于Code4App。

    Multi Layer Navigation

    2324 downloads

    Drag to go back Interaction Implementaion。

  • 获取系统emoji表情,实现表情键盘,输入框能够随着输入文字的长度而自动增长,模仿微信键盘,能够切换文字键盘和表情键盘。
小编注:感谢作者@好好happy好好 分享原创代码于Code4App。

    custom emoji keyboard

    2053 downloads

    custom emoji keyboard。

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

    Dial Menu

    1677 downloads

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

  • 自定义相机拍摄界面,仿照Instagram。
小编注:感谢开发者@Aevit 发布代码于Code4App.com。

    SCCaptureCamera

    1673 downloads

    A Custom Camera with AVCaptureSession to take a square picture. And the UI is patterned on Instagram。

  • 实现效果多样的HUD。这是小编看过的效果最多样化的HUD。可以设置很多关于HUD动画和外观的参数。包括,可以设置HUD是否有边框(border),设置HUD出现和消失的方式(包括上下、左右、淡入淡出、放大缩小等等),设置HUD的内容(可以在HUD中加入帧动画、动态图片等等),设置HUD出现时的底部覆盖层颜色,等等。总而言之,这是一份集大成的HUD代码。慢慢看视频吧,囊括了所有效果。
小编注:不过,可惜的是这么多效果,却没有扁平化风格(Flat UI)的效果。

    MMProgressHUD

    1651 downloads

    An easy-to-use HUD interface with personality。

  • 很方便自定义各种 Tab Bar 外观,也可以用作 Tool Bar。

    RKTabView

    1611 downloads

    Easy applicable toolbar/tabbar component for iOS。