Tag: uitableview

UITableView Drag & Drop Outside Table = Crash

The Good My drag & drop function almost works wonderfully. I longPress a cell and it smoothly allows me to move the pressed cell to a new location between two other cells. The table adjusts and the changes save to core data. Great! The Bad My problem is that if I drag the cell below […]

Refreshing UITableView Asynchronously after Core Data Loaded Swift

I have a UITableView, tViewNews I have a refresh function which downloads data from my server, stores it into core data, and then the table view loads this data from core data. It works perfectly func refresh(refreshControl: UIRefreshControl) { self.newsArray = [NewsItem]() self.newslists = [[NewsItem]]() self.getNewsFromServer() self.getNewsFromCoreData() self.tViewNews.reloadData() refreshControl.endRefreshing() } Now, when the user first […]

Presenting a View Controller with a button in a UITableViewCell programmatically (Swift)

I am trying to make it where when a user clicks on a table view cell in my table view it takes them to a new view controller. More specifically, when a user clicks on a persons username it should take them to that users profile. the username being the table view cell and the […]

Is it possible to use iOS 11 Drag and Drop to reorder multiple items/cells at a time in UITableView?

I know it’s possible to reorder a single item/cell at a time when using the new UITableViewDropDelegate and UITableViewDragDelegate delegates but is it possible to support handling multiple. For example in this screenshot I am holding a single item: And dropping the cell puts it in to place. However when I grab multiple cells I […]

How to increase the single row height without reloading UITableView or individual cells ?

I want to expand the row height and show the content inside. I show my content in view I want when I tap on a cell it should expand like showed in the image below but without reloading the UITableview. What I have tried till now. 1) I tried expanding the view inside but it […]

Detecting double and single tap on UITableViewCell to perform two action

I have a PFQueryTableViewController in which I am trying to learn some tableView interactions. What I currently have: The tableView cell increases its height on a tap didSelectRowAtIndexPath or I can basically segue cell related data to next viewController using performSegueWithIdentifier together with prepareForSegue using a single tap. In the below code, if I comment […]

Map Object into 2D Array Swift for TableView Sections

I could not figure out a better way of doing this. I am mapping all the properties of the Student Object into a 2D Array. So my TV has sections. I cannot use a Static Tableview either, if so this problem would not exist. So my code in the TVC let currentUser = PFUser.currentUser()! as! […]

Fade in UITableViewCell row by row in Swift

I am new to swift, I am trying to have a UITableView and the cells will be animated to appear one by one. How can I do that? Also, if the newly appeared row of cell not on the screen (hiding below the table). How can I move the table up when each cell appear? […]

iOS 8 UITableView first row has wrong height

I’m working on an app where I face a strange issue. I’ve created a UITableViewController in the storyboard and added a prototype cell. In this cell, I’ve added an UILabel element and this UILabel takes up the whole cell. I’ve set it up with Auto Layout and added left, right, top and bottom constraints. The […]

Swift – UITableView scroll event

I was wondering how to detect if the UITableView is scrolled (up or down). I want to hide the keyboard when the UITableView is scrolled with self.view.endEditing(true). Thanks in advance