Questions tagged [uitableview]

20269 questions
1

votes
3

answer
2.9k

Views

need help reading plist file in objective c

I have been trying read data from a plist file. this is how it is structured |term|detail(string)| my properties : @property (nonatomic, strong) NSDictionary *terms; @property (nonatomic, strong) NSArray *termKeys;//this is just a array to keep track @property (nonatomic, strong) NSString *detail; t...
meda
1

votes
0

answer
15

Views

UITableView blurred background

I have a UITableViewController (static table) to which I add a background image with (in viewDidLoad): tableView.backgroundView = UIImageView(image: UIImage(named: 'login_bg.jpg')) How do I add the blurred effect to that background image? I tried with: (in viewDidLoad) let blurEffect = UIBlurEffec...
Mario Burga
1

votes
0

answer
20

Views

Pinning the bottom cell of a tableview on rotation

Just like in Telegram or Whatsapp, when the device rotates, the bottom cell should stay anchored to the bottom of the screen. However, when I rotate my device, the top cell is being anchored and stays foot. Couldn't find any solution online. Here is how I want a rotation to look like:
Nimrod Shai
1

votes
1

answer
70

Views

Swift UITableViewCell reusing is messing up tags / app has wrong calculation

I am making unit converter app with custom cells, every cell has a textbox inside and the idea was when u enter the value in one unit all units get calculated automatically, the problem is only when there are more cells and when u need to scroll when cells get reused they mess up tags and because my...
Dusan Dimic
1

votes
0

answer
235

Views

After adding and updating sticky with stretchy header in tableView, its scroll becomes jerky

I am developing a custom tableView with stretchy headerView and it also has sticky headerView. I have successfully achieved it by updating its contentInset and contentOffset properties. But after updating its contentInset the scroll becomes jerky. Below is the code for the same: I have added below c...
Akruti
1

votes
1

answer
47

Views

Why UITableView calculate its contentSize based on its default rowheight(44) not custom rowHeight

here is the question: if you have 20 cells and set tableView.rowHeight = 60, and after tableView load its data , its contentSize is 44*20=880 not 20*60=1200 what should i do if i want the contentSize is 1200
LE24
1

votes
1

answer
87

Views

Change UISlider controller when Table row clicked

I want to create a UISlider that when a user selects a tableview row. It updates the min & max value moves the slider to a value set by a variable. The slider is in a different Viewcontroller then the tableview. I am passing the values to the slider using a struct (Posted below). At this point, I ca...
k.thomas
1

votes
3

answer
65

Views

Why got I this error on my UISwipeGestureRecognizer?

I got this error on my UISwipeGestureRecognizer in my custom class cell manager It's working in my main UITableViewController class... I create a new instance in my ViewDidLoad with : let updateClass = updateCell() updateClass.swiper() I'm not pretty sure but on this thread, I should may be use lazy...
Danyl
1

votes
1

answer
551

Views

UITableView - footer for section - iPhoneX

