DKBottomBarViewController is a delightfull way to create a bottom based navigation or search solution (or whatever you want to do with it) on iOS.
Just drag and drop the files inside your project.
this project is written in swift so you might need to use an Umbrella Header for your Objective-C project.
DKBottomBarViewController is used with a DKBottomBarViewControllerConfiguration object to define several properties.
Height of the upper bar.
Background color of the upper bar.
Determines wether the upper bar has a shadow.
The color used for the view that overlays the main content view.
Max opacity that the overlay view fades to upon move of the DKBottomBarViewController
Max distance that the DKBottomBarViewController has in relation to the parent view controller in its opened state (when the whole view controller is visible).
Treshold for the velocity on the Y axis that determines if the transition of the DKBottomBarViewController should automatically be completed to its closed stated.
Treshold for the velocity on the Y axis that determines if the transition of the DKBottomBarViewController should automatically be completed to its opened stated.
Determines on which part of the DKBottomBarViewController the UIPanGestureRecognizer is attached to.
Determines the dimensions of the left button that lives inside the upper bar (Y dimensions are always ignored! this is because the buttons are centered on the vertical axis)
Determines the dimensions of the center button that lives inside the upper bar (Y dimensions are always ignored! this is because the buttons are centered on the vertical axis)
Determines the dimensions of the center button that lives inside the upper bar (Y dimensions are always ignored! this is because the buttons are centered on the vertical axis)
UIImage resource path for the left button.
UIImage resource path for the center button.
UIImage resource path for the right button.
Determines wether to show debug statements and lines
Duration of the animation
Delay of the animation
Spring damping of the animation
Spring velocity of the animation
Options of the animation
Initialize a new DKBottomBarViewControllerConfiguration and a new DKBottomBarViewController and add it to the parent view controller.
let configuration = DKBottomBarViewControllerConfiguration.standardConfiguration()
bottomBarViewController = DKBottomBarViewController(configuration: configuration)
bottomBarViewController!.addToParentViewController(self)
bottomBarViewController!.addGestureRecognizer()
bottomBarViewController!.delegate = self
If you want to use the provided delegate (and I recommend to do this), then don't forget to make you class conform to the DKBottomBarViewControllerDelegate protocol as follows :
class DKMainViewController: UIViewController, DKBottomBarViewControllerDelegate
To set the content view of the DKBottomBarViewController (the view that is contained inside this view controller) use bottomBarViewController.setContentView(view : UIView)
After setting the content view, DKBottomBarViewControllerDelegate will call out to bottomBarViewControllerDidSetContentView()
to provide you with the content view and the horizontal and vertical constraint used to set the content view.
The DKBottomBarViewController has several delegate methods that you can use to get the current drag progress en several other things.
Called when the drag or animation progress changes.
Called when the DKBottomBarViewController is shown.
Called when the DKBottomBarViewController is hiden.
Called when the DKBottomBarViewController reached the top.
Called when the DKBottomBarViewController reached the bottom.
Called when the DKBottomBarViewController changes traversal or velocity on the Y axis.
Called when the left button of the DKBottomBarViewController is pressed.
Called when the center button of the DKBottomBarViewController is pressed.
Called when the right button of the DKBottomBarViewController is pressed.
func bottomBarViewControllerDidSetContentView(contentView : UIView, horizontalConstraints : [NSLayoutConstraint], verticalConstraints : [NSLayoutConstraint])
Called when bottomBarViewController.setContentView(view : UIView)
is used, this method provides you with the final content view and the horizontal and vertical constraints used to set the content view