Skip to content

shiqp/SPSheetKit

Repository files navigation

SPSheetKit

CI Status Version License Platform

Summary

SPSheetKit is a light kit to present sheet controller as below.

Present Sheet with Down Direction

Present Sheet with Up Direction

Present Sheet with Regular Width Screen

Installation

SPSheetKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SPSheetKit'

Usage

  1. Import:
import SPSheetKit
  1. Init menu item:
let menuItem = SPSheetMenuItem(title: "Title", image: UIImage(named: "note"), action: #selector(onMenuItemTapped))
  1. Config the sheet colors:
SPSheetColors.background: UIColor = .black
SPSheetColors.content: UIColor = .white
SPSheetColors.separator: UIColor = .white
SPSheetColors.dragSlider: UIColor = .lightGray
  1. Init and present sheet controller:
let sheet = SPSheetController(sourceView: sender, sourceRect: sender.bounds, presentationOrigin: sender.frame.minY, presentationDirection: .up)
sheet.menuItems.append(menuItem)
self.present(sheet, animated: true)

Author

shiqp, [email protected]

License

SPSheetKit is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published