skywinder / ActionSheetPicker-3.0

Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.
http://skywinder.github.io/ActionSheetPicker-3.0
BSD 3-Clause "New" or "Revised" License
3.4k stars 740 forks source link

ActionSheetStringPicker change button title #397

Closed reecreateeduardo closed 4 years ago

reecreateeduardo commented 6 years ago

Hi, I have tried countless options to try and change the title of the button with ActionSheetStringPicker.

Could anyone help me with that?

` @IBAction func pickerBtnClicked(_ sender: Any) { ActionSheetStringPicker.show(withTitle: "Categories", rows: item, initialSelection: 1, doneBlock: { picker, value, index in

        print("value = \(value)")
        print("index = \(String(describing: index))")
        print("picker = \(String(describing: picker))")

        return
    }, cancel: { ActionStringCancelBlock in return }, origin: sender)

}`

Any ideias? really stuck

skywinder commented 6 years ago

Hello please kindly check example:

@IBAction func navigationItemPicker(_ sender: UIBarButtonItem) {
        ActionSheetStringPicker.show(withTitle: "Nav Bar From Picker", rows: ["One", "Two", "A lot"], initialSelection: 1, doneBlock: {
            picker, value, index in

            print("value = \(value)")
            print("index = \(index)")
            print("picker = \(picker)")
            return
        }, cancel: { ActionStringCancelBlock in return }, origin: sender)
    }

Doest it work for you?

xjki commented 5 years ago

You can see example of picker with custom button here: https://github.com/skywinder/ActionSheetPicker-3.0/blob/66394209eb07037d2c1d83fb6251677b808012ce/Example%20Projects/Swift-Example/Swift-Example/ViewControllers/SWTableViewController.swift#L179

skywinder commented 4 years ago

Feel free to reopen the issue, if you still need help. 👍

skywinder commented 4 years ago

@all-contributors please add @xjki for developers, question, example

allcontributors[bot] commented 4 years ago

@skywinder

I've put up a pull request to add @xjki! :tada: