Customising and Deleting a Cell in UITableview - ios

I am converting a sample html app to ios i have a table view with edit button as shown in figure.when i click that edit button the buttons with (-) symbols should appear for all the cells and if i click that minus button that particular cell should get delete.I tried it but i can add only two the last row.Here I am loading the cell from the nib.

If you post your current code we can help you better, however I suggest you to implement this algorithm:
Reload your table, set a default style to your custom cell to hide the "-" button
If user touch the "edit" button, reload you table and set a delete style to your custom cell to show the "-" button
When user clicks the "-" button, delete it from datasource and reload your table

Related

How to Reset/Clear selected cells

In Google sheets, is it possible to clear selected cells???
when I say "clear" I would like the cells to restore there default font (color/size/style), reset the cell background, reset any cell border style, reset the math functions on the cell, delete any notes or comments add to the cell.
I try to select a few cell and click the "delete" button, that this will only remove the cell value.
yes, that's possible. select cells you want to reset and press CTRL + \ which will handle formatting.
then press BACKSPACE or DELETE for content removal
and you can enter note edit mode with SHIFT + F2

How to repeat text fields when I hit the submit button in swift 3

I am making a fitness app using swift 3.
What I am trying to do is to have a text field where the user enters the exercise then under that another three text fields (one for the sets, reps, and weight). When the user clicks the "Add exercise button" underneath it repeats these text fields so the user can fill in the next exercise and so on.
How do I get the four text fields to pop up again after the user presses the "Add exercise button?
Thanks
Make Simple TableList. when hit Submit button just increase Field List Count . TableList has only cell in start .
func addNewField(){
FieldListCount = FieldListCount + 1
tableView.reloadData
}
You can do that with UICollectionView and add footer to collectionView. For example:
Create a collectionView, each cell in collectionView has some textFields. And footer of this collectionView has a button "Add new exercise".
When button is tapped, add new cell to collectionView.
Preferred Solution :
User Custom Text Field view and on the press of submit button, after that add that TextField View into UIScrollView with increment in Y position. If use tableList some textField will not be created(not in memory) until the user will scroll the table list.

Toggle Custom UITableViewCell Radio Button

I have a custom cell where it displays a table like structure with multiple columns.
Each row has a column that is a button that will perform different tasks.
My issue is trying to get the middle column to communicate its state with the other rows.
Initially everything will be grey (not selected) but, when I tap the middle column button, the state will be green. When I select a different row that button will turn green and the previous row would be grey.
Again, each column in the row is a button that does something different (i.e. the right button loads up a modal view). I have tried to use
didSelectRowAtIndexPath but, with the overlapping custom views it does not seem to read the selection.
Any help would be appreciated

add new text field on + button click in a view in swift

I'm new in iOS-swift. I need to add new text field after clicking "+" button.
Please check this image:
There is one text field already. I need to add
1) one text filed
2) one + button beside new text field
3) - button beside old text field
clicking "+", will add and clicking "-" will remove text field.
any help would be appreciated....
Use Table view.
Design TableViewCell which have textfield and button and custom
twxtfield class must have property for define + or - button should
be added to cell and this property also helpful to handle -/+ with
one button.
When + button clicked you need to add one row to table view and on -
clicked you need to remove row from tableview
you can refer to add/remove check it
1) You can easily achieve it by tableview.
2) One row, in which textfield and + button is there.
3) Once you click on add button, add new row with textfield and - button.
4) Once you click on -, remove row from tableview.
EDIT
Here is demo link, how to add/remove row in tableview
http://objectivecwithsuraj.blogspot.in/2012/10/uitableview-add-or-remove-rows.html

how to edit text in uitableview cells by toggling section visibility

I have a uitableview with multiple sections. I want to let user edit all rows of one section. The text is originally displayed with UILabels in section (Say section B). Is it possible to do something like this?
Add an extra section (Say section C) with UITextView, and the same content as section B, But keep it hidden.
Add an edit button somewhere so when user hits it, Section B hides, Section C shows up with two option buttons (Update, Cancel).
Depending on what they choose, perform the action (say submit to server if Update is clicked, or Cancel and move to step 4 if cancel button is pressed)
Hide the editable section C, Show section B (with new content if edited).
OR is there a better way to do this?

Resources