GithubHelp home page GithubHelp logo

lmirosevic / gbcardstack Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 3.0 2.64 MB

iOS UI paradigm for a stack of sliding cards. Used in VLC iRemote

Home Page: http://www.goonbee.com/apps/vlc-remote

License: Apache License 2.0

Ruby 2.63% Objective-C 97.37%

gbcardstack's Introduction

GBCardStack Version License

Sliding card UI paradigm for iOS. Currently used by VLC iRemote on the App Store.

Left view Main view Right view

Similar to the "sliding main view" in the Facebook and Path apps, except it supports all 4 directions, manages autohiding properly, supports sliding by: pan gesture, tap gesture and programatically.

Usage

First import header:

#import <GBCardStack/GBCardStack.h>"

Create a GBCardStackController instance and add the cards to it (here we add all cards except for on the bottom):

GBCardStackController *cardStackController = [[GBCardStackController alloc] init];

self.cardStackController.leftCard = [LeftViewController new];
self.cardStackController.mainCard = [MainViewController new];
self.cardStackController.topCard = [TopViewController new];
self.cardStackController.rightCard = [RightViewController new];

Present your GBCardStackController instance like you would any other view controller (shown here as the rootViewController of the window):

self.window.rootViewController = cardStackController;

In your view controllers which you place in the card stack, define which views are slideable. You should add any UIView subclass which responds to UITouch events (i.e. has userInteractionEnabled set to YES) which you want to still trigger a card slide. If you don't do this then only that UIView subclass will receive touch events and it will not cause the underlying card to slide as the user pans. You would normally put any UIButton's in here, but not a UISlider because you wouldn't want a pan inside a pan. You might need to include UIViewController+GBCardStack.h in your UIViewController subclass.

[self.slideableViews addObject:self.someButton];

Demo project

See: github.com/lmirosevic/GBCardStackDemo

Dependencies

Copyright & License

Copyright 2015 Luka Mirosevic

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Bitdeli Badge

gbcardstack's People

Contributors

lmirosevic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.