Latest 0.1.2
Homepage https://github.com/Danappelxx/DASlideViewController
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

Demo

Demo Gif

Usage

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

Requirements

None!

Installation

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

pod "DASlideViewController"

Quickstart

Getting started is very simple.

The sample project should tell you everything that you need, but if you want a slightly more detailed walkthrough, this is a list of what you need to do:

  • Create a standard view controller, and make sure it is a subclass of DASlideViewController, ex:
import UIKit
import DASlideViewController
class ViewController: DASlideViewController  {
}
  • For each tab that you want, create a container view. Set it’s width/height to whatever you want (probably equal to the viewcontroller), it will work either way. They can be off the screen – a helper function is provided to organize them (DASlideViewController.setupContainerViewPositions).
  • Give each container view a tag – have the lowest one be 1, second be 2, etc.
  • Make sure that the container view is of type DASlideContainerView
  • Inside the container view (seperate controller, if using storyboard) create something that will act as the tab (ex: label, button, etc.) and give it a label of -1 (you can change this later).
  • The tab’s height can be anything you want – DASlideViewController makes sure there aren’t any overlaps
  • The last UI item you need is a pan gesture recognizer to the main view – make sure it isn’t bound to anything. You need to capture a ‘pan’ event and forward it to DASlideViewController. Refer to the code snippet below on how to do this.

Here’s all the code that you need (if you’re not using storyboard) to get started:

import UIKit
import DASlideViewController

class ViewController: DASlideViewController  {

    @IBAction func pannedScreen(sender: UIPanGestureRecognizer) {
        self.dragViewWithPanGestureRecognizer(sender)
        // ^ forward it to DASlideViewController
    }
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    override func viewDidLayoutSubviews() {
        self.setupContainerViewPositions()
        // move containers into their starting positions
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
}

Author

Dan Appel, [email protected]

License

DASlideViewController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "DASlideViewController",
    "version": "0.1.2",
    "summary": "Turns container views into draggable tags that can expand to full-screen",
    "description": "                       Provides you with a subclassable viewcontroller and containerview that automatically stack and can expand to fill the window.n                       Comes with smooth animations and is very customizable.n",
    "homepage": "https://github.com/Danappelxx/DASlideViewController",
    "license": "MIT",
    "authors": {
        "Dan Appel": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Danappelxx/DASlideViewController.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "DASlideViewController": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This