Swiftpack.co - Package - gaetanomatonti/BottomSheet

BottomSheet

A Bottom Sheet component made in UIKit.

Table of contents

Installation

Swift Package Manager

Xcode Project

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter the repository URL:

https://github.com/gaetanomatonti/BottomSheet

Swift Package

Edit your Package.swift file and add the repository URL to the dependencies.

dependencies: [
    .package(url: "https://github.com/gaetanomatonti/BottomSheet", .upToNextMajor(from: "0.2.0"))
]

Usage

BottomSheetViewController

This controller uses BottomSheetView as its main view. To specify custom content for the bottom sheet create your own view, and assign it to the contentView variable of the controller. You can either do this by subclassing BottomSheetViewController, to implement your own business logic, or by assigning the view at initialisation before presenting the sheet.

Example: subclassing BottomSheetViewController

final class CustomBottomSheetViewController: BottomSheetViewController {
    override func loadView() {
        super.loadView()
        	
        let myView = UIView()
        myView.backgroundColor = .red
		
        contentView = myView
    }
}

Example: assignment on init

func presentBottomSheet() {
    let controller = BottomSheetViewController()
    controller.contentView = UIView()
    ...
}

Documentation

You can find a more detailed documentation here.

Github

link
Stars: 2

Dependencies

Used By

Total: 0

Releases

Updated documentation - 2020-10-23 20:23:31

This updated includes new documentation and a small change to the name of a variable

Feature: BottomSheet presentation - 2020-10-15 10:34:14

Changes:

  • Added a new BottomSheetPresenter procotol
  • Added a new BottomSheetTransitioningDelegate object

Initial release - 2020-09-29 21:33:49