Swiftpack.co -  Package - gaetanomatonti/BottomSheet
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
gaetanomatonti/BottomSheet
A BottomSheet component made with UIKit. Completely written in Swift 🧡
.package(url: "https://github.com/gaetanomatonti/BottomSheet.git", from: "0.3.0")

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: 16
Last commit: 3 days ago

Release Notes

3 weeks ago

Description

This release brings more documentation and refactored example and source code.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco