Latest 1.1.0
Homepage https://github.com/DevYeom/YYBottomSheet
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

Swift
Version
License
Platform

Introduction

When you need to let users choose one of several or know informations by showing bottomSheet, you can use YYBottomSheet. Simple And Clear 😎

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

To create and show a bottomSheet, first of all, import the module at the beginning of the file:

import YYBottomSheet

First of all, you can show the bottomUpTable as below:

let bottomUpTable = YYBottomSheet.init(bottomUpTableTitle: title, dataArray: dataArray, options: nil) { (cell) in
// whatever you want to code
// print("(cell.indexPath.row) : (cell.titleLabel.text)")
}
bottomSheet.show()

And button handler (SelectHandler) is just a lambda:

(YYBottomSheetCell) -> ()

Second, you can show the simpleToast as below:

let message = "Hello World!"
let simpleToast = YYBottomSheet.init(simpleToastMessage: message, options: nil)

simpleToast.show()

You can customize several things by setting options as below:

// BottomUpTableOptions
let options: [YYBottomSheet.BottomUpTableOptions:Any] = [
.allowTouchOutsideToDismiss: false,
.backgroundAlpha: CGFloat(0.3),
.tableViewHeight: CGFloat(100),
.tableRowHeight: CGFloat(30),
.tableViewCellLabelTextColor: UIColor.blue,
.tableViewSeperatorStyle: UITableViewCell.SeparatorStyle.none,
.headerViewBackgroundColor: UIColor.yellow,
.headerViewTitleLabelTextColor: UIColor.red
]

// SimpleToastOptions
let options: [YYBottomSheet.SimpleToastOptions:Any] = [
.showDuration: Double(2.0),
.backgroundColor: UIColor.black,
.beginningAlpha: CGFloat(0.8),
.messageFont: UIFont.italicSystemFont(ofSize: 15),
.messageColor: UIColor.white
]

Check full example as below:

/**
* BottomUpTable
*/
let title = "Fruits"
let dataArray = ["apple", "grape", "watermelon", "banana", "strawberry", "cherry", "pineapple", "pear"]
let options: [YYBottomSheet.BottomUpTableOptions:Any] = [
.allowTouchOutsideToDismiss: true,
.backgroundAlpha: CGFloat(0.5),
.tableViewHeight: CGFloat(250),
.tableRowHeight: CGFloat(45),
.tableViewSeperatorStyle: UITableViewCell.SeparatorStyle.none
]

let bottomUpTable = YYBottomSheet.init(bottomUpTableTitle: title, dataArray: dataArray, options: options) { (cell) in
self.selectedFruitLabel.text = cell.titleLabel.text
}

bottomUpTable.show()

/**
* SimpleToast
*/
let options: [YYBottomSheet.SimpleToastOptions:Any] = [
.showDuration: Double(2.0),
.backgroundColor: UIColor.black,
.beginningAlpha: CGFloat(0.8),
.messageFont: UIFont.italicSystemFont(ofSize: 15),
.messageColor: UIColor.white
]

let message = "SimpleToast can be customized!"
let simpleToast = YYBottomSheet.init(simpleToastMessage: message, options: options)

simpleToast.show()

Installation

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

pod 'YYBottomSheet'

Author

DevYeom, [email protected]

License

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

Latest podspec

{
    "name": "YYBottomSheet",
    "version": "1.1.0",
    "swift_version": "5.0",
    "summary": "Very Simple and Useful Bottom Sheet",
    "description": "When you need to let users choose one of several or know informations by showing bottomSheet, you can use YYBottomSheet.nSimple And Clear ud83dude0e",
    "homepage": "https://github.com/DevYeom/YYBottomSheet",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DevYeom": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DevYeom/YYBottomSheet.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "YYBottomSheet/Classes/**/*",
    "frameworks": "UIKit",
    "resources": "YYBottomSheet/Assets/**/*"
}

Pin It on Pinterest

Share This