All Projects → mkko → Drawerview

mkko / Drawerview

Licence: mit
A drop-in view, to be used as a drawer anywhere in your app

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Drawerview

Drawers
Group related classes together. No more silos. A solution to rails dystopia.
Stars: ✭ 150 (-40.24%)
Mutual labels:  drawer
Fontawesomekit.swift
A better choice for iOS Developer to use FontAwesome Icon with UI.😍
Stars: ✭ 194 (-22.71%)
Mutual labels:  ios-ui
Swiftpagemenu
Customizable Page Tab Menu Controller 👍
Stars: ✭ 233 (-7.17%)
Mutual labels:  ios-ui
Kwdrawercontroller
Drawer view controller that easy to use!
Stars: ✭ 154 (-38.65%)
Mutual labels:  drawer
Lmmediaplayer
A video and audio player with replaceable UI component.
Stars: ✭ 183 (-27.09%)
Mutual labels:  ios-ui
Mmenu Js
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
Stars: ✭ 2,535 (+909.96%)
Mutual labels:  drawer
Wobbly
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.
Stars: ✭ 150 (-40.24%)
Mutual labels:  ios-ui
Swiftui Animation
SwiftUI Animation
Stars: ✭ 233 (-7.17%)
Mutual labels:  drawer
Mycoretextlabel
图文混排 , 实现图片文字混排 , 可显示常规链接比如网址,@,#话题#,手机号 , 邮箱号等 , 可以自定义链接字,设置关键字高亮等功能 . 适用于微博,微信,IM聊天对话等场景 . 实现这些功能仅用了几百行代码,耦合性也较低
Stars: ✭ 192 (-23.51%)
Mutual labels:  ios-ui
Parchment
A paging view controller with a highly customizable menu ✨
Stars: ✭ 2,812 (+1020.32%)
Mutual labels:  ios-ui
Pulley
A library to imitate the iOS 10 Maps UI.
Stars: ✭ 1,928 (+668.13%)
Mutual labels:  drawer
Jxtalertmanager
UIAlertView/UIAlertController便捷调用工具
Stars: ✭ 177 (-29.48%)
Mutual labels:  ios-ui
Material Menu
Animations for Android L drawer, back, dismiss and check icons
Stars: ✭ 2,481 (+888.45%)
Mutual labels:  drawer
Lovefreshpeakapp oc
IOS电商购物APP: 爱鲜蜂OC版,规范的代码风格,使用Masonry布局适配所有ios机型 Shopping e-commerce projects, using automatic layout, suitable for any Ios model Website ;
Stars: ✭ 152 (-39.44%)
Mutual labels:  ios-ui
Noticebar
😍A simple NoticeBar written by Swift 3, similar with QQ notice view.
Stars: ✭ 237 (-5.58%)
Mutual labels:  ios-ui
Smartswipe
An android library to make swipe more easier and more powerful. Android各种侧滑,有这一个就够了
Stars: ✭ 1,911 (+661.35%)
Mutual labels:  drawer
Ppasyncdrawingkit
This is a iOS asynchronously drawing view Kit.
Stars: ✭ 205 (-18.33%)
Mutual labels:  ios-ui
Nativepopup
Clone of Apple iOS App's feedback popup, and easily customizable.
Stars: ✭ 247 (-1.59%)
Mutual labels:  ios-ui
Rhplaceholder
Show pleasant loading view for your users 😍
Stars: ✭ 238 (-5.18%)
Mutual labels:  ios-ui
Pvview
A small library that helps you to make an amazing parallax view
Stars: ✭ 227 (-9.56%)
Mutual labels:  ios-ui

Sample

DrawerView

A drop-in view, to be used as a drawer anywhere in your app.

Sample Sample Sample

Ease of use

DrawerView is a simple drop-in view that you can add to your app. No need to restructure your views or view controllers to add support for it. This also makes it possible to have multiple drawers hosting different content and switch between them the same way it is done in the iOS Maps.

Automatic support for scroll views

DrawerView handles subview interaction so that it adds specialized support for scroll views. What this practically means is that you can add a scroll view (or a table view) inside it and the DrawerView will handle the transition from scrolling the subview to scrolling the drawer.

Customization

Visuals: By default DrawerView supports UIBlurEffect as a background. However, any UIColor is supported too. Just remember to set backgroundEffect to nil. Besides background, corner radius, borders and shadow can be customized as well.

Position: The drawer has four distinct positions: closed, collapsed, partiallyOpen, open. Each of these positions can be customized and you can define the enabled positions. Open position is evaluated using systemLayoutSizeFitting and constrained by the given topMargin.

Bottom Inset: To support iOS devices with a notch at the bottom of the screen, you can change insetAdjustmentBehavior to automatically determine the correct inset. You can also set it to use the safe area of the superview or set it to a fixed value. Due to the content being overlapping with the notch you can change contentVisibilityBehavior to define which views should be hidden when collapsed. By default these two properties are set to automatic.

Visibility: You can also set the visibility of the drawer. This is a distinct property from position, but acts the same way as if the drawer was closed. The purpose of this is to help you so that you don't have to remember the previous position if the drawer is made visible again. This in turn makes it convenient to have multiple drawers but only one visible at a time.

Installation

You can install DrawerView with Carthage and CocoaPods. With CocoaPods, add the following into your Podfile:

pod "DrawerView"

For Carthage add the following into your Cartfile:

github "mkko/DrawerView"

Usage

DrawerView tries automatically to occupy the view it will be added to. It uses autolayout to set its position, and thus you can attach views to it You can set it up with storyboards or programmatically

Setting things up

Here's listed the possible ways of setting things up. Hands-on examples of setting things up can be found from the included example project.

Set up in storyboards

Storyboard is supported in two ways: as an embedded view and as a child view controller.

As child view controller

You can add contents of one view controller as a drawer to another view controller, almost the same way as you would use "Container View".

  1. Create the two view controllers.
  2. Define a storyboard ID for the drawer view controller (eg. "DrawerViewController")
  3. Make the connection in code:
override func viewDidLoad() {
    super.viewDidLoad()

    let drawerViewController = self.storyboard!.instantiateViewController(withIdentifier: "DrawerViewController")
    self.addDrawerView(withViewController: drawerViewController)
}
As embedded view
  1. Create a view in storyboard that is not inside the view controller view hierarchy. To do this, you can for instance drag a new view directly to the document outline.
  2. Set a custom class of the view to a DrawerView.
  3. Connect the containerView IBOutlet of the newly created view to the view where you want it to be added (e.g. the view controller root view).

Set up programmatically

Programmatic setup is pretty much the same as setting up any UIView: you create one, set it up with subviews and add it to a view. Here's an example to do it.

override func viewDidLoad() {
    super.viewDidLoad()

    let drawerView = DrawerView()
    drawerView.attachTo(view: self.view)

    // Set up the drawer here
    drawerView.snapPositions = [.collapsed, .partiallyOpen]
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].