Recently Added iOS Source Code Examples

More >
  • 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。

  • ExampleCode:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    HorizontalScrollCell *hsc =[collectionView dequeueReusableCellWithReuseIdentifier:@"cvcHsc"
                                                                         forIndexPath:indexPath];
        
    [hsc setBackgroundColor:[UIColor colorWithRed:255.0f/255.0f green:255.0f/255.0f blue:255.0f/255.0f alpha:0.5f]];
    [hsc setUpCellWithArray:images];
    
    [hsc.scroll setFrame:CGRectMake(hsc.scroll.frame.origin.x, hsc.scroll.frame.origin.y, hsc.frame.size.width, 164)];
    
    hsc.cellDelegate = self;
    
    return hsc;
}

please refer the demo for detail usage.

    HorizontalScrollCell

    03/25/2015

    Horizontal Scrollable Cell for ios。

  • Code samples

The simple code to get SwiftSpinner running in your own app.

In case you installed SwiftSpinner via CocoaPods you need to import it (add this somewhere at the top of your source code file):
    import SwiftSpinner
When you want to show an animated activity (eg. rings are randomly rotating around):
     SwiftSpinner.show("Connecting to satellite...")
If you want to show a static activity indicator (eg. a message with two complete rings around it)
    SwiftSpinner.show("Failed to connect, waiting...", animated: false)
When you want to hide the activity:
    SwiftSpinner.hide()
That's all. If you want to change the text of the current activity, just call show(...) again, this will animate the old text into the new text.

Installation

SwiftSpinner is available through CocoaPods. To install it, simply add the following line to your Podfile:

    pod "SwiftSpinner"

    SwiftSpinner

    03/25/2015

    A beautiful activity indicator and modal alert written in Swift。

  • What is this?

You can use it in the Xcode, quickly find the location of the simulator.

Currently only supports Xcode6

    ZLGotoSandboxPlugin

    03/25/2015

    You can quickly enter the iOS simulator Xcode plugin!。

  • Demo of Core Animation Introduction

Internal share demo of Core Animation technology, including CALayer introduction and its applications. In addition, demonstrated how to implement shape transform animation using layer path property.

    ShareOfCoreAnimation

    03/24/2015

    Demo of Core Animation Introduction。

  • Text view with font size automatically adjustment according to its frame size.

RJTextView can magnify the text's font size as you increase the textview's frame size. Otherwise, when you reduce the frame size, the font size also shrink to make the text fit inside the text view. In addition, the text font size changes in response to adding or deleting texts.

    RJTextView

    03/24/2015

    Text view with font size automatically adjustment according to its frame size.。

  • UPStackMenu is a menu with a stack layout, that can be expanded and collapsed with some fancy animations.

Installation
CocoaPods
UPStackMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "UPStackMenu"
Manual
Simply copy the folder UPStackMenu to your project and import it in Xcode.

Usage
#import "UPStackMenu.h"
Now, you can create a UPStackMenu object by giving it a content view.
UPStackMenu *stack = [[UPStackMenu alloc] initWithContentView:aView];

Then, you can create some items that will be part of the stack.
UPStackMenuItem *item = [[UPStackMenuItem alloc] initWithImage:anImage highlightedImage:anImage title:aTitle];

Finally, add the items to the stack menu.
[stack addItems:@[item]];

Delegate
The delegate is optional and will be notified when some events occur:
- (void)stackMenuWillOpen:(UPStackMenu*)menu
- (void)stackMenuDidOpen:(UPStackMenu*)menu
- (void)stackMenuWillClose:(UPStackMenu*)menu
- (void)stackMenuDidClose:(UPStackMenu*)menu
- (void)stackMenu:(UPStackMenu*)menu didTouchItem:(UPStackMenuItem*)item atIndex:(NSUInteger)index

    UPStackMenu

    03/23/2015

    A fancy menu with a stack layout for iOS。

  • Usage

-(void)initScrollableTabbar
{
// Tab bar
UITabBarItem *item1 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:1];
UITabBarItem *item2 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemContacts tag:2];
UITabBarItem *item3 = ...
...
...
...

ZRScrollableTabBar *tabBar = [[ZRScrollableTabBar alloc] initWithItems:[NSArray arrayWithObjects: item1, item2, item3, item4, item5, item6, item7, item8, item9, nil]];
tabBar.scrollableTabBarDelegate = self;

[self.view addSubview:tabBar];
}

You will get the tabbar with selected index on delegate method

- (void)scrollableTabBar:(ZRScrollableTabBar *)tabBar didSelectItemWithTag:(int)tag
{
....
}
Installation

ZRScrollableTabBar is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ZRScrollableTabBar"

    ZRScrollableTabBar

    03/23/2015

    An easy scrollable TabBar。

  • MovieDB is a sample app implementing several UI patterns. It was firstly built to test a few different implementations of a details page.

    MovieDBApp

    03/23/2015

    MovieDB is a sample app implementing several UI patterns。

  • This demo app will animate the view just like Youtube mobile app, while tapping on video a UIView pops up from right corner of the screen and the view can be dragged to right corner through Pan Gesture and more features are there as Youtube iOS app . The whole design is done with Auto Layout and it is compatible with iOS 6 too.

DraggableYoutubeFloatingVideo allows you to play videos on a floating mini window at the bottom of your screen from sites like YouTube, Vimeo & Facebook or custom video url , yes you have to specify URL for that.

Usage
Initialize from a storyboard id programmatically. Set the video URL , then you're pretty much good to go! Check out the demo app to see how it can be used.

How it works
This demo app will animate the view just like Youtube mobile app, while tapping on video a UIView pops up from right corner of the screen and the view can be dragged to right corner through Pan Gesture and more features are there as Youtube iOS app

    DraggableYoutubeFloatingVideo

    03/23/2015

    play videos on a floating mini window at the bottom of your screen from sites like YouTube。

  • SAParallaxViewControllerSwift realizes parallax scrolling with blur effect. In addition, it realizes seamless opening transition.

Features
 -Parallax scrolling
 -Parallax scrolling with blur accessory view
 -Seamlees opening transition

Installation
CocoaPods
SAParallaxViewControllerSwift 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 "SAParallaxViewControllerSwift"

Refer the example project for Usage.

    SAParallaxViewControllerSwift

    03/23/2015

    realizes parallax scrolling with blur effect and seamless opening transition。

  • Features
-spring bounds effect
-simple use
-adjustable menu item height

Installation
Grab the files in KOMenuView/ and put it in your project.

Usage
first, import KOMenuView.h
_blurMenuView = [KOMenuView menuViewWithItem:@[@"Menu 01",@"Menu 02",@"Menu 03",@"Menu 04",@"Menu 05"]
                               withPlaceView:self.view
                            withClickByIndex:^(NSInteger itemIndex) {
                                NSLog(@"itemIndex : %ld",(long)itemIndex);
                            }];
or you can custom menu item height

_blurMenuView = [KOMenuView menuViewWithItem:@[@"Menu 01",@"Menu 02",@"Menu 03",@"Menu 04",@"Menu 05"]
                                  itemHeight:60.f
                               withPlaceView:self.view
                            withClickByIndex:^(NSInteger itemIndex) {
                                NSLog(@"itemIndex : %ld",(long)itemIndex);
                            }];
you can set other funtion if you want

_blurMenuView.foldMenuWhenClickItem = YES;   ///fold menu automatically when select item, default NO
_blurMenuView.animaDuration = 0.3;          ///animation duration, default 0.25

    KOMenuView

    03/20/2015

    Simple foldable bottom menu。

Popular Code

More >