Eureka: callback keyboard button done

Created on 27 Jan 2017  路  2Comments  路  Source: xmartlabs/Eureka

hello can you add an callback when user click on a button done of the keyboard please ?

I added that in your code source, but i think other peoples want this also?

ps: Source Code

Core/BaseRow.swift
open class BaseRow : BaseRowType { var callbackDiddone: (()-> Void)? (...) }

Core/RowType.swift
in "extension RowType where Self: BaseRow " add:
@discardableResult public func didDone(_ callback: @escaping (Self) -> ()) -> Self{ callbackDiddone = { [unowned self] in callback(self) } return self }

Core/Core.swift
in "extension FormViewController" add :
func navigationDone(_ sender: UIBarButtonItem) { tableView?.endEditing(true) self.actualRowDone?.callbackDiddone!() }

Core.swift
in "open class FormViewController : UIViewController, FormViewControllerProtocol" add:
open var actualRowDone: BaseRow?

Core.swift
in "open class FormViewController : UIViewController, FormViewControllerProtocol "
in "open func inputAccessoryView(for row: BaseRow) -> UIView? " add:
actualRowDone = row

easy feature request

Most helpful comment

Hi @Lausbert
why don't make these 2 methods open...?

    func navigationDone(_ sender: UIBarButtonItem) {
        tableView?.endEditing(true)
    }

    func navigationAction(_ sender: UIBarButtonItem) {
        navigateTo(direction: sender == navigationAccessoryView.previousButton ? .up : .down)
    }

All 2 comments

Hi @Lausbert
why don't make these 2 methods open...?

    func navigationDone(_ sender: UIBarButtonItem) {
        tableView?.endEditing(true)
    }

    func navigationAction(_ sender: UIBarButtonItem) {
        navigateTo(direction: sender == navigationAccessoryView.previousButton ? .up : .down)
    }

Would like to see this as well, is there another way to accomplish?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tomas1405 picture Tomas1405  路  3Comments

pteasima picture pteasima  路  3Comments

zoul picture zoul  路  3Comments

Sweeper777 picture Sweeper777  路  3Comments

smileatom picture smileatom  路  3Comments