Coder Social home page Coder Social logo

nbbottomsheet's Introduction

NBBottomSheet

Carthage Compatible CocoaPods Compatible Swift 5.0 Platform License

NBBottomSheet is an open-source iOS library that allows you to present a UIViewController in a bottom sheet.

Demo

Requirements

  • iOS 9.0+
  • Xcode 11+
  • Swift 5.0

Installation

CocoaPods

To integrate NBBottomSheet into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'NBBottomSheet', '~> 1.2'
end

Then, run the following command:

$ pod install

Carthage

To integrate NBBottomSheet into your Xcode project using Carthage, specify it in your Cartfile:

github "nicol3a/NBBottomSheet" ~> 1.1

Then, run the following command:

$ carthage update

Drag the built NBBottomSheet.framework from the Carthage build folder into the “Embedded Binaries” section in the "General" panel of the application target.

Manually

Add NBBottomSheet as a git submodule by running the following command:

$ git submodule add -b master https://github.com/nicol3a/NBBottomSheet.git

Drag the NBBottomSheet.xcodeproj file into your project and add the NBBottomSheet.framework in the "Embedded Binaries" section in the "General" panel of the application target.

Usage

Initialize an instance of NBBottomSheetController:

let bottomSheetController = NBBottomSheetController()

To display a view controller in a bottom sheet, add the following code where you want to display the bottom sheet, passing the view controller to present and the container view controller:

let viewController = AlertViewController()
bottomSheetController.present(viewController, on: self)

Note: Be sure to keep a strong reference to your instance of NBBottomSheetController for the duration of its use.

If you don’t want to use NBBottomSheetController’s default configuration, you can specify a NBBottomSheetConfiguration instance on initialization of NBBottomSheetController.

let configuration = NBBottomSheetConfiguration(animationDuration: 0.4, sheetSize: .fixed(300))
let bottomSheetController = NBBottomSheetController(configuration: configuration)

License

NBBottomSheet is available under the MIT license. See the LICENSE file for more information.

Acknowledgements

nbbottomsheet's People

Contributors

nicol3a avatar twodollarsesq avatar guidev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.