Latest 0.1.2
Homepage https://github.com/pushian/YFPopupButtons
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Demo Gif

Example

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

Installation

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

pod "YFPopupButtons"

How To Use

Initialization

var testView = YFPopupButtonsView()
testView.delegate = self

Core Functions

  • Display the button view and pop up the buttons.
    testView.show()
  • Dismiss the button view and the buttons. Normally, the user does not have to call this function in their own code because there are alreay built in dismiss actions in the view.
    testView.dismiss()

Delegate Functions

  • Indicate the total number of buttons.
    func numOfItems(buttonsView: YFPopupButtonsView) -> Int
  • Indicate the maximum number of buttons allowed for display in a single row.
    func maxNumberOfItemsInRow(buttonsView: YFPopupButtonsView) -> Int
  • Define the size for all the buttons.
    func itemSize(buttonsView: YFPopupButtonsView) -> CGSize
  • Initialize and customize the buttons.
    func buttonsView(buttonsView: YFPopupButtonsView, itemForIndex index: Int) -> YFPopupbotton

    Example of Defining Round Buttons with Image and Title.

func buttonsView(buttonsView: YFPopupButtonsView, itemForIndex index: Int) -> YFPopupbotton {
    let button = YFPopupbotton(contentImage: UIImage(named: "fbIcon")!, title: "Title")
    button.contentImageView.layer.cornerRadius = 30
    button.contentImageView.backgroundColor = .whiteColor()
    button.contentImageView.contentMode = .ScaleAspectFill
    return button
}
  • Customize the actions triggered by clicking a certain button.
    func buttonsView(buttonsView: YFPopupButtonsView, didTapItemAtIndex index: Int)
  • Define the space left between the left-most button/right-most button and the view.
    func sideMargin(buttonsView: YFPopupButtonsView) -> CGFloat
  • Define the sapce between two rows of the buttons
    func spaceBetweenRows(buttonsView: YFPopupButtonsView) -> CGFloat
  • Customize the actions triggered before the display of the buttons.
    func buttonsViewWillAppear(buttonsView: YFPopupButtonsView)
  • Customize the actions triggered after the buttons being dismissed.
    func buttonsViewWillDisappear(buttonsView: YFPopupButtonsView)

    Author

pushian, [email protected]

License

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

Latest podspec

{
    "name": "YFPopupButtons",
    "version": "0.1.2",
    "summary": "A subclass of UIView which is capable of popping up buttons from the bottom of the view.",
    "description": "A subclass of UIView which is capable of popping up buttons from the bottom of the view. The users would be able to customize the buttons.",
    "homepage": "https://github.com/pushian/YFPopupButtons",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "pushian": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pushian/YFPopupButtons.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YFPopupButtons/Classes/*",
    "resource_bundles": {
        "YFPopupButtons": [
            "YFPopupButtons/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This