- May 27, 2025
- Mins Read
Drawer view controller that is easy to use!
KWDrawerController is available on CocoaPods. Add the following to your Podfile:
# Swift 3
pod ‘KWDrawerController’, ‘~> 3.7’
# Swift 4~
pod ‘KWDrawerController’, ‘~> 4.2’
pod ‘KWDrawerController/RxSwift’ # with RxSwift extension
Simply drag and drop the DrawerController
folder into your existing project.
import UIKit
import KWDrawerController
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let mainViewController = MainViewController()
let leftViewController = LeftViewController()
let rightViewController = RightViewController()
let drawerController = DrawerController()
drawerController.setViewController(mainViewController, .none)
drawerController.setViewController(leftViewController, .left)
drawerController.setViewController(rightViewController, .right)
/// Customizing
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = drawerController
window?.makeKeyAndVisible()
return true
}
}
Set DrawerController
as the Custom Class of the Initial ViewController.
Connect the DrawerEmbedLeftControllerSegue
and/or the DrawerEmbedRightControllerSegue
from DrawerController
to your left/right controllers.
Connect the DrawerEmbedMainControllerSegue
from DrawerController
to your main controller.
Set the segue identifiers of both the inspector of DrawerController
and the segues themselves.
/// Open
self.drawerController?.openSide(.left)
self.drawerController?.openSide(.right)
/// Close
self.drawerController?.closeSide()
optional func drawerDidAnimation(
drawerController: DrawerController,
side: DrawerSide,
percentage: Float
)
optional func drawerDidBeganAnimation(
drawerController: DrawerController,
side: DrawerSide
)
optional func drawerWillFinishAnimation(
drawerController: DrawerController,
side: DrawerSide
)
optional func drawerWillCancelAnimation(
drawerController: DrawerController,
side: DrawerSide
)
optional func drawerDidFinishAnimation(
drawerController: DrawerController,
side: DrawerSide
)
optional func drawerDidCancelAnimation(
drawerController: DrawerController,
side: DrawerSide
)
DrawerTransition
is a module that determines the rendering direction to move the Drawer. It is implemented by inheriting DrawerTransition
.
Transition
, Overflow Transition
should also use DrawerFloatTransition
.Overflow Transition
be used when Transition
beyond the open range of the drawer.
DrawerSlideTransition
, DrwaerParallaxTransition
, DrawerFoldTransition
, and DrawerSwingTransition
.Overflow Transition
, Transition
should also use DrawerFloatTransition
.Animator is a module that controls the speed of moving a drawer. It is implemented by inheriting DrawerAnimator
or DrawerTickAnimator
.
public var isTapToClose: Bool
public var isGesture: Bool
public var isAnimation: Bool
public var isOverflowAnimation: Bool
public var isShadow: Bool
public var isFadeScreen: Bool
public var isBlur: Bool
public var isEnable: Bool
getViewController
method.Light and scrollable view controller for tvOS to present blocks of text Description TvOSTextViewer is a view controller to present ...
TvOSSlider is an implementation of UISlider for tvOS. Description and usage TvOSSlider palliates missing an implementation of UISlider for tvOS as part ...
TvOSScribble, based on CoreML, mitigates the lack of a physical numpad area in Siri Remote implementing a handwriting gesture recognizer. ...
PIN keyboard for tvOS Description TvOSPinKeyboard is a view controller that allows easily asking for PIN codes in tvOs Requirements ...
📺 A tvOS button which truncates long text with '... More'. The TvOSMoreButton is a simple view which aims to ...