Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kofktu/kuiactionsheet
Custom UIActionSheet
https://github.com/kofktu/kuiactionsheet
custom-uiactionsheet swift
Last synced: 2 months ago
JSON representation
Custom UIActionSheet
- Host: GitHub
- URL: https://github.com/kofktu/kuiactionsheet
- Owner: Kofktu
- License: mit
- Created: 2016-07-08T01:21:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-26T14:06:42.000Z (about 6 years ago)
- Last Synced: 2024-10-04T19:46:14.597Z (3 months ago)
- Topics: custom-uiactionsheet, swift
- Language: Swift
- Size: 262 KB
- Stars: 14
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KUIActionSheet
![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg)
[![CocoaPods](http://img.shields.io/cocoapods/v/KUIActionSheet.svg?style=flat)](http://cocoapods.org/?q=name%3AKUIActionSheet%20author%3AKofktu)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)> Custom UIActionSheet for Swift
![alt tag](Screenshot/Default.png)
![alt tag](Screenshot/DefaultWithCustomView.png)
![alt tag](Screenshot/CustomTheme.png)
![alt tag](Screenshot/CustomXib.png)## Requirements
- iOS 8.0+
- Xcode 9.0
- Swift 4.2
- Swift 3.0 ([2.0.4](https://github.com/Kofktu/KUIActionSheet/tree/2.0.4))## Installation
#### CocoaPods
KUIActionSheet is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "KUIActionSheet"
```## Usage
#### KUIActionSheet
```Swift
import KUIActionSheetlet actionSheet = KUIActionSheet.view(parentViewController: self)
actionSheet?.add(customView: UIView)
actionSheet?.add(item: KUIActionSheetItem(title: "Menu1", destructive: false) { [weak self] (item) in
print(item.title)
})
actionSheet?.add(item: KUIActionSheetItem(asyncTitle: { (completion) -> Void in
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0, execute: {
completion("Async Title")
})
}, handler: { (item) in
print(item)
}))
actionSheet?.show()```
#### CustomView
```Swift
class CustomView: UIView, KUIActionSheetItemViewProtocol {
func ... () {
actionSheet?.dismiss()
}
}```
#### CustomTheme
```Swift
public protocol KUIActionSheetProtocol {
var backgroundColor: UIColor { get }
var showAnimationDuration: NSTimeInterval { get }
var dimissAnimationDuration: NSTimeInterval { get }
var blurEffectStyle: UIBlurEffectStyle { get }
var itemTheme: KUIActionSheetItemTheme { get }
}public protocol KUIActionSheetItemTheme {
var height: CGFloat { get }
var font: UIFont { get }
var titleColor: UIColor { get }
var destructiveTitleColor: UIColor { get }
}```
## Authors
Taeun Kim (kofktu),
## License
KUIActionSheet is available under the ```MIT``` license. See the ```LICENSE``` file for more info.