• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language
    Objective-C
  • Created about 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

iOS project for presenting views with a 3D effect to add depth

JFDepthView

This is an iOS project for presenting views in iOS with a 3D effect to add depth. JFDepthView is only available in ARC and targets iOS 7.0+.

What's New:

February 26th, 2014

  • Added new animation options. In addition to the normal blur/push back affect you can now choose any of the following animation options.

    • JFDepthViewAnimationOptionPushBack
    • JFDepthViewAnimationOptionPushBackAndBlur
    • JFDepthViewAnimationOptionPerspectiveTransform
    • JFDepthViewAnimationOptionPerspectiveTransformAndBlur
  • Removed previously deprecated initializer initWithGestureRecognizer:

  • Removed GPUImage dependency (Bad idea to add it in the first place, my bad)

  • Reduced the number of frameworks needed down to only 3 (win!)

  • Now targets iOS 7+ only

  • Code refactoring and optimization

  • Added subtle bounce to presented view (Trust me, it's beautiful, like a baby unicorn)

January 29th, 2013

  • JFDepthView now supports both iPad and iPhone.

What It Looks Like:

iPad

iPad

iPhone

iPhone

Video (Shows all presentation animations for both iPhone and iPad)

See it in action here: http://www.youtube.com/watch?v=X5lmn5y-FUw

How To Use It:

Basic Example

#import <JFDepthView/JFDepthView.h>

...

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.topViewController = [[TopViewController alloc] initWithNibName:@"TopViewController" bundle:nil];
    UITapGestureRecognizer* tapRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismiss)];
    self.depthView = [[JFDepthView alloc] init];
    self.depthView.delegate = self;
    
    // Optional properties, use these to customize your presentations
    // self.depthView.presentedViewWidth = 700;
    // self.depthView.presentedViewOriginY = 200;
    // self.depthView.blurAmount = JFDepthViewBlurAmountHard;
    // self.depthView.animationOption = JFDepthViewAnimationOptionPushBackAndBlur;
	self.depthView.recognizer = tapRec;
}

// Here is an IBAction that is called via a UIButton
- (IBAction)presentView:(id)sender {
    
    // Pass in the view controller you want to present (self.topViewController) 
    // and the view you want it to be displayed within (self.view)
    [self.depthView presentViewController:self.topViewController inView:self.view];
    
    // Optionally, if you don't care about rotation support, you can just pass in 
    // the view you want to present (self.topViewController.view) 
    // and the view you want it to be displayed within (self.view)
    // [self.depthView presentView:self.topViewController.view inView:self.view];
}

// Here is the simple dismissal method called from the tap recognizer passed into init method of JFDepthView
- (void)dismiss {
    [self.depthView dismissPresentedViewInView:self.view];
}

Customizable Properties

/**
 * JFDepthView - presentedViewWidth
 *
 * @return A custom float value representing the desired width of the presented view. Default value is 600.
 */
@property (nonatomic, assign) CGFloat presentedViewWidth;

/**
 * JFDepthView - presentedViewOriginY
 *
 * @return A custom float value representing the desired y origin of the presented view.
 * This is the space from the top of the presented view to the top of the view that it is contained in.
 */
@property (nonatomic, assign) CGFloat presentedViewOriginY;

/**
 * JFDepthView - blurAmount
 *
 * @return A JFDepthViewBlurAmount enum value representing to desired blur amount for the background view behind the presented view. Default value is JFDepthViewBlurAmountMedium.
 */
@property (nonatomic, assign) JFDepthViewBlurAmount blurAmount;

/**
 * JFDepthView - animationOption
 *
 * @return A JFDepthViewAnimationOption enum value representing the desired animation for the presentation. Default value is JFDepthViewAnimationOptionPerspectiveTransform.
 */
@property (nonatomic, assign) JFDepthViewAnimationOption animationOption;

/**
 * JFDepthView - hideStatusBarDuringPresentation
 *
 * @return A BOOL to tell JFDepthView to hide the status bar while presenting or not. Default is NO.
 */
@property (nonatomic, assign) BOOL hideStatusBarDuringPresentation;

/**
 * JFDepthView - recognizer
 *
 * @return The UIGestureRecognizer to be used on the area around the presentedView to dismiss the presentedView.
 */
@property (nonatomic, strong) UIGestureRecognizer* recognizer;

Add rotation support to your Presenting UIViewController

