Git Product home page Git Product logo

Comments (9)

mtnbarreto avatar mtnbarreto commented on August 25, 2024 17

@tp
it's not a common scenario. Let's see if someone else ask for it to define if it worth adding it.
Anyway I think you can easily accomplish it by doing:

        for row in form.rows {
            row.baseCell.userInteractionEnabled = false
        }

from eureka.

Isuru-Nanayakkara avatar Isuru-Nanayakkara commented on August 25, 2024 3

I too would say this is a 'nice to have' feature. I know it's not too dofficult to do the workaround but still it would look clean if I didn't have to call the baseCell.

from eureka.

davidrft avatar davidrft commented on August 25, 2024 2

I also think this is a nice to have future. I think this workaround:

       for row in form.rows {
            row.baseCell.userInteractionEnabled = false
        }

is not so good because it disables all kinds of interactions with the row, including scrolling, which is a interaction that a readonly mode should be able to handle.

My workaround for this was:

class ExampleViewController: FormViewController, UITextViewDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        TextAreaRow.defaultCellSetup = { cell, row in
            cell.textView.delegate = self
        }
    }

    func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
        return false
    }

}

from eureka.

radvansky-tomas avatar radvansky-tomas commented on August 25, 2024 1

Not really because if you make row with user interaction == false, then events are not fired, and therefore it cant react to selections...so its not a solution

from eureka.

tp avatar tp commented on August 25, 2024

Thanks this solves the issue nicely and looks exactly as I would expect from a "read-only" mode. :-)

from eureka.

radvansky-tomas avatar radvansky-tomas commented on August 25, 2024

So can you extend read-only to fields as well ?

from eureka.

gudleyd avatar gudleyd commented on August 25, 2024

Not really because if you make row with user interaction == false, then events are not fired, and therefore it cant react to selections...so its not a solution

Hi, did u solve this problem?

from eureka.

radvansky-tomas avatar radvansky-tomas commented on August 25, 2024

I've done some PR, wasnt accepted #1653

from eureka.

itimotin avatar itimotin commented on August 25, 2024

I did in this way

form +++ Section("DATA")
             <<< TextRow() {
                  $0.title = "Code"
                  $0.tag = "Code"
                  $0.cellSetup { cell, row in
                  cell.textField.isUserInteractionEnabled = false
               }
               }.onCellSelection { cell, row in
                   let codeSectionViewController = CodesTableViewController()
                   self.navigationController?.pushViewController(codeSectionViewController, animated: true)
}

for my case I need to move to another view controller, to select multiple values and to return the selected rows back, for start I used MultipleSelectorRow, but I had troubles to display my object in MultipleSelectorViewController. For that I disabled the textfield, and each tap is detected by baseCell and it pushes to CodesTableViewController.
Back I sent data through delegate.

I decided to use this way instead to create my CustomMultipleSelectorRow.

from eureka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.