It's possible to make a uitableviewcell draggable - iphone

and I want to make the tableviewcells draggable, but outsite the tableview.
Is this possible?

I don't believe you can make drag the cell outside of it's containing view, but it is possible to create a view on top of the tableview and drag that where you want it. You'd probably want to delete the cell from the table as soon as the user selected the cell to make it look like he grabbed the cell from the table.

Related

How to show custom options on swipe table cell in a simple way

I am working on a app which includes table cells. I want that when i swipe table cell it shows two options, first about that cell value and another for delete that value. How can i show that in a way that the cell value shows in half of cell and the options show in half of cell.
Thanks in advance.
There are an out of the box solution, called HHPanningTableViewCell. It does exactly what you need!
HHPanningTableViewCell is a UITableViewCell implementing "swipe to reveal" a drawer view. Such a view typically holds action buttons applying to the current row.
This library, SWTableViewCell, should help you:
https://github.com/CEWendel/SWTableViewCell
An easy-to-use UITableViewCell subclass that implements a swipeable content view which exposes utility buttons (similar to iOS 7 Mail Application)
You have to create a custom cell and override Apple's behavior which is swipe left to delete and then show your options. You can add gesture recognizer to the cell and on swipe to left animate the cell content view and animate in your option view or however you like it to be. I can write up an example code if you need.

UITableView - Add subview to cell content view on row selection

How can I add an UIView as a subview in a cells contentView when the user has tapped the cell, and remove the same UIView when the user taps that cell again?
I am trying to make a list of photos in a UITableView with expand/collapse button. The UIView that I want to add is the container of photo's information. Instagram accomplished it, but I cant figure out how to do it
Please help me guys :)
Thanks!!!
I don't think you want to add a subview to the cell, but you want to add another cell to the already existing table. This way, you can achieve an "expand/collapse" feel to your table by using insertRowsAtIndexPaths:withRowAnimation:
Good luck!
Adding and removing the views in the cell should be easy enough inside didSelectRow, but you may need to keep track of which rows are in what state (big or small) by recording that in a mutable array. The bigger issue you will have is adjusting a cell's height, but look here for that.

Custom cell in UITableView

I am making a custom cell which has text fields and as a result the custom cell is greater than the size of the iphone screen.But i am not being able to do horizontal scroll to reach the end of the cell.
I have tried using viewController and adding table view to it as well as creating table view controller and adding custom cell to it.
when doing it through TableViewController,I am not able to horizontally scroll it,whereas i am not getting how to add Custom cell class to the tableView object placed in viewController.I know that UITableView is a subclass of UIScrollView but not able to implement it.Please help.
Thanks
as per the documentation at
A table view in the UIKit framework is limited to a single column
because it is designed for a device with a small screen. UITableView
is a subclass of UIScrollView, which allows users to scroll through
the table, although UITableView allows vertical scrolling only.
so as desired in your case you will have to take some other approach. Now using Custom cell with TextFields should not actually need you to require Horizonatl scrolling. If the text is really large you would like to consider using TextView instead of TextFields.
Hope it helps
Ideally, you should be truncating your text. But if it is important for you to display the entire text, add a scroll view as a subview (or set it as the content view) and add your labels to the subview. Each cell will then be individually horizontally scrollable.

How to add customized cell in tableview when user selects cell

I want to add my customized tableviewcell in my tableview when user selects a cell I have some buttons on that customized cell and want to give user option as soon he selects a cell.
Any suggestions and guidance to move on from here?
you have to use customize cell when cell is created and change the image of the cell when it will selected.
Create two custom cells, one for the normal rows and other for the required row. When the user touches a particular cell, you can record it's indexPath and reload the tableView. When the cellForRowAtIndexPath is called the second time after tableView reload, you can identify the row with the flag set earlier. You can then create a new cell for it.

How to add UITableViewCellAccessoryCheckmark in the middle of the cell in iphone?

In my iPhone application I have used (UITableViewCellAccessoryCheckmark) to add the checkmarks in the cells, - it is added to the cell at the right side of the cell.
I want the checkmarks to display in the middle of the cell and after that a string should display. So that the user can set the cell item as checked or unchecked.
Please provide any solution or any code for adding the (UITableViewCellAccessoryCheckmark) in the middle of the cell.
There is no built in way to do this. You will have to create a cell, then in tableView:cellForRowAtIndexPath: you will need to either add a custom subview, or return a custom cell and tell it to display the custom checkmark you added based on the data state.
The accessory view of the cell is always on the right side, outside of the cell's content view (see the Table View Programming Guide for more on this). If you want to do something like this, you really need to create your own cell class, and draw the checks yourself.
Speaking as a user, this design seems sort of confusing, and definitely not what I'd expect. What's the string you're displaying to the right of the check? Maybe something like the UITableViewCellStyleValue1 style cell would work, instead? (See Standard Styles for Table-View Cells for more.)