#pragma mark - JFDepthView Rotation Support For Presenting UIViewController

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
    [self.depthView didRotateFromInterfaceOrientation:fromInterfaceOrientation];
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
    [self.depthView willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
}

JFDepthView will notify your Presented UIViewController of the didRotate... and willRotate... events so you can do what ever customizations need to be done to your presented view

#pragma mark - JFDepthView Rotation Support for Presented UIViewController

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    NSLog(@"Top View Controller Received didRotateFromInterfaceOrientation: event from JFDepthView");
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    NSLog(@"Top View Controller Received willRotateToInterfaceOrientation:duration: event from JFDepthView");
}

Please see the example project include in this repo for an example of how to use this project.

Delegate Methods:

- (void)willPresentDepthView:(JFDepthView*)depthView;
- (void)didPresentDepthView:(JFDepthView*)depthView;
- (void)willDismissDepthView:(JFDepthView*)depthView;
- (void)didDismissDepthView:(JFDepthView*)depthView;

Installation:

Add the JFDepthView project to your project

  • Simply copy the JFDepthView folder (containing the JFDepthView class and Vendor/ folder) into your project.

Add Dependencies

  • In your application's project app target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block
  • Click the "+" button and add the following frameworks frameworks

Current Known Issues As Of: Oct. 23rd, 2013

  • No known issues. If you find any, please report them using a GitHub Issue. Thanks! :)

License

Copyright (c) 2012 Jeremy Fox (jeremyfox.me). All rights reserved.

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.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

JFMinimalNotifications

An iOS UIView for presenting a minimalistic notification that doesn't block the UI and is highly configurable.
Objective-C
942
star
2

JFCardSelectionViewController

A fancy collection style view controller
Swift
431
star
3

ios_build_scripts

Build scripts that can be used to update build # and upload binary to Fabric/HockeyApp as well as post notifications into Slack/HipChat from an Xcode Bot
Shell
22
star
4

PhotoMojo

PhotoMojo is a very simple Android application for editing photos from the Camera or Gallery
Java
14
star
5

PriorityQueue-ObjC

A PriorityQueue for Objective-C/iOS Developers
Objective-C
8
star
6

pivotal-tracker-api

This is a Ruby Gem that can be used to communicate with the Pivotal Tracker API v5
Ruby
7
star
7

Stylus.mode

Stylus color mode for Coda
7
star
8

JFTransporter

An Objective-C Networking abstraction to help make setting up a service layer in an iOS app much quicker and easier
Objective-C
4
star
9

NotificationQueue

An iOS library used to handle queuing and scheduling of notifications for presentation by registered notification handlers
Swift
3
star
10

PetFinderAPI

Pet Finder API iOS Framework
HTML
2
star
11

HTTPService

An HTTP Networking Service written in Swift
Swift
2
star
12

Ultimate-Notifications

Module for showing kick ass notifications in a Titanium Mobile application!
Python
2
star
13

android-analytics

A lightweight framework for abstracting analytics code and wrapping analytics providers
Kotlin
2
star
14

demo_app

Ruby on Rails demo application
Ruby
1
star
15

iOS-Slider

Objective-C
1
star
16

billplanner-cloudant

Billplanner on Cloudant
JavaScript
1
star
17

avfdemo

AVF Demo App
JavaScript
1
star
18

atljeremy.github.com

My personal home on GitHub/The Web
HTML
1
star
19

Floid

Kotlin Flow Based Reactive Architecture
Kotlin
1
star
20

jeremyfox

www.jeremyfox.me scala play 2 app
Scala
1
star
21

Bill-Planner

JavaScript
1
star
22

LoaderView

A loading view written in Swift to be used with iOS and OSX
Swift
1
star
23

first_app

First app for ruby on rails tutorial
Ruby
1
star
24

SDI-Project-4

CoffeeScript
1
star
25

pushservice

Scala
1
star
26

iospracticeapp

iOS Practice App / Tool Kit
Objective-C
1
star
27

JFAnalyticsClient

Objective-C analytics client that utilizes http://keen.io as the data store.
Objective-C
1
star
28

my_notes_hybrid

My Notes Android application with a web view for hybrid implementation
Java
1
star
29

VFW-Project-1

JavaScript
1
star
30

avfdemoandroid

AVF Demo App For Android
JavaScript
1
star
31

aoc1

Apple Programming Language Objective-C 1
Objective-C
1
star
32

SDI---Project-3

CoffeeScript
1
star
33

Extensions

A slew of Extensions that were built for use in iOS but should also be useful in OS X and tvOS too
Swift
1
star