Latest 2.6.0
Homepage https://github.com/Kofktu/KUIActionSheet
License MIT
Platforms ios 9.0, requires ARC
Authors

Swift
CocoaPods
Carthage compatible

Custom UIActionSheet for Swift

alt tag
alt tag
alt tag
alt tag

Requirements

  • iOS 8.0+
  • Xcode 9.0
  • Swift 4.2
  • Swift 3.0 (2.0.4)

Installation

CocoaPods

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

pod "KUIActionSheet"

Usage

KUIActionSheet

import KUIActionSheet

let actionSheet = KUIActionSheet.view(parentViewController: self)

actionSheet?.add(customView: UIView<KUIActionSheetItemViewProtocol>)
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

class CustomView: UIView, KUIActionSheetItemViewProtocol {

    func ... () {
      actionSheet?.dismiss()
    }
}

CustomTheme

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), [email protected]

License

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

Latest podspec

{
    "name": "KUIActionSheet",
    "version": "2.6.0",
    "summary": "Custom UIActionSheet",
    "description": "Custom UIActionSheet for Swift",
    "homepage": "https://github.com/Kofktu/KUIActionSheet",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kofktu": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/Kofktu/KUIActionSheet.git",
        "tag": "2.6.0"
    },
    "source_files": "KUIActionSheet/Classes/**/*.{swift}",
    "resources": "KUIActionSheet/Assets/*.{png,xib}",
    "requires_arc": true
}

Pin It on Pinterest

Share This