Latest 0.1.7
Homepage https://github.com/nExmond/NXMActionSheet
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform
Language

Preview

demo

Requirements

Written as Swift 4 and tested on iOS 9.

Installation

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

pod 'NXMActionSheet'

Usage

import NXMActionSheet

Basic

Chaining

//add items
add(imageViewData)
.add(datas: labelViewDataList)
.insert(twoButtonData, at: 0)
.end(oneButtonData)

Default views make it easy to show

NXMActionSheet()
            .add(NXMActionSheetData(.IMAGE(/*image*/))))
            .add(NXMActionSheetData(.ACTIVITY_INDICATOR(.gray)))
            .add(NXMActionSheetData(.SLIDER(0.5, nil)))
            .add(NXMActionSheetData(.LABEL("Label")))
            .add(NXMActionSheetData(.BUTTON("Button", UIColor.brown, nil), withTouchClose: true))
            .show()

Inherit & Custom

When using inheritance, be sure to include the following functions

class CustomActionSheet : NXMActionSheet {

    convenience init (withType:NXMActionSheetAnimationType = .SLIDE) {
        self.init(frame: .zero)
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}

Create .xib and .swift with the same name and use it as follows

//ImageView
let imageView:CustomImageView = CustomImageView.loadUINibView()
imageView.ImageView.image = /*image*/
let imageViewData = NXMActionSheetData(.CUSTOM(imageView))
...
add(imageViewData)

please check the example for details

Delegate

//require
func didSelectActionItem(_ actionSheet:NXMActionSheet, withData:NXMActionSheetData)

//optional
func actionSheetWillShow()
func actionSheetDidShow()
func actionSheetWillHide()
func actionSheetDidHide()
func actionSheetWillUpdate()
func actionSheetDidUpdate()

!!

If content height in UITableView is larger than UIScreen height, scrolling is enabled.
However, if you set the scroll position on update, it is possible that the transition is not smooth.

Example

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

Author

nExmond, [email protected]

License

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

Latest podspec

{
    "name": "NXMActionSheet",
    "version": "0.1.7",
    "summary": "Easy to use Custom ActionSheet.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/nExmond/NXMActionSheet",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "nExmond": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nExmond/NXMActionSheet.git",
        "tag": "0.1.7"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "NXMActionSheet/Classes/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This