xmartlabs / XLForm

XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C.
MIT License
5.77k stars 953 forks source link

prepareForSegue not called if destination view controller is an XLFormViewController subclass #256

Open everestman27 opened 9 years ago

everestman27 commented 9 years ago

I have a tableviewcontroller (TVC1) that segues to XLFormViewController subclass (TVC2) upon selecting a row in TVC1.

I invoke the segue in TVC1 by invoking "performseguewithidentifier.." method . I find that the prepareForSegue method is not called in TVC1 even though it is defined.

This occurs only when the destination viewcontroller is an XLFormViewController subclass and not otherwise.

I wanted to check if there is some configuration in XLFormViewController that is required to be set so that prepareForSegue is called in TVC1.

Here is the code for initializing XLFormViewController subclass TVC2..I suspect there is something around where I call the DSL initialization logic (initializeForm in this code) that is messing up prepareFromSegue from being called.

required init(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
    self.initializeForm()
}

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
    super.init(nibName:nibNameOrNil, bundle:nibBundleOrNil)
}
misuqian commented 8 years ago

The same issue. can anyone figure it ~

misuqian commented 8 years ago

I figure it by a terrible way

add @property id segueData; in XLFormViewController.h

so you can change the segueData in prepareForSegue

mats-claassen commented 8 years ago

This method is getting called for me. Seems to be working fine...