Inherits from TKCustomPresentationViewController : UIViewController
Conforms to UICollisionBehaviorDelegate
Declared in TKCardModalViewController.h
TKCardModalViewController.m

Overview

TKCardModalViewController is a custom presented UIViewController with a main white card view that drops in and can be easily dismissed similiar to a UIAlertView.

Properties

animator

The animator that controls the card physics animation.

@property (nonatomic, strong) UIDynamicAnimator *animator

Declared In

TKCardModalViewController.h

attachmentBehavior

The animator that controls the card physics animation.

@property (nonatomic, strong) UIAttachmentBehavior *attachmentBehavior

Declared In

TKCardModalViewController.h

backgroundView

The background view that appears behind the content view. Place and snapshots or backdrops here.

@property (nonatomic, strong) UIView *backgroundView

Declared In

TKCardModalViewController.h

contentView

The main card view that appears that content should be placed on.

@property (nonatomic, strong) UIView *contentView

Declared In

TKCardModalViewController.h

itemBehavior

The item behavior of the card.

@property (nonatomic, strong) UIDynamicItemBehavior *itemBehavior

Declared In

TKCardModalViewController.h

onlyAllowTapOffCardToDismiss

Flag to only allow the user to tap off the card and not on the contentView itself. Default is FALSE.

@property (nonatomic, assign) BOOL onlyAllowTapOffCardToDismiss

Declared In

TKCardModalViewController.h

pushBehavior

The push behavior from the velocity of the pan gesture.

@property (nonatomic, strong) UIPushBehavior *pushBehavior

Declared In

TKCardModalViewController.h

tapToDismissEnabled

Flag to enabled tap to dismiss the card. Default is TRUE.

@property (nonatomic, assign) BOOL tapToDismissEnabled

Declared In

TKCardModalViewController.h

throwToDismissEnabled

Flag that allows the the user to throw the card off to dismiss it. Default is TRUE.

@property (nonatomic, assign) BOOL throwToDismissEnabled

Declared In

TKCardModalViewController.h

velocity

The velocity from a pan gesture on the card.

@property (nonatomic, assign) CGPoint velocity

Declared In

TKCardModalViewController.h

visibleFrame

If a keyboard is displayed. The visible frame will adjust.

@property (nonatomic, assign) CGRect visibleFrame

Declared In

TKCardModalViewController.h

Instance Methods

dismissTransitionAnimation:containerView:toViewController:

Subclass this method to create a custom dismissal transition.

- (void)dismissTransitionAnimation:(id<UIViewControllerContextTransitioning>)transitionContext containerView:(UIView *)containerView toViewController:(UIViewController *)viewController

Parameters

transitionContext

The UIViewControllerContextTransitioning that governs the presentation.

containerView

The container view to place this view controller’s view.

toViewController

The parent view controller.

Declared In

TKCustomPresentationViewController.h

hide

This will hide the view controller.

- (void)hide

Declared In

TKCardModalViewController.h

keyboardWillHide:

A notification callback that a keyboard will hide.

- (void)keyboardWillHide:(NSNotification *)notification

Parameters

notification

The NSNotification sender.

Declared In

TKCardModalViewController.h

keyboardWillShow:

A notification callback that a keyboard will be shown.

- (void)keyboardWillShow:(NSNotification *)notification

Parameters

notification

The NSNotification sender.

Declared In

TKCardModalViewController.h

pan:

The function called when a pan gesture is called. For subclassing.

- (void)pan:(UIPanGestureRecognizer *)gesture

Parameters

gesture

The UIPanGestureRecognizer sender.

Declared In

TKCardModalViewController.h

presentTransitionAnimation:containerView:fromViewController:

Subclass this method to create a custom presentation transition.

- (void)presentTransitionAnimation:(id<UIViewControllerContextTransitioning>)transitionContext containerView:(UIView *)containerView fromViewController:(UIViewController *)viewController

Parameters

transitionContext

The UIViewControllerContextTransitioning that governs the presentation.

containerView

The container view to place this view controller’s view.

fromViewController

The parent view controller.

Declared In

TKCustomPresentationViewController.h

show

This will present the view controller

- (void)show

Declared In

TKCardModalViewController.h

tapped:

The function called when a tap gesture is called. For subclassing.

- (void)tapped:(UITapGestureRecognizer *)sender

Parameters

sender

The UITapGestureRecognizer sender.

Declared In

TKCardModalViewController.h