I have problem with iPhone and UITableView section footer. It is being 'hidden' behind the top cut-out section. I have this code: override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { var content = 'some long text' let footerView = UIView(frame: CGRect(x...
Martin Perry
1

votes
1

answer
511

Views

Section Header of UITableview not pin at the top when scroll up - Swift

Normally, When I create table with style grouped, there are no any problem with section header. when I scroll up, the section header always stay at the top even when scroll pass it. I create one sample tableview using group style, section header not stay at the top when I scroll up like before. mayb...
Leang Socheat
1

votes
0

answer
30

Views

Core Data: split into sections based on custom logic

I have a large data set of objects, made up of 2 large-ish subsets. Set 1 has about 10,000 objects in it. Set 2 has about 70,000 objects in it. The object sets have many-to-many relationships between them. There are also 'favorites' subsets for both sets. Before I display set 1 or set 2, I will have...
mbm29414
1

votes
0

answer
36

Views

Checking Against Value From Array and Return Cell

I've 2 arrays A and B. Take for instance Array A has a field A1, and Array B has 2 fields B1 and B2. Both arrays contain the same variable - A1, B1 I'm trying to check the value of Array B (B1) against the Section Header Text of a TableView Since indexPath.section and indexPath.Row are used in Tabl...
ybba
1

votes
0

answer
54

Views

Sharing code between UITableViewCell & UITableViewHeaderFooterView subclasses

Currently, I've a UITableViewCell subclass that has the same view as UITableViewHeaderFooterView subclass. I setup the subclass views programmatically that includes a bunch of UILabels and UIImageviews. Currently, I've just copy/pasted the code between the two files. I was wondering if there is a wa...
JGlee
1

votes
1

answer
33

Views

UIImageView is displaying not correct

I've placed UIImageView in my custom cell (Swift 3): let cell = self.tableView.dequeueReusableCell(withIdentifier: 'Feedcell', for: indexPath) as! FruitTableViewCell let hero: List_Feed hero = heroes[indexPath.row] if(hero.photo==''){ cell.cnHeight.constant = 0 cell.cnTopMargin.constant = 0 cell.cnB...
Lexa Navalny
1

votes
0

answer
46

Views

Transferring Data from CollectionView inside TableView to a New ViewController

So I have a main ViewController that has Horizontal Scrolling CollectionViews inside a TableView. When you click on an Item in the CollectionView it transfers all the data from the Item to a new ViewController to display it properly. The problem I am facing is when you click on the item in the Coll...
Aman Chawla
1

votes
1

answer
129

Views

UIButton title inside UITableViewCell changes on reuse

I have a table view which has a data that consists of both phone contacts and facebook friends. the cell's button title should be 'Invite' if the user is a contact and 'Add' if it is a facebook friend. However, the titles on each button are wrong and are swapping on scroll. here is my model: struc...
rendell
1

votes
0

answer
146

Views

fade out first row in tableView when insert a new row

I tried this code to fade out the first cell in tableView but that code work when scrolling the table only I need it work like Instagram live streaming chat streamController.swift func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - > UITableViewCell { var cell = tableView....
1

votes
1

answer
136

Views

Swift 3 tableview.reloadData on main thread, not displaying cells properly

In a simple TableViewController i am calling ClouKit deleteRecord in a UIAlertController. // 2. When the user clicks OK. alert.addAction(UIAlertAction(title: 'OK', style: .default, handler: { [weak alert] (_) in LSCloudKit.shared.deleteRecord(record: login.toCKRecord(), completion: { (success) in le...
Pascal Duff
1

votes
0

answer
112

Views

Delphi + iOS: how to implement UIContextualActionHandler in Delphi/FMX?

The iOS 11 SDK introduces two new UITableView methods for handling swipe actions: leadingSwipeActionsConfigurationForRowAtIndexPath trailingSwipeActionsConfigurationForRowAtIndexPath Objective-C: - (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView leadingSwipeActionsConfigur...
vitaliy-zh
1

votes
3

answer
1.3k

Views

How i can fill two different tableview in one viewcontroller in swift 3

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { if tableView == table1{ let cell = tableView.dequeueReusableCell(withIdentifier: 'cell') as! acntTableViewCell cell.account.text = account[indexPath.row].email return cell } else if tableView == table2 {...
ahmed
1

votes
2

answer
541

Views

How to make textField in TableViewCell editable when edit button of NavigationBar is pressed?

Developing an iOS application with Xcode ver 9.2, Swift. When the edit button on the top right of the NavigationBar is pressed, how to change the textField in the TableViewCell to make it editable? To prevent the TextField from being edited in the initial display, I set textField.isEnabled = false w...
TakeYourMark
1

votes
1

answer
63

Views

Having trouble displaying contacts with special characters on TableView

I've got a problem populating my table view. Currently, I'm creating a phone book. This phone book will simply contain contacts that are fetched with the help of the Contacts framework. These contacts are separated into sections alphabetically. Sadly, although my contacts are well displayed alphabe...
1

votes
2

answer
50

Views

Swift - Error during simple Segue between TableViewController -> ViewControllers

I am attempting to pass two string values containing the values of a 'Bar Name' and its respective 'Street Name' using a segue between a TableViewController and a ViewController. I am using a class called HomeController and another called BarPage. I have the following code prepared for the home scre...
user7366442
1

votes
0

answer
164

Views

Trouble using UILocalizedIndexedCollation to filter a table view with the inputed user's name.

I'm new to this forum! I am having a little bit of trouble sorting my Person's array with the use of UILocalizedIndexedCollation. Code I created the following class: @objc class Person : NSObject { @objc var firstName: String! @objc var lastName: String! init(firstName: String, lastName: String) {...
ozark
1

votes
0

answer
351

Views

Constraints ignored when using xib/nib in xcode 9

Just to preface, this issue is similar to the problem of constraints being ignored in prototype cells, but I have tried all of the recommendations on this site and none have worked. I've tried: Autolayout is ignored in Custom UITableViewCell iOS TableView Constraints doesn’t work autolayout issue...
adazebra
1

votes
0

answer
41

Views

Is it possible to change table view's cells dynamically by using a segmented control?

I have a view controller with a segmented control and a table view inside of it. I know that it is possible to change the content of the cells in that table view by using a segmented control (by keeping these cells the same). But what if the layout of cells differ, like there are different subviews...
Tigran Iskandaryan
1

votes
1

answer
86

Views

Continue scrolling UITableView when superView is at the top

I have a MainViewController with a bottomSheet as a childViewController on top of it. The bottomSheet at first is presented on 1/4 of the MainViewController, with a UIPanGestureRecognizer attached to it and a UITableView as a subView of the bottomSheet pinned to the 4 edges of the view. I can pa...
MEnnabah
1

votes
0

answer
211

Views

XLPagerTabStrip - How to add UISearchController

I am using this library: https://github.com/xmartlabs/XLPagerTabStrip My problem is that I can't resolve an issue with adding a UISearchController for one of ButtonBarPagerTabStripViewController child viewController - UITableViewController. The searchBar does not appear when trying to add it under...
PiotrCh
1

votes
3

answer
1.6k

Views

Removing the separator between section header & uitableviewcell

How do I remove the lines indicated in the picture? I have tried the following suggestions and none of them have worked for me, How do I remove the borders of a UITableView? Remove separator line for only one cell Hide separator line on one UITableViewCell This is my current code in cellForRowAt: if...
marko calvocruz
1

votes
0

answer
168

Views

How to save inserted TableView Cells in the UserDefaults

Ive been attempting to save cells that are added into a TableView once the app is closed. Whenever the app is reloaded or reopened the added cells are deleted. This is my function to insert a cell when a button is tapped: func insertMessageInRow() { messages.append(MessageTextField.text!) let index...
Carter Cobb
1

votes
0

answer
170

Views

Adding review[] with google places details

Following the Google API documentation (https://developers.google.com/places/web-service/details) I'm trying to adding for the first time review[] with google places details in my custom table view cell, but it does not work. I already added other parameters like the website and phone number and bot...
fisherM
1

votes
1

answer
137

Views

Why do the images keep on resizing as I scroll through my UITableView?

All the images load fine and display with their width as the phone and their height as determined by the aspect ratio of the photo. Initally all of the photos except for the third one load in this manner, after scrolling out of view of the image and back the image resizes correctly but intially the...
user372382
1

votes
2

answer
94

Views

“copy” option not showing for UITableView row

I am coming to this minor problem where I have implement to perform a copy popover to show when user is copying the item on the table view cell. But, for some reason it is not showing up the copy popover. Please, have a look at my code and see what I have done wrong. This is the code: func tableVie...
iSwift
1

votes
2

answer
332

Views

How to use NSFetchedResultsController to update tableview content

I am updating certain parts of coredata and I want the NSFetchedResultsController to automatically reload the tableview with all the animations. I am changing a coredata element that is used to sort tableview. I am doing this by swiping to the right on the cell and then changing that particular tabl...
Osama Naeem
1

votes
0

answer
55

Views

Emoji icon appear as white color in the tableView

Emoji icon appear as white color in the tableView. This happens when scrolling through the tableview (probably because of dequeueReusableCell). I get the list from my phone contacts, when name contains emoji.
Yakir
1

votes
1

answer
111

Views

Unable to simultaneously satisfy constraints. Although no duplicate/unwanted constraint is defined

Title may sound a duplicate, but I have been trying to resolve it for hours, but I couldn't find any duplicate or unwanted constraint. Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each cons...
Bista
1

votes
0

answer
50

Views

After setting selectedBackgroundView of UITableViewCell when the cell is selected, background color of other components get changed

Due to some permission issue, in my tableView some cell can be selected by user and some cell can't be selected by that user. What I did in my cellForRowAtIndexPath is: -(UITableViewCell *) tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ int row = (int)[indexPat...
Rashad
1

votes
1

answer
156

Views

UITableView detect docking and undocking of section header

I have a tableView with a viewForHeaderInSection set to a custom view. What I am trying to accomplish is to change this view to a different view when the header section becomes sticky. Is there a callback that I can use to detect when the tableView's section header sticks to the top? Any pointers...
Rao
1

votes
1

answer
370

Views

Filtering UItableview Swift IOS

I am trying to filter a UITableView based on variables that have been passed back from another VC which is a Eureka form handling the filter UI. I would like to filter the tableview based on these two variables : var filterByPrice: Float? var filteredRentalTypes: Set? I have got the price filter wo...
George Woolley
1

votes
1

answer
62

Views

Updating content size height

I have a UIScrollView consisting of a UITableView tucked below a UIView. The UITableView has cells of dynamic height, and I'm having trouble setting the contentSize of the scroll view. If I set it in viewDidLayoutSubviews, it works fine, but calling it from viewDidLoad won't work. Calling it from vi...
Chris Jones

View additional questions