Skip to content
A Swift based implementation of a swipe-able front view, to reveal a rear navigation view.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SBSwiftRevealView.xcodeproj
SBSwiftRevealView
SBSwiftRevealViewTests
Default-568h@2x.png
LICENSE
README.md
TemplateIcon2x.png

README.md

SBSwiftRevealView

About

This is a Swift implementation of a swipeable reveal view for iOS. Currently the capabilities are limited, but planned to be expanded into a more robust and modular based setup.

Usage

At a minimum you need to include the following files in your project:

  • RearNavigationViewController.swift
  • RearNavControllerDelegate.swift

Currently, you'll need to make a seperate function for each of the navigation items you plan on having in the RearNavigationViewController.swift file. Plans are to abstract this out to not require this, but at this time, that implementation hasn't been completed.

Example:

func loadSettingsView(sender: UIButton){
    let settingsViewCtrl: ViewController = ViewController()
    settingsViewCtrl.rearNavDelegate = self
self.loadFrontViewWithController(settingsViewCtrl)

}

AppDelegate.swift
Modifications to the AppDelegate.swift file are also necessary for the reveal view to work correctly.

Add the following to your AppDelegate.swift file in your project, setting the let viewController with the instantiation of the view controller you want to be viewed first:

self.window = UIWindow(frame: UIScreen.mainScreen().bounds)

let viewController = ViewController() let navWidth: CGFloat = 220

let rearNavigationViewController = RearNavigationViewController(frontViewCtrl: viewController, navWidth: navWidth);

self.window!.rootViewController = rearNavigationViewController;

self.window!.makeKeyAndVisible() return true

You can’t perform that action at this time.