-
-
Notifications
You must be signed in to change notification settings - Fork 940
Closed
Description
I'm using segues on my project. Navigation is performed using code like
[self performSegueWithIdentifier:@"editData" sender:self];
And the data to be edited is asigned to destination view controller on the prepareForSeguemethod
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"editWorkerProfile"])
{
UINavigationController* navController = [segue destinationViewController];
MyEditorViewController *editorController = (MyEditorViewController *) [navController topViewController];
editorController.data = dataToBeEdited;
}
}
The destination ViewController is initialized using "initWithCoder" and form structure is created on the "viewDidLoad" (Because data property is assigned after initialization).
With te "1.0.0" version of XLForm I used a "trick" like this on destination ViewController:
- (id)initWithCoder:(NSCoder*)aDecoder
{
if(self = [super initWithCoder:aDecoder])
{
XLFormDescriptor * form = [XLFormDescriptor formDescriptorWithTitle:@"work profile"];
return [super initWithForm:form]; // Second init... it works with XLFrom 1.0.0!!!
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Form content is built after initialization
[self buildForm: self.form withData: self.data];
}
With the actual git XLForm version this code is not working anymore: form appears empty...
¿What's the correct way to use XLForm with storyboard & segues?
Metadata
Metadata
Assignees
Labels
No labels