Component which presents a dismissible view from the bottom of the screen
- iOS 13.0+
- Swift 5.0+
- ARC
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into Xcode and the Swift compiler.
If you are using Xcode 11 or later:
- Click
File
Swift Packages
Add Package Dependency...
- Specify the git URL for
NABottomsheet
.
https://github.com/noorulain17/NABottomsheet
If you prefer not to use either of the aforementioned dependency managers, you can integrate NABottomsheet
manually by directly adding Bottomsheet.swift
file in your project.
CocoaPods is a dependency manager for Cocoa projects.
You can install it with the following command:
Adding the following to your Podfile
and running pod install
:
use_frameworks!
pod "NABottomsheet"
import NABottomsheet
let controller = Bottomsheet.Controller()
// Adds View
let view = UIView
controller.addContentsView(view)
// Adds NavigationBar
controller.addNavigationBar { [weak self] navigationBar in
// navigationBar
}
// Adds CollectionView
controller.addCollectionView { [weak self] collectionView in
// collectionView
}
// Adds TableView
controller.addTableView { [weak self] tableView in
// tableView
}
// Adds ContentViewController
let contentViewController = UIViewController()
controller.addContentsViewController(contentViewController)
// customize
controller.overlayBackgroundColor = UIColor(red: 255, green: 0, blue: 0, alpha: 0.3)
controller.viewActionType = .tappedDismiss
controller.initializeHeight = 200
Inspired by
This project is made available under the MIT license. See LICENSE file for details.