Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
onmyway133 authored Nov 25, 2017
1 parent 95ee97f commit 60dc4d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ Dropdown in Swift

## Usage

`Dropdowns` provides the quickest way to present a dropdown in your app. It is very lightweight, just provide a list of items and the action closure you want to handle.

### Basic

`Dropdowns` works by showing a child `UIViewController` as a dropdown from a `TitleView`. The most common use case is to show from a `UINavigationController`, in that sense, you can just create a list of items, and provide to `TitleView`.

```swift
let items = ["World", "Sports", "Culture", "Business", "Travel"]
let titleView = TitleView(navigationController: navigationController!, title: "Menu", items: items)
Expand All @@ -24,19 +28,21 @@ navigationItem.titleView = titleView

### Customization

`Dropdowns` uses `TableController` by default, to show list of items in a `UITableView`. You can customise to show anything you want by using `contentController`.

```swift
let contentController = TableController(items: items, initialIndex: 0)
let dropdown = DropdownController(contentController: contentController, navigationController: navigationController)
```

### Configuration

You can also customise many aspects of `Dropdowns` via `Config`

```swift
Config.List.DefaultCell.Text.color = UIColor.redColor()
```



## Installation

**Dropdowns** is available through [CocoaPods](http://cocoapods.org). To install
Expand Down

0 comments on commit 60dc4d9

Please sign in to comment.