Form Elements
GSDFormCellTextFieldActionView
The element which will display the row with textfield
Example:
1 2 3 4 5 6 7 | let tempValidation = StringLengthValidation() var tempAction = GSDFormCellTextFieldActionView() _ = tempAction.addValidation(validation: tempValidation, validationMode: ValidationType.onContentChange) tempAction.identifier = "SimpleAction" tempAction.actionLabelTitle = "Simple textfield" tempAction.groupIdentifier = "FirstGroup" self.addRow(actionView: tempAction) |
Example:
GSDFormCellDatePickerActionView
The element which will allow to show the DatePickerView. There are three modes of datepicker:
DatePicker (default mode) TimePicker *DateAndTimePicker
Example:
1 2 3 4 5 6 7 | let dateFormElement = GSDFormCellDatePickerActionView() dateFormElement.actionLabelTitle = "Date Picker View" //dateFormElement.setTypeTime() //Changing the style to time picker //dateFormElement.setTypeDateAndTime() // Changinf the style to date and time picker dateFormElement.identifier = "DatePicker" dateFormElement.groupIdentifier = "FirstGroup" self.addRow(actionView: dateFormElement) |
GSDFormCellSliderActionView
The element which will allow to show row with slider on the right.
Example:
1 2 3 4 5 | let sliderView = GSDFormCellSliderActionView() sliderView.identifier = "SliderView" sliderView.actionLabelTitle = "Example of Slider" sliderView.groupIdentifier = "FirstGroup" self.addRow(actionView: sliderView) |
GSDFormCellSwitchActionView
The element which will allow to show row with switch view on the right.
Example:
1 2 3 4 5 | let switchView = GSDFormCellSwitchActionView() switchView.identifier = "SwitchView" switchView.actionLabelTitle = "Example of UISwitch" switchView.groupIdentifier = "FirstGroup" self.addRow(actionView: switchView) |
GSDFormCellPickerActionView
The element which will allow the user to create his own row with his own data. Element takes as an parameter GSDFormCellPickerViewOption. It is class which represents one possible option which will be displayed in picker view. Sample usage is shown in example:
Example:
1 2 3 4 5 6 7 8 9 | let ownPickerView = GSDFormCellPickerActionView() ownPickerView.actionLabelTitle = "Picker view title" for i in 0..<10 { var tempPickerElement = GSDFormCellPickerViewOption() tempPickerElement.key = "KEY + \(i)" tempPickerElement.value = "VALUE + \(i)" ownPickerView.pickerViewOptions.append(tempPickerElement) } self.addRow(actionView: ownPickerView) |
GSDFormCellAutosuggestionTextFieldActionView
The element which will allow to show row with textfield. While typing the developer will be able to catch the typed text and changed the results showed inside the drop down to ther user. One has to fill the element with the results, which will be showed to the user:
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 | let dropDownView = GSDFormCellAutosuggestionTextFieldActionView() dropDownView.identifier = "DropDownView" dropDownView.actionLabelTitle = "Example of drop down" var tempDataObjectSet:[TestDropDownResult] = [] for i in 0...10 { let tempObject = TestDropDownResult() tempObject.testDescription = "Description \(i)" tempObject.testTitle = "Title \(i)" tempDataObjectSet.append(tempObject) } dropDownView.changeDataObjects(dataObjects: tempDataObjectSet) self.addRow(actionView: dropDownView) |