Code Monkey home page Code Monkey logo

swipeabletabbarcontroller's Introduction

SwipeableTabBarController

Version License iOS 8.0+ Swift 4.2 codebeat badge


The iPhone mockups can be found here & here.

All the designs belong to To Do App UI kit by Invision.

Installation

CocoaPods

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

pod "SwipeableTabBarController"

Manual

Drop the classes inside of SwipeableTabBarController/Classes into your project.

Usage

If you don't need subclassing UITabBarController just set the UITabBarController on the Storyboard to be of type SwipeableTabBarController.

Otherwise, make a subclass of SwipeableTabBarController.

Example:

import SwipeableTabBarController

class TabBarController: SwipeableTabBarController {
    // Do all your subclassing as a regular UITabBarController.
}

Animations

SwipeableTabBarController supports 3 different types of animations out of the box. Setting the desired animation is easy. On your SwipeableTabBarController subclass just do:

setSwipeAnimation(type: SwipeAnimationType.push)

If you are supporting just one type of animation call it on viewDidLoad() otherwise call it as you need to change the desired animation.

Side by Side (default)

The default animation is SwipeAnimationType.sideBySide where the newly selected tab will move in at the same speed the previous one moves out.

Overlap

SwipeAnimationType.overlap the newly selected tab will move in to take the central place on top of the previous one which will hold it's position.

Push

SwipeAnimationType.push follows iOS default push animation where the top view moves away while the bottom one slightly moves behind. In this case, the top view will be the previously selected tab view.

Restricted Swipe

You can choose to restrict your swiping to perfect horizontal swipe or support diagonal movement as well. I recommend enabling horizontal swipe if you are not using any kind of scrollViews on your controllers.

Default value is false

setDiagonalSwipe(enabled: true)

Disable Interaction

Support for disabling/enabling the interactor, this can be used on a controller that uses horizontal scrollView or a Map (in the example).

Default value is true

setTabBarSwipe(enabled: false)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Project Details

Requirements

  • Swift 4.1
  • Xcode 8.0+
  • iOS 8.0+

Contributing

Feel free to collaborate with ideas ๐Ÿ’ญ, issues โ‰๏ธ and/or pull requests ๐Ÿ”ƒ.

If you use SwipeableTabBarController in your app I'd love to hear about it and feature your animation here!

Contributors

Author

Marcos Griselli | @marcosgriselli

Twitter Follow

License

Copyright (c) 2017 Marcos Griselli

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.

swipeabletabbarcontroller's People

Contributors

christianascone avatar maksimkurpa avatar marcosgriselli avatar rep2 avatar royherma avatar tobaloidee avatar

Watchers

 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.