You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
Hey, I am trying to set a value using a MultipleSelector row, and can't figure out how to select one of the values by doing something such as row.value = "example"
In my code its for the purpose of editing an item after creating it.
In the example:
row = FormRowDescriptor(tag: Static.categories, rowType: .MultipleSelector, title: "Categories")
row.configuration[FormRowDescriptor.Configuration.Options] = [0, 1, 2, 3, 4]
row.configuration[FormRowDescriptor.Configuration.AllowsMultipleSelection] = true
row.configuration[FormRowDescriptor.Configuration.TitleFormatterClosure] = { value in
switch( value ) {
case 0:
return "Restaurant"
case 1:
return "Pub"
case 2:
return "Shop"
case 3:
return "Hotel"
case 4:
return "Camping"
default:
return nil
}
} as TitleFormatterClosure
if I was to do:
row.titleForOptionValue("Restaurant");
or row.titleForOptionValue(0);
or row.value = "Restaurant"
or row.title = "Restaurant"
Then the selected option still shows up as nothing
How can I get it so that it displays one of the options by default when the form loads?
Thanks
The text was updated successfully, but these errors were encountered:
Hey, I am trying to set a value using a MultipleSelector row, and can't figure out how to select one of the values by doing something such as row.value = "example"
In my code its for the purpose of editing an item after creating it.
In the example:
row = FormRowDescriptor(tag: Static.categories, rowType: .MultipleSelector, title: "Categories")
row.configuration[FormRowDescriptor.Configuration.Options] = [0, 1, 2, 3, 4]
row.configuration[FormRowDescriptor.Configuration.AllowsMultipleSelection] = true
row.configuration[FormRowDescriptor.Configuration.TitleFormatterClosure] = { value in
switch( value ) {
case 0:
return "Restaurant"
case 1:
return "Pub"
case 2:
return "Shop"
case 3:
return "Hotel"
case 4:
return "Camping"
default:
return nil
}
} as TitleFormatterClosure
if I was to do:
row.titleForOptionValue("Restaurant");
or row.titleForOptionValue(0);
or row.value = "Restaurant"
or row.title = "Restaurant"
Then the selected option still shows up as nothing
How can I get it so that it displays one of the options by default when the form loads?
Thanks
The text was updated successfully, but these errors were encountered: