Latest 1.0.2
Homepage https://github.com/danjiang/DTActionSheet
License MIT
Platforms ios 8.4, requires ARC
Authors

Swift
Platform
CocoaPods
Carthage compatible

Introduction

Simple customizable action sheet.

Demo

Installation

Requirement

iOS 8.4+

CocoaPods

To install DTActionSheet add a dependency to your Podfile:

pod "DTActionSheet"

Carthage

To install DTActionSheet add a dependency to your Cartfile:

github "danjiang/DTActionSheet"
carthage update --platform ios

Usage

Import

import DTActionSheet

Inheritance

Subclass following 3 classes with subtle differences:

  • DTActionSheet – Full customizable
  • DTDismissibleActionSheet – With dismiss button on the left
  • DTSavableActionSheet – With dismiss button on the left and save button on the right

You can review source code of DTDatePickerSheet to know how to write your own action sheet.

Reusable Components

  • DTDatePickerSheet – UIDatePicker in action sheet.
  • More to come…

Use

class ViewController: UIViewController {

  private let formatter = DateFormatter()

  override func viewDidLoad() {
    super.viewDidLoad()

    formatter.dateStyle = .short
  }

  @IBAction func changeDate(_ sender: UIButton) {
    let sheet = DTDatePickerSheet(style: .dark)
    sheet.setTitle("Choose Date")
    sheet.configDatePicker(mode: .date, date: Date()) { [unowned self] date in
      let title = self.formatter.string(from: date)
      sender.setTitle(title, for: .normal)
    }
    sheet.show()
  }

}

Latest podspec

{
    "name": "DTActionSheet",
    "version": "1.0.2",
    "summary": "Simple customizable action sheet.",
    "homepage": "https://github.com/danjiang/DTActionSheet",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dan Jiang": "[email protected]"
    },
    "social_media_url": "https://twitter.com/danjianglife",
    "platforms": {
        "ios": "8.4"
    },
    "requires_arc": true,
    "swift_version": "4.0",
    "source": {
        "git": "https://github.com/danjiang/DTActionSheet.git",
        "tag": "1.0.2",
        "submodules": true
    },
    "source_files": "Sources/**/*.{h,swift}",
    "resources": "Sources/*.bundle"
}

Pin It on Pinterest

Share This