xmartlabs/XLForm — pull request #142 by csteynberg (2014-09-19 04:59:21+00:00)
Title: Resolves issue #46 by providing a readonly property for the form

This pull request makes it possible to set an entire form to read-only mode.

In this case, read-only means that the cells are not disabled (and thus not grayed out), but simply don't respond to user interactions. Only cell types that can change field values are affected.

The advantage here is that it is not necessary to reload the table view, which means that you can make the form readonly by simply changing the new readOnlyMode property on the view controller.

I had to remove the -(XLFormViewController *)formViewController selector in XLBaseCell and replace it with a weak reference that is then set in the form view controller when instantiating the cell. This was necessary because to the old selector always returned nil for cells that contain controls other than UITextField and UITextView.

To make a form read-only, simply set readOnlyMode to YES.