Giter Site home page Giter Site logo

cardsqeqe's Introduction

Cards

A container view controller controlling a stack of cards.

example gif

Installation

Add the following to your Podfile:

pod "Cards",    git: "https://github.com/yourkarma/Cards"

Documentation

The primary class is the CardStackController. It supports pushing and popping any UIViewController subclass using respectively pushViewController:animated:completion: and popViewControllerAnimated:completion:. The first view controller pushed automatically becomes the rootViewController and fills the CardStackController's view.

Subsequent view controllers are pushed on top, the position of each card is determined by the internal CardAppearanceCalculator struct.

Like UITabBarController and UINavigationController a convenience cardStackController property is provided as an extension on UIViewController.

If side effects are necesarry before, during or after a transtion the CardStackTransitionCoordinator can be used to get notified of these events. Additionally, a delegate is provided on CardStackController that notifies when cards will appear/disappear and did appear/disappear.

The CardViewController uses an internal Card struct to keep track of which view controllers are being presented as cards and the associated view hierarchy and it's constraint. The card uses three custom UIKit subclasses to manage the appearance of the cards:

  • CardMaskShapeLayer a CAShapeLayer subclass that supports animating the path property. This is required to properly animated the mask when a trait change occurs.
  • CardMaskView a custom UIView subclass. Uses the CardMaskShapeLayer to create top rounded corners.
  • CardScrollView a custom UIScrollView subclass that prevents tracking when interacting with a button.

Example

An example application is included. It shows some of the basic usages of the CardStackController.

cardsqeqe's People

Contributors

klaaspieter avatar asowers1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.