All Projects → ParkGwangBeom → Sheet

ParkGwangBeom / Sheet

Licence: mit
📑 Actionsheet with navigation features such as the Flipboard App

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Sheet

Atgmediabrowser
Image slide-show viewer with multiple predefined transition styles, with ability to create new transitions with ease.
Stars: ✭ 186 (-29.55%)
Mutual labels:  transition, custom
Ypnavigationbartransition
A Full functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead. (类似微信 iOS Navigation Bar 的切换方案)
Stars: ✭ 725 (+174.62%)
Mutual labels:  navigation, transition
Spstorkcontroller
Now playing controller from Apple Music, Mail & Podcasts Apple's apps.
Stars: ✭ 2,494 (+844.7%)
Mutual labels:  transition, popup
Splarkcontroller
Custom transition between controllers. Settings controller for your iOS app.
Stars: ✭ 693 (+162.5%)
Mutual labels:  transition, custom
Marshroute
Marshroute is an iOS Library for making your Routers simple but extremely powerful
Stars: ✭ 208 (-21.21%)
Mutual labels:  navigation, transition
Aicustomviewcontrollertransition
Easy and tidy way for creating custom UIViewController transitions for iOS
Stars: ✭ 130 (-50.76%)
Mutual labels:  transition, custom
Hamburger React
Animated hamburger menu icons for React (1.5 KB) 🍔
Stars: ✭ 391 (+48.11%)
Mutual labels:  navigation, transition
Cardpresentationcontroller
Custom UIPresentationController which mimics the behavior of Apple Music UI
Stars: ✭ 778 (+194.7%)
Mutual labels:  custom, popup
Layerjs
layerJS: Javascript UI composition framework
Stars: ✭ 1,825 (+591.29%)
Mutual labels:  navigation, transition
Xamarin.forms.breadcrumb
This is a breadcrumb navigation control that is complete automatic and uses the Navigation stack and page titles to generate the breadcrumbs.
Stars: ✭ 130 (-50.76%)
Mutual labels:  navigation, custom
Tltransitions
快速实现控制器的转场和View的快速popover显示,并支持自定义动画、手势退场
Stars: ✭ 296 (+12.12%)
Mutual labels:  transition, actionsheet
SPLarkController
Custom transition between controllers. Settings controller for your iOS app.
Stars: ✭ 967 (+266.29%)
Mutual labels:  custom, transition
Zmjtipview
Fully customisable tooltip view in Objective-C for iOS.
Stars: ✭ 156 (-40.91%)
Mutual labels:  custom, popup
Cpcollectionviewkit
Interesting UICollectionView layouts and transitions
Stars: ✭ 140 (-46.97%)
Mutual labels:  transition, custom
Leealert
优雅的可自定义 Alert ActionSheet
Stars: ✭ 1,097 (+315.53%)
Mutual labels:  custom, actionsheet
Transition
Easy interactive interruptible custom ViewController transitions
Stars: ✭ 2,566 (+871.97%)
Mutual labels:  transition, custom
Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (-31.06%)
Mutual labels:  actionsheet, popup
Django Admin Interface
django's default admin interface made customizable. popup windows replaced by modals. :mage: ⚡️
Stars: ✭ 717 (+171.59%)
Mutual labels:  custom, popup
Xam.plugin.simplebottomdrawer
Just a nice and simple BottomDrawer for your Xamarin Forms project
Stars: ✭ 92 (-65.15%)
Mutual labels:  navigation, popup
Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (-6.82%)
Mutual labels:  navigation, popup

Logo

Swift 4.0+ iOS 9.0 Version Carthage Compatible Platform License


📑 SHEET helps you easily create a wide variety of action sheets with navigation features used in the Flipboard App


Example

Installation

CocoaPods

pod 'Sheet', '~> 0.6.0'

Carthage

github "ParkGwangBeom/Sheet" ~> 0.6.0

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate Sheet into your project manually.

Usage

Implementing the contents of a Sheet is similar to implementing an existing UICollectionViewController. Simply make your view controller subclass of SheetContentsViewController.

import Sheet

class ViewController: SheetContentsViewController {

   /// Sheet visible contents height. If contentSize height is less than visibleContentsHeight, contentSize height is applied.
    override var visibleContentsHeight: CGFloat {
        return 600
    }
    
    /// Give CollectionView a chance to regulate Supplementray Element
    override func registCollectionElement() {
        let nib = UINib(nibName: "TitleHeaderView", bundle: nil)
        collectionView?.register(nib, forSupplementaryViewOfKind: SheetLayoutElement.header.kind, withReuseIdentifier: SheetLayoutElement.header.id)
    }

    /// Provide an opportunity to set default settings for collectionview custom layout
    override func setupSheetLayout(_ layout: SheetContentsLayout) {
        layout.settings.itemSize = { indexPath in
            let height: CGFloat = indexPath.section == 0 ? 30 : 60
            return CGSize(width: UIScreen.main.bounds.width, height: height)
        }
        layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 15, right: 0)
        layout.settings.headerSize = CGSize(width: UIScreen.main.bounds.width, height: 60)
        layout.settings.isHeaderStretchy = true
    }
    
   override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 10
    }
    
    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
         ...
        return cell
    }
    
    override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         ...
    }
   
     ...
}

You can use the custom action sheet transition using the default api provided by UIKit such as present, push, pop.

🔥 However, do not use the dismiss of the NavigationController, but use the close (duration: completion :) function.

// present
let contentsViewController = ViewController()
let sheetNavigation = SheetNavigationController(rootViewController: contentsViewController)
present(sheetNavigation, animated: true, completion: nil)

// push
let nextContentsViewController = NextContentsViewController()
navigationController?.pushViewController(nextContentsViewController, animated: true)

// pop
navigationController?.popViewController(animated: true)

See the Example project for more details.

Layout

Sheet basically has Navigation structure. All children should inherit from SheetContentsViewController. SheetContentsViewController inherits UICollectionViewController by default, and its layout is like the following image.

layout

Please refer to Example Code for detailed setting of image layout.

Advanced

Easily customizable by SheetContents.

Options

Property Type Default Value
defaultToolBarBackgroundColor UIColor .black
sheetToolBarHeight CGFloat 50
isSheetToolBarHidden Bool false
cornerRadius CGFloat 0
defaultVisibleContentHeight CGFloat 240
dimmingViewBackgroundColor UIColor .black.withAlphaComponent(0.3)
sheetBackgroundColor UIColor .white
presentTransitionType SheetPresentTransitionType .scale

Layout Settings

Property Type
headerSize CGSize?
footerSize CGSize?
itemSize ((IndexPath) -> CGSize)?
sectionHeaderSize ((IndexPath) -> CGSize)?
sectionFooterSize ((IndexPath) -> CGSize)?

SheetContentsViewController

Property Type
sheetToolBar UIView
Method Explanation
func registCollectionElement() Give CollectionView a chance to regulate Supplementray Element
func setupSheetLayout() Provide an opportunity to set default settings for collectionview custom layout
func reload() Help reload CollectionView and adjust the height of the content.
func close(completion: (() -> Void)? = nil) Sheet Dismiss

Custom ToolBar

The built-in toolbar consists of a single button.

Default ToolBar

Setting up a Custom ToolBar is very simple.

sheetToolBar = CustomToolBar()

Author

License

Sheet is released under the MIT license. See LICENSE for details.

